diff -Nru wayland-0.95.0+git20120801.7f3d2277/.lastcommit wayland-0.95.0+git20120920.4b681a7f/.lastcommit --- wayland-0.95.0+git20120801.7f3d2277/.lastcommit 2012-08-01 06:22:04.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/.lastcommit 2012-09-20 10:02:05.000000000 +0000 @@ -1 +1 @@ -commit 7f3d22776bc74d7deae0966681ed176363ea1781 +commit 4b681a7fd4bee01c4d3385e69ee47ed3856c2229 diff -Nru wayland-0.95.0+git20120801.7f3d2277/ChangeLog wayland-0.95.0+git20120920.4b681a7f/ChangeLog --- wayland-0.95.0+git20120801.7f3d2277/ChangeLog 2012-08-01 06:22:25.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/ChangeLog 2012-09-20 10:02:24.000000000 +0000 @@ -1,9 +1,182 @@ -commit 4a53580365ce6af5d27dfee1fd4a49368248818a +commit 0fd2d1d805eb7491a49a90024aaf8e46b1723fea Author: Rico Tzschichholz -Date: Wed Aug 1 08:22:04 2012 +0200 +Date: Thu Sep 20 12:02:05 2012 +0200 Add debian tree from origin/ubuntu +commit 4b681a7fd4bee01c4d3385e69ee47ed3856c2229 +Author: Diego Viola +Date: Thu Sep 13 06:45:06 2012 -0400 + + Fix typo (ratio, not ration) + + Signed-off-by: Diego Viola + +commit 003a946aa66333ac1cf927fc1498d85c2c9644f9 +Author: David Herrmann +Date: Tue Sep 11 16:09:34 2012 +0200 + + event-loop: export wl_event_loop_dispatch_idle() + + When integrating the wayland event-loop into another event-loop, we + currently have no chance of checking whether there are pending idle + sources that have to be called. This patch exports the + "dispatch_idle_sources()" call so other event loops can call this before + going to sleep. This is what wl_event_loop_dispatch() currently does so we + simply allow external event-loops to do the same now. + + To avoid breaking existing applications, we keep the call to + dispatch_idle_sources() in wl_event_loop_dispatch() for now. However, if + we want we can remove this later and require every application to call + this manually. This needs to be discussed, but the overhead is negligible + so we will probably leave it as it is. + + This finally allows to fully integrate the wayland-server API into + existing event-loops without any nasty workarounds. + + Signed-off-by: David Herrmann + +commit 9fe135c46f2457d6dc694e4c02d2defeab6986b0 +Author: David Herrmann +Date: Mon Sep 10 11:20:35 2012 +0200 + + wayland-server: return new ID in wl_client_add_resource() + + wl_client_add_resource() used to return no error even though the new + resource wasn't added to the client. This currently makes it very easy to + DOS weston by simply posting thousands of "create_surface" requests with + an invalid ID. Weston simply assumes the wl_client_add_resource() request + succeeds but will never destroy the surface again as the "destroy" signal + is never called (because the surface isn't linked into the wl_map). + + This change makes wl_client_add_resource() return the new ID of the added + object and 0 on failure. Servers (like weston) can now correctly + immediately destroy the surface when this call fails instead of leaving + the surface around and producing memory-leaks. + + Instead of returning -1 on failure and 0 on success, I made it return the + new ID as this seems more appropriate. We can directly use it when calling + it with new_id==0. + + Signed-off-by: David Herrmann + +commit 397a0c6ada56e4330ebf2bc662010ca8d32a2c73 +Author: David Herrmann +Date: Sat Sep 8 17:47:15 2012 +0200 + + event-loop: remove dead code + + There is really no need to increment "n" if we never read the value. The + do-while() loop overwrites the value before it is read the first time. + + Signed-off-by: David Herrmann + +commit 7fafa994a42e3d8455afbd8d6ba39047b7c1f13d +Author: Philipp Brüschweiler +Date: Thu Sep 6 18:54:02 2012 +0200 + + cursor: add cursor.pcf and extraction program + +commit 9ce9336c5704510a3f5a57ef377870764217f2ec +Author: Philipp Brüschweiler +Date: Thu Sep 6 18:54:01 2012 +0200 + + cursor: Add a default cursor theme + + This theme is loaded when the specified cursor theme can not be found. + + These cursors are extracted from the xorg sources and transformed into + raw ARGB data by a small helper program (commited separately). + +commit 2be6e0ed142bac669398a9ad26d336666fa53216 +Author: Kristian Høgsberg +Date: Wed Aug 29 14:12:11 2012 -0400 + + tests: Quiet warning + +commit 91931bcabb0fba1a8b76f92cefa33fdeb1b74a8b +Author: U. Artie Eoff +Date: Thu Aug 16 18:12:05 2012 -0700 + + tests: ensure sanity leak check tests pass when leak checks are disabled. + + This finalizes Robert Bradfords patch to allow NO_ASSERT_LEAK_CHECK + environment variable to disable leak checks in unit tests. + + Signed-off-by: U. Artie Eoff + +commit c95c2dffb0a37ae50350319c52b30629c32f6660 +Author: Rob Bradford +Date: Thu Aug 16 18:12:04 2012 -0700 + + tests: Allow disabling leak checking assertions by env + + Some code coverage tools trigger these assertions when run against the test + suite since they don't free all their memory. + +commit 7d3ccec18eda14a30c3edae608195898262f0d27 +Author: Kristian Høgsberg +Date: Wed Aug 15 23:03:21 2012 -0400 + + Add wl_shm_buffer_create() + +commit c855d6eec4c5e63489da5bc08451a2376e6d2aea +Author: Kristian Høgsberg +Date: Tue Aug 14 13:16:10 2012 -0400 + + client: Add wl_display_connect_to_fd() function + + This lets us connect a display to an already existing socket fd. + +commit 599a455fb4bec20a5c9de65f7f108a92ae640606 +Author: Scott Moreau +Date: Thu Aug 16 00:04:27 2012 -0600 + + protocol: Fix typo. + +commit 0a633704e6636c475f20a82e96b6ed03a7bc9c18 +Author: Philipp Brüschweiler +Date: Tue Aug 14 11:53:08 2012 +0200 + + socket-test: don't try to be clever, fail if no XDG_RUNTIME_DIR is set + + Not only setenv(), also putenv() allocates memory on my system + (glibc 2.16.0). Just fail with a clear message if XDG_RUNTIME_DIR is + not set. + + https://bugs.freedesktop.org/show_bug.cgi?id=52618 + +commit b57694ca0e9dc7d2845ce9fb0ac9c4b0ebc940ce +Author: Christopher Michael +Date: Sat Aug 11 15:09:02 2012 +0100 + + Add support for X cursor themes. + + This patch adds a few more directories to search for xcursor themes. + + Along with the weston patch, this adds the ability to configure weston + to use an X11 cursor theme. Previously, wayland cursor would just look + in the icons and pixmaps directories for cursor images to load. This + adds the ability to also search in the x cursors directory. + +commit 89eddb4245380229094e03aea01d6c598386ab75 +Author: Christopher Michael +Date: Sat Aug 11 15:35:47 2012 +0100 + + Fix grammar in the rendering section. + + Upon reading some docs, I found a small grammar mistake in the + rendering section. This patch fixes that. + +commit 915cdeee29291332384c4cf9ee67758e19500131 +Author: Kristian Høgsberg +Date: Fri Aug 3 22:39:51 2012 -0400 + + connection: zero out string padding + + We don't want to send random data to the client and this also keeps + valgrind happy. + commit 7f3d22776bc74d7deae0966681ed176363ea1781 Author: Andre Heider Date: Tue Jul 31 18:59:09 2012 +0200 diff -Nru wayland-0.95.0+git20120801.7f3d2277/Makefile.in wayland-0.95.0+git20120920.4b681a7f/Makefile.in --- wayland-0.95.0+git20120801.7f3d2277/Makefile.in 2012-08-01 06:22:24.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/Makefile.in 2012-09-20 10:02:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.5 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -643,7 +643,7 @@ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) + chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) diff -Nru wayland-0.95.0+git20120801.7f3d2277/aclocal.m4 wayland-0.95.0+git20120920.4b681a7f/aclocal.m4 --- wayland-0.95.0+git20120801.7f3d2277/aclocal.m4 2012-08-01 06:22:21.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/aclocal.m4 2012-09-20 10:02:19.000000000 +0000 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.11.5 -*- Autoconf -*- +# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, @@ -198,7 +198,7 @@ [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.5], [], +m4_if([$1], [1.11.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -214,7 +214,7 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.5])dnl +[AM_AUTOMAKE_VERSION([1.11.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) diff -Nru wayland-0.95.0+git20120801.7f3d2277/cursor/Makefile.in wayland-0.95.0+git20120920.4b681a7f/cursor/Makefile.in --- wayland-0.95.0+git20120801.7f3d2277/cursor/Makefile.in 2012-08-01 06:22:23.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/cursor/Makefile.in 2012-09-20 10:02:23.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.5 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, diff -Nru wayland-0.95.0+git20120801.7f3d2277/cursor/convert_font.c wayland-0.95.0+git20120920.4b681a7f/cursor/convert_font.c --- wayland-0.95.0+git20120801.7f3d2277/cursor/convert_font.c 1970-01-01 00:00:00.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/cursor/convert_font.c 2012-09-20 10:02:05.000000000 +0000 @@ -0,0 +1,531 @@ +/* + * Copyright © 2012 Philipp Brüschweiler + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +/* + * This is a small, hacky tool to extract cursors from a .pcf file. + * The information about the file format has been gathered from + * http://fontforge.org/pcf-format.html + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define min(a, b) ((a) < (b) ? (a) : (b)) +#define max(a, b) ((a) > (b) ? (a) : (b)) + +struct glyph { + char *name; + int16_t left_bearing, right_bearing, ascent, descent; + + int16_t width, height; + int16_t hotx, hoty; + + int32_t data_format; + char *data; +}; + +static struct { + int count; + struct glyph *glyphs; +} extracted_font = {0, NULL}; + +#define PCF_PROPERTIES (1<<0) +#define PCF_ACCELERATORS (1<<1) +#define PCF_METRICS (1<<2) +#define PCF_BITMAPS (1<<3) +#define PCF_INK_METRICS (1<<4) +#define PCF_BDF_ENCODINGS (1<<5) +#define PCF_SWIDTHS (1<<6) +#define PCF_GLYPH_NAMES (1<<7) +#define PCF_BDF_ACCELERATORS (1<<8) + +#define PCF_DEFAULT_FORMAT 0x00000000 +#define PCF_INKBOUNDS 0x00000200 +#define PCF_ACCEL_W_INKBOUNDS 0x00000100 +#define PCF_COMPRESSED_METRICS 0x00000100 + +#define PCF_FORMAT_MASK 0xffffff00 + +struct pcf_header { + char header[4]; + int32_t table_count; + struct toc_entry { + int32_t type; + int32_t format; + int32_t size; + int32_t offset; + } tables[0]; +}; + +struct compressed_metrics { + uint8_t left_sided_bearing; + uint8_t right_side_bearing; + uint8_t character_width; + uint8_t character_ascent; + uint8_t character_descent; +}; + +struct uncompressed_metrics { + int16_t left_sided_bearing; + int16_t right_side_bearing; + int16_t character_width; + int16_t character_ascent; + int16_t character_descent; + uint16_t character_attributes; +}; + +struct metrics { + int32_t format; + union { + struct { + int16_t count; + struct compressed_metrics compressed_metrics[0]; + } compressed; + struct { + int32_t count; + struct uncompressed_metrics uncompressed_metrics[0]; + } uncompressed; + }; +}; + +struct glyph_names { + int32_t format; + int32_t glyph_count; + int32_t offsets[0]; +}; + +struct bitmaps { + int32_t format; + int32_t glyph_count; + int32_t offsets[0]; +}; + +static void +handle_compressed_metrics(int32_t count, struct compressed_metrics *m) +{ + printf("metrics count: %d\n", count); + extracted_font.count = count; + extracted_font.glyphs = calloc(count, sizeof(struct glyph)); + + int i; + for (i = 0; i < count; ++i) { + struct glyph *glyph = &extracted_font.glyphs[i]; + glyph->left_bearing = + ((int16_t) m[i].left_sided_bearing) - 0x80; + glyph->right_bearing = + ((int16_t) m[i].right_side_bearing) - 0x80; + glyph->width = ((int16_t) m[i].character_width) - 0x80; + glyph->ascent = ((int16_t) m[i].character_ascent) - 0x80; + glyph->descent = ((int16_t) m[i].character_descent) - 0x80; + + /* computed stuff */ + glyph->height = glyph->ascent + glyph->descent; + + glyph->hotx = -glyph->left_bearing; + glyph->hoty = glyph->ascent; + } +} + +static void +handle_metrics(void *metricbuf) +{ + struct metrics *metrics = metricbuf; + printf("metric format: %x\n", metrics->format); + + if ((metrics->format & PCF_FORMAT_MASK) == PCF_DEFAULT_FORMAT) { + printf("todo...\n"); + } else if ((metrics->format & PCF_FORMAT_MASK) == + PCF_COMPRESSED_METRICS) { + handle_compressed_metrics( + metrics->compressed.count, + &metrics->compressed.compressed_metrics[0]); + } else { + printf("incompatible format\n"); + abort(); + } +} + +static void +handle_glyph_names(struct glyph_names *names) +{ + printf("glyph count %d\n", names->glyph_count); + + if (names->glyph_count != extracted_font.count) { + abort(); + } + + printf("glyph names format %x\n", names->format); + + void *names_start = ((void*) names) + sizeof(struct glyph_names) + + (names->glyph_count + 1) * sizeof(int32_t); + + int i; + for (i = 0; i < names->glyph_count; ++i) { + int32_t start = names->offsets[i]; + int32_t end = names->offsets[i+1]; + char *name = names_start + start; + extracted_font.glyphs[i].name = calloc(1, end - start + 1); + memcpy(extracted_font.glyphs[i].name, name, end - start); + } +} + +static void +handle_bitmaps(struct bitmaps *bitmaps) +{ + printf("bitmaps count %d\n", bitmaps->glyph_count); + + if (bitmaps->glyph_count != extracted_font.count) { + abort(); + } + + printf("format %x\n", bitmaps->format); + + if (bitmaps->format != 2) { + printf("format not yet supported\n"); + abort(); + } + + void *bitmaps_start = ((void*) bitmaps) + sizeof(struct bitmaps) + + (bitmaps->glyph_count + 4) * sizeof(int32_t); + + int i; + for (i = 0; i < bitmaps->glyph_count; ++i) { + int32_t offset = bitmaps->offsets[i]; + struct glyph *glyph = &extracted_font.glyphs[i]; + glyph->data_format = bitmaps->format; + + glyph->data = bitmaps_start + offset; + } +} + +static void +handle_pcf(void *fontbuf) +{ + struct pcf_header *header = fontbuf; + printf("tablecount %d\n", header->table_count); + + int i; + for (i = 0; i < header->table_count; ++i) { + struct toc_entry *entry = &header->tables[i]; + printf("type: %d\n", entry->type); + if (entry->type == PCF_METRICS) { + handle_metrics(fontbuf + entry->offset); + } else if (entry->type == PCF_GLYPH_NAMES) { + handle_glyph_names(fontbuf + entry->offset); + } else if (entry->type == PCF_BITMAPS) { + handle_bitmaps(fontbuf + entry->offset); + } + } +} + +static char +get_glyph_pixel(struct glyph *glyph, int x, int y) +{ + int absx = glyph->hotx + x; + int absy = glyph->hoty + y; + + if (absx < 0 || absx >= glyph->width || + absy < 0 || absy >= glyph->height) + return 0; + + int stride = (glyph->width + 31) / 32 * 4; + unsigned char block = glyph->data[absy * stride + (absx/8)]; + int idx = absx % 8; + return (block >> idx) & 1; +} + +static struct { + uint32_t *data; + size_t capacity, size; +} data_buffer; + +static void +init_data_buffer() +{ + data_buffer.data = malloc(sizeof(uint32_t) * 10); + data_buffer.capacity = 10; + data_buffer.size = 0; +} + +static void +add_pixel(uint32_t pixel) +{ + if (data_buffer.size == data_buffer.capacity) { + data_buffer.capacity *= 2; + data_buffer.data = + realloc(data_buffer.data, + sizeof(uint32_t) * data_buffer.capacity); + } + data_buffer.data[data_buffer.size++] = pixel; +} + +struct reconstructed_glyph { + int32_t width, height; + int32_t hotspot_x, hotspot_y; + size_t offset; + char *name; +}; + +static void +reconstruct_glyph(struct glyph *cursor, struct glyph *mask, char *name, + struct reconstructed_glyph *glyph) +{ + int minx = min(-cursor->hotx, -mask->hotx); + int maxx = max(cursor->right_bearing, mask->right_bearing); + + int miny = min(-cursor->hoty, -mask->hoty); + int maxy = max(cursor->height - cursor->hoty, + mask->height - mask->hoty); + + int width = maxx - minx; + int height = maxy - miny; + + glyph->name = strdup(name); + glyph->width = width; + glyph->height = height; + glyph->hotspot_x = -minx; + glyph->hotspot_y = -miny; + glyph->offset = data_buffer.size; + + int x, y; + for (y = miny; y < maxy; ++y) { + for (x = minx; x < maxx; ++x) { + char alpha = get_glyph_pixel(mask, x, y); + if (alpha) { + char color = get_glyph_pixel(cursor, x, y); + if (color) + add_pixel(0xff000000); + else + add_pixel(0xffffffff); + } else { + add_pixel(0); + } + } + } +} + +/* From http://cgit.freedesktop.org/xorg/lib/libXfont/tree/src/builtins/fonts.c */ +static const char cursor_licence[] = + "/*\n" + "* Copyright 1999 SuSE, Inc.\n" + "*\n" + "* Permission to use, copy, modify, distribute, and sell this software and its\n" + "* documentation for any purpose is hereby granted without fee, provided that\n" + "* the above copyright notice appear in all copies and that both that\n" + "* copyright notice and this permission notice appear in supporting\n" + "* documentation, and that the name of SuSE not be used in advertising or\n" + "* publicity pertaining to distribution of the software without specific,\n" + "* written prior permission. SuSE makes no representations about the\n" + "* suitability of this software for any purpose. It is provided \"as is\"\n" + "* without express or implied warranty.\n" + "*\n" + "* SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL\n" + "* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE\n" + "* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n" + "* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION\n" + "* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN\n" + "* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n" + "*\n" + "* Author: Keith Packard, SuSE, Inc.\n" + "*/\n"; + +static void +write_output_file(struct reconstructed_glyph *glyphs, int n) +{ + int i, j, counter, size; + FILE *file = fopen("cursor_data.c", "w"); + uint32_t *data; + + fprintf(file, "%s\n", cursor_licence); + + fprintf(file, "static uint32_t cursor_data[] = {\n\t"); + + counter = 0; + for (i = 0; i < n; ++i) { + data = data_buffer.data + glyphs[i].offset; + size = glyphs[i].width * glyphs[i].height; + + for (j = 0; j < size; ++j) { + fprintf(file, "0x%08x, ", data[j]); + if (++counter % 6 == 0) + fprintf(file, "\n\t"); + } + } + fprintf(file, "\n};\n\n"); + + fprintf(file, + "static struct {\n" + "\tchar *name;\n" + "\tint width, height;\n" + "\tint hotspot_x, hotspot_y;\n" + "\tsize_t offset;\n" + "} cursor_metadata[] = {\n"); + + for (i = 0; i < n; ++i) + fprintf(file, "\t{ \"%s\", %d, %d, %d, %d, %zu },\n", + glyphs[i].name, + glyphs[i].width, glyphs[i].height, + glyphs[i].hotspot_x, glyphs[i].hotspot_y, + glyphs[i].offset); + + fprintf(file, "};"); + + fclose(file); +} + +struct glyph * +find_mask_glyph(char *name) +{ + const char mask[] = "_mask"; + const int masklen = strlen(mask); + + int len = strlen(name); + int i; + for (i = 0; i < extracted_font.count; ++i) { + struct glyph *g = &extracted_font.glyphs[i]; + int l2 = strlen(g->name); + if ((l2 == len + masklen) && + (memcmp(g->name, name, len) == 0) && + (memcmp(g->name + len, mask, masklen) == 0)) { + return g; + } + } + return NULL; +} + +static void +output_all_cursors() +{ + int i, j; + struct reconstructed_glyph *glyphs = + malloc(sizeof(struct reconstructed_glyph) * + extracted_font.count/2); + j = 0; + + for (i = 0; i < extracted_font.count; ++i) { + struct glyph *g = &extracted_font.glyphs[i]; + if (strstr(g->name, "_mask")) + continue; + + struct glyph *mask = find_mask_glyph(g->name); + + reconstruct_glyph(g, mask, g->name, &glyphs[j]); + j++; + } + + write_output_file(glyphs, extracted_font.count/2); +} + +static void +find_cursor_and_mask(const char *name, + struct glyph **cursor, + struct glyph **mask) +{ + int i; + char mask_name[100]; + sprintf(mask_name, "%s_mask", name); + + *cursor = *mask = NULL; + + for (i = 0; i < extracted_font.count && (!*mask || !*cursor); ++i) { + struct glyph *g = &extracted_font.glyphs[i]; + if (!strcmp(name, g->name)) + *cursor = g; + else if (!strcmp(mask_name, g->name)) + *mask = g; + } +} + +static struct { + char *target_name, *source_name; +} interesting_cursors[] = { + { "bottom_left_corner", "bottom_left_corner" }, + { "bottom_right_corner", "bottom_right_corner" }, + { "bottom_side", "bottom_side" }, + { "grabbing", "fleur" }, + { "left_ptr", "left_ptr" }, + { "left_side", "left_side" }, + { "right_side", "right_side" }, + { "top_left_corner", "top_left_corner" }, + { "top_right_corner", "top_right_corner" }, + { "top_side", "top_side" }, + { "xterm", "xterm" }, + { "hand1", "hand1" }, + { "watch", "watch" } +}; + +static void +output_interesting_cursors() +{ + int i; + int n = sizeof(interesting_cursors) / sizeof(interesting_cursors[0]); + struct reconstructed_glyph *glyphs = + malloc(n * sizeof(*glyphs)); + + for (i = 0; i < n; ++i) { + struct glyph *cursor, *mask; + find_cursor_and_mask(interesting_cursors[i].source_name, + &cursor, &mask); + if (!cursor) { + printf("no cursor for %s\n", + interesting_cursors[i].source_name); + abort(); + } + if (!mask) { + printf("no mask for %s\n", + interesting_cursors[i].source_name); + abort(); + } + reconstruct_glyph(cursor, mask, + interesting_cursors[i].target_name, + &glyphs[i]); + } + + write_output_file(glyphs, n); +} + +int main() +{ + const char filename[] = "cursor.pcf"; + + int fd = open(filename, O_RDONLY); + struct stat filestat; + + fstat(fd, &filestat); + + void *fontbuf = mmap(NULL, filestat.st_size, PROT_READ, + MAP_PRIVATE, fd, 0); + + handle_pcf(fontbuf); + + init_data_buffer(); + + //output_all_cursors(); + output_interesting_cursors(); +} Binary files /tmp/QreeBeJi4D/wayland-0.95.0+git20120801.7f3d2277/cursor/cursor.pcf and /tmp/9z_mGCD6XK/wayland-0.95.0+git20120920.4b681a7f/cursor/cursor.pcf differ diff -Nru wayland-0.95.0+git20120801.7f3d2277/cursor/cursor_data.c wayland-0.95.0+git20120920.4b681a7f/cursor/cursor_data.c --- wayland-0.95.0+git20120801.7f3d2277/cursor/cursor_data.c 1970-01-01 00:00:00.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/cursor/cursor_data.c 2012-09-20 10:02:05.000000000 +0000 @@ -0,0 +1,548 @@ +/* +* Copyright 1999 SuSE, Inc. +* +* Permission to use, copy, modify, distribute, and sell this software and its +* documentation for any purpose is hereby granted without fee, provided that +* the above copyright notice appear in all copies and that both that +* copyright notice and this permission notice appear in supporting +* documentation, and that the name of SuSE not be used in advertising or +* publicity pertaining to distribution of the software without specific, +* written prior permission. SuSE makes no representations about the +* suitability of this software for any purpose. It is provided "as is" +* without express or implied warranty. +* +* SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL +* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE +* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +* +* Author: Keith Packard, SuSE, Inc. +*/ + +static uint32_t cursor_data[] = { + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, + 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0xff000000, + 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, + 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, + 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, + 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0xff000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0x00000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0x00000000, + 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0xffffffff, 0x00000000, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0x00000000, 0xffffffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, + 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, + 0xff000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, + 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xffffffff, 0xff000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, + 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, + 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, + 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, + 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0x00000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0xff000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0xff000000, + 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, + 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, + 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, +}; + +static struct cursor_metadata { + char *name; + int width, height; + int hotspot_x, hotspot_y; + size_t offset; +} cursor_metadata[] = { + { "bottom_left_corner", 16, 16, 1, 14, 0 }, + { "bottom_right_corner", 16, 16, 14, 14, 256 }, + { "bottom_side", 15, 16, 7, 14, 512 }, + { "grabbing", 16, 16, 8, 8, 752 }, + { "left_ptr", 10, 16, 1, 1, 1008 }, + { "left_side", 16, 15, 1, 7, 1168 }, + { "right_side", 16, 15, 14, 7, 1408 }, + { "top_left_corner", 16, 16, 1, 1, 1648 }, + { "top_right_corner", 16, 16, 14, 1, 1904 }, + { "top_side", 15, 16, 7, 1, 2160 }, + { "xterm", 9, 16, 4, 8, 2400 }, + { "hand1", 13, 16, 12, 0, 2544 }, + { "watch", 16, 16, 15, 9, 2752 }, +}; diff -Nru wayland-0.95.0+git20120801.7f3d2277/cursor/wayland-cursor.c wayland-0.95.0+git20120920.4b681a7f/cursor/wayland-cursor.c --- wayland-0.95.0+git20120801.7f3d2277/cursor/wayland-cursor.c 2012-08-01 06:22:03.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/cursor/wayland-cursor.c 2012-09-20 10:02:05.000000000 +0000 @@ -181,6 +181,71 @@ free(cursor); } +#include "cursor_data.c" + +static struct wl_cursor * +wl_cursor_create_from_data(struct cursor_metadata *metadata, + struct wl_cursor_theme *theme) +{ + struct cursor *cursor; + struct cursor_image *image; + int size; + + cursor = malloc(sizeof *cursor); + if (!cursor) + return NULL; + + cursor->cursor.image_count = 1; + cursor->cursor.images = malloc(sizeof *cursor->cursor.images); + if (!cursor->cursor.images) { + free(cursor); + return NULL; + } + + cursor->cursor.name = strdup(metadata->name); + cursor->total_delay = 0; + + image = malloc(sizeof *image); + if (!image) { + free(cursor->cursor.name); + free(cursor->cursor.images); + free(cursor); + return NULL; + } + + cursor->cursor.images[0] = (struct wl_cursor_image *) image; + image->theme = theme; + image->buffer = NULL; + image->image.width = metadata->width; + image->image.height = metadata->height; + image->image.hotspot_x = metadata->hotspot_x; + image->image.hotspot_y = metadata->hotspot_y; + image->image.delay = 0; + + size = metadata->width * metadata->height * sizeof(uint32_t); + image->offset = shm_pool_allocate(theme->pool, size); + memcpy(theme->pool->data + image->offset, + cursor_data + metadata->offset, size); + + return &cursor->cursor; +} + +static void +load_default_theme(struct wl_cursor_theme *theme) +{ + uint32_t i; + + free(theme->name); + theme->name = strdup("default"); + + theme->cursor_count = ARRAY_LENGTH(cursor_metadata);; + theme->cursors = malloc(theme->cursor_count * sizeof(*theme->cursors)); + + for (i = 0; i < theme->cursor_count; ++i) + theme->cursors[i] = + wl_cursor_create_from_data(&cursor_metadata[i], theme); +} + static struct wl_cursor * wl_cursor_create_from_xcursor_images(XcursorImages *images, struct wl_cursor_theme *theme) @@ -261,7 +326,8 @@ * \param shm The compositor's shm interface. * * \return An object representing the theme that should be destroyed with - * wl_cursor_theme_destroy() or %NULL on error. + * wl_cursor_theme_destroy() or %NULL on error. If no theme with the given + * name exists, a default theme will be loaded. */ WL_EXPORT struct wl_cursor_theme * wl_cursor_theme_load(const char *name, int size, struct wl_shm *shm) @@ -290,6 +356,9 @@ xcursor_load_theme(name, size, load_callback, theme); + if (theme->cursor_count == 0) + load_default_theme(theme); + return theme; } diff -Nru wayland-0.95.0+git20120801.7f3d2277/cursor/xcursor.c wayland-0.95.0+git20120920.4b681a7f/cursor/xcursor.c --- wayland-0.95.0+git20120801.7f3d2277/cursor/xcursor.c 2012-08-01 06:22:03.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/cursor/xcursor.c 2012-09-20 10:02:05.000000000 +0000 @@ -606,7 +606,7 @@ #endif #ifndef XCURSORPATH -#define XCURSORPATH "~/.icons:/usr/share/icons:/usr/share/pixmaps:"ICONDIR +#define XCURSORPATH "~/.icons:/usr/share/icons:/usr/share/pixmaps:~/.cursors:/usr/share/cursors/xorg-x11:"ICONDIR #endif static const char * diff -Nru wayland-0.95.0+git20120801.7f3d2277/d wayland-0.95.0+git20120920.4b681a7f/d --- wayland-0.95.0+git20120801.7f3d2277/d 2012-05-30 06:58:16.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/d 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -diff --git a/cursor/Makefile.am b/cursor/Makefile.am -index 503559a..9403f92 100644 ---- a/cursor/Makefile.am -+++ b/cursor/Makefile.am -@@ -11,4 +11,4 @@ libwayland_cursor_la_LIBADD = $(top_builddir)/src/libwayland-client.la - pkgconfigdir = $(libdir)/pkgconfig - pkgconfig_DATA = wayland-cursor.pc - --AM_CFLAGS = $(GCC_CFLAGS) -I../src -+AM_CFLAGS = $(GCC_CFLAGS) -I$(top_srcdir)/src -I$(top_builddir)/src -diff --git a/debian/libwayland-dev.install b/debian/libwayland-dev.install -index 02534df..9b01b5b 100644 ---- a/debian/libwayland-dev.install -+++ b/debian/libwayland-dev.install -@@ -7,9 +7,12 @@ usr/include - # Use no wildcards to ensure we spot any update: - usr/lib/*/libwayland-client.a - usr/lib/*/libwayland-client.so -+usr/lib/*/libwayland-cursor.a -+usr/lib/*/libwayland-cursor.so - usr/lib/*/libwayland-server.a - usr/lib/*/libwayland-server.so - usr/lib/*/pkgconfig/wayland-client.pc -+usr/lib/*/pkgconfig/wayland-cursor.pc - usr/lib/*/pkgconfig/wayland-server.pc - usr/share/aclocal/wayland-scanner.m4 - usr/share/aclocal/wayland-scanner.mk -diff --git a/debian/libwayland0.install b/debian/libwayland0.install -index 96fd067..4bac0c5 100644 ---- a/debian/libwayland0.install -+++ b/debian/libwayland0.install -@@ -1,5 +1,7 @@ - # Use no wildcards to ensure we spot any update: - usr/lib/*/libwayland-client.so.0 - usr/lib/*/libwayland-client.so.0.0.0 -+usr/lib/*/libwayland-cursor.so.0 -+usr/lib/*/libwayland-cursor.so.0.0.0 - usr/lib/*/libwayland-server.so.0 - usr/lib/*/libwayland-server.so.0.0.0 diff -Nru wayland-0.95.0+git20120801.7f3d2277/debian/changelog wayland-0.95.0+git20120920.4b681a7f/debian/changelog --- wayland-0.95.0+git20120801.7f3d2277/debian/changelog 2012-09-20 10:12:28.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/debian/changelog 2012-09-20 10:04:09.000000000 +0000 @@ -1,11 +1,54 @@ -wayland (0.95.0+git20120801.7f3d2277-0ubuntu0ricotz~precise) precise; urgency=medium +wayland (0.95.0+git20120920.4b681a7f-0ubuntu0ricotz~precise) precise; urgency=medium - * Checkout from git 20120801 (master branch) up to commit - 7f3d22776bc74d7deae0966681ed176363ea1781 + * Checkout from git 20120920 (master branch) up to commit + 4b681a7fd4bee01c4d3385e69ee47ed3856c2229 * Only added debian/ tree from origin/ubuntu - * hook: Ignore test failures. - -- Rico Tzschichholz Wed, 01 Aug 2012 08:22:27 +0200 + -- Rico Tzschichholz Thu, 20 Sep 2012 12:02:25 +0200 + +wayland (0.95.0-0ubuntu1) quantal; urgency=low + + * Merge from unreleased debian git, remaining changes + - debian/gbp.conf: + Point to ubuntu and upstream-ubuntu branches; use pristine-tar + - debian/rules: + Switch the gentarball target to generate tarball from upstream-ubuntu. + * Drop lintian overrides, get more in sync with the Debian packaging. + * Drop Replaces/Conflicts against the old package names, not needed + anymore. + + -- Timo Aaltonen Thu, 16 Aug 2012 14:52:50 +0300 + +wayland (0.95.0-1) UNRELEASED; urgency=low + + * New upstream release. + * Migrate to multiarch. + * copyright: Refresh. + * control: Update Standards-Version to 3.9.3, no changes. + * rules: Make it non-fatal to fail the tests, which don't all succeed + when ran in headless mode. + * rules: Drop the creation of hard dependencies, wayland should be + mostly API stable now. + * rules: Drop dh_auto_install override. dh_auto_install automatically + installs to debian/tmp whenever there are multiple binary packages. + * libwayland*.install: Add missing files. + * rules: Temporarily disable installing the protocol docs, decide where + to put them first. + * Add README.source + * Switch to source format 3.0 (quilt) due to the xz tarball. + + -- Timo Aaltonen Thu, 16 Aug 2012 13:04:41 +0300 + +wayland (0.85.0-2) unstable; urgency=low + + * Upload to unstable. + * Wayland/Weston aren't quite ready to replace Xorg yet, but let's + upload those to unstable anyway, so that people can find out by + themselves. On the plus side, mesa can stop getting wayland support + enabled in experimental, then disabled back when uploaded to unstable. + * Update long description, wayland-demos got replaced by weston. + + -- Cyril Brulebois Sun, 29 Apr 2012 22:34:18 +0200 wayland (0.85.0-1ubuntu2) precise; urgency=low @@ -161,201 +204,3 @@ happens. -- Cyril Brulebois Sat, 18 Jun 2011 13:38:40 +0200 - -wayland (0.1~git20110214.e4762a6a-0ubuntu2) oneiric; urgency=low - - * Simplify debian/rules code - * Fix almost all lintian complaints (LP: #724608) - * Switch to dpkg-source 3.0 (quilt) format - - -- Cosme Domínguez Díaz Tue, 17 May 2011 21:54:23 +0000 - -wayland (0.1~git20110214.e4762a6a-0ubuntu1) natty; urgency=low - - * Update to new git snapshot from 2011-02-14 up to commit e4762a6a. (This - is the most recent upstream commit that doesn't require moving to a - newer version of mesa.) - (LP: #700986) - * copyright: Update to match current codebase, and reformat to follow - dep5 style. - - -- Bryce Harrington Wed, 23 Feb 2011 18:13:23 -0800 - -wayland (0.1~git20101129.ac93a3d3-0ubuntu1) natty; urgency=low - - * Update to new git snapshot from 2010-11-29 up to commit ac93a3d3 - * copyright: Add GPL and Share-a-like licensing, used by a few files. - * control: - - Use stock natty package versions for libdrm, mesa, and cairo, now - that the archive versions have all the changes wayland requires. - (LP: #700986) - - Split out libwayland-server0 and libwayland-client0 as separate - binary packages and make wayland depend on them. - - -- Bryce Harrington Mon, 21 Feb 2011 18:35:33 -0800 - -wayland (0.1~git20101124.32ff6901-0ubuntu4) natty; urgency=low - - * Set up shlibs control file and make package name match sonames by - adding separate binary packages for libwayland-client and - libwayland-server, to permit handling future soname changes. - * Depend on libxkbcommon0 rather than libxkbcommon - - -- Bryce Harrington Mon, 24 Jan 2011 19:20:09 -0800 - -wayland (0.1~git20101124.32ff6901-0ubuntu3) maverick; urgency=low - - * debian/rules: Add install of wstart script - - -- Bryce Harrington Wed, 24 Nov 2010 18:13:23 -0800 - -wayland (0.1~git20101124.32ff6901-0ubuntu2) maverick; urgency=low - - * Add 100_install_demos.patch: Make the makefile install clients - and the compositor. - * debian/rules: - + Restore installation of ChangeLog - + Change from 'obj-*' to just 'build' for simplicity - + Use --program-prefix option to namespace demo programs instead of - manually renaming each binary - - -- Bryce Harrington Wed, 24 Nov 2010 17:55:39 -0800 - -wayland (0.1~git20101124.32ff6901-0ubuntu1) maverick; urgency=low - - * Update to new git snapshot from 2010-11-24 up to commit 32ff6901 - + Fix udev install path - + Various return value checking fixes - + Improve some error messages - + Address some build warnings - - -- Bryce Harrington Wed, 24 Nov 2010 13:04:15 -0800 - -wayland (0.1~git20101118.67f4ffdf-0ubuntu2) maverick; urgency=low - - * debian/rules: - + Install client binaries in .libs rather than the libtool wrappers - - -- Bryce Harrington Wed, 24 Nov 2010 11:33:28 -0800 - -wayland (0.1~git20101118.67f4ffdf-0ubuntu1) maverick; urgency=low - - * Update to new git snapshot from 2010-11-18 up to commit 67f4ffdf - + Fix SIGSEGV in create_pointer_images when EGL fails to initialize - + put console into KD_GRAPHICS mode at vt enter time so kernel doesn't blank - + Fix gears client - + Fix a bogus call to cairo_destroy - + Fix Wayland build instructions - + Install and dist udev rules file - + Add /wayland so we pick up generated header files - + Workaround an xcb-dri2 bug. - + Make sure there is a current context - + Use glTexSubImage to update the pixels to avoid respecification - + Fix link order for --as-needed linking - + Add a geometry option for x11 compositor - * debian/patches: - + Drop 100_vpath.path and 101_destdir.patch, since wayland now uses - autotools - * debian/control: - + Depend on newer cairo-gl and pin it to use version from PPA - preferrably to what's in the repo. - * debian/rules: - + Add --disable-gallium-egl and --enable-gallium-nouveau - * debian/*.install: - + Don't install so lib symlinks (causes invalid argument errors in cp) - - -- Bryce Harrington Fri, 19 Nov 2010 14:34:29 -0800 - -wayland (0.1~git20101026.012a0077-0ubuntu4) maverick; urgency=low - - * debian/*.install, debian/rules: Cleanup library installation - * debian/control: Pin libcairo2 version so the cairo-gl enabled package - from the PPA is preferred over whatever newer version is in Maverick. - - -- Bryce Harrington Mon, 08 Nov 2010 20:23:54 -0800 - -wayland (0.1~git20101026.012a0077-0ubuntu3) maverick; urgency=low - - * debian/*.install: Explicitly list libraries between install targets - * debian/control: - + Drop libeagle dependency - * debian/rules: - + Fix terminal name and path - + Install other clients - + Install .png's to /usr/share/wayland - - -- Bryce Harrington Sun, 07 Nov 2010 19:31:06 -0800 - -wayland (0.1~git20101026.012a0077-0ubuntu2) maverick; urgency=low - - * debian/rules: - + Force install of wayland-system-compositor - + Install wayland-xterm - - -- Bryce Harrington Sun, 07 Nov 2010 17:15:21 -0800 - -wayland (0.1~git20101026.012a0077-0ubuntu1) maverick; urgency=low - - * Git checkout from 20101026 (master branch) up to commit - 012a00777129cbb84fa88ba1b02e1f3b2dd1b4f8 - * debian/control: - + Add required libxkbcommon-dev library - + Depend on newer cairo - * debian/rules: - + Specify wayland build dir as an include directory - + Don't manually install headers into deb, but still copy - over 70-wayland.rules since it's still needed. - + Disable inclusion of ChangeLog for now - - -- Bryce Harrington Fri, 05 Nov 2010 15:29:01 -0700 - -wayland (0.1~git20100305.c9e20889-0ubuntu1) lucid; urgency=low - - * Git checkout from 20100305 (master branch) up to commit - c9e208899b84895072ba171f9e6013ac28a06747 - * debian/control: - + Drop dependency on eagle (upstream no longer requires it) - - -- Bryce Harrington Thu, 13 May 2010 02:44:23 -0700 - -wayland (0.1~git20091221.450cc813-0ubuntu4) lucid; urgency=low - - * debian/wayland-dev.install: *.a files are not provided so don't - attempt to install them. - * debian/wayland.install: Install udev rules. Fixes issue where - running wayland-system-compositor would fail with null display - pointer. - * debian/control: - + Depend on the -dev libraries - + linux-any not accepted by ppa; go back to 'any' - - -- Bryce Harrington Tue, 02 Feb 2010 15:22:55 -0800 - -wayland (0.1~git20091221.450cc813-0ubuntu3) lucid; urgency=low - - * debian/control: - + Add install dependency on libeagle, et al - + Add wayland-dev package - + Set Architecture to linux-any instead of any - * debian/rules: - + Act on architecture-dependent packages - - -- Bryce Harrington Tue, 02 Feb 2010 12:31:39 -0800 - -wayland (0.1~git20091221.450cc813-0ubuntu2) lucid; urgency=low - - * debian/control: - + Update build-dep of cairo-drm to ensure we get libdrm.pc - + Add build-deps for libudev-dev and libdrm-dev - + Also build-dep on poppler-glib - - -- Bryce Harrington Fri, 29 Jan 2010 10:29:02 -0800 - -wayland (0.1~git20091221.450cc813-0ubuntu1) lucid; urgency=low - - * Git snapshot from 2009-12-21 (commit 450cc813) - * Add 100_vpath.path: Add VPATH to Makefile to allow separate builddir - * Add 101_destdir.patch: Use $(DESTDIR) installation target so files - can be installed into the .deb file - - -- Bryce Harrington Fri, 29 Jan 2010 01:55:09 -0800 diff -Nru wayland-0.95.0+git20120801.7f3d2277/debian/control wayland-0.95.0+git20120920.4b681a7f/debian/control --- wayland-0.95.0+git20120801.7f3d2277/debian/control 2012-09-20 10:12:28.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/debian/control 2012-09-20 10:02:05.000000000 +0000 @@ -1,31 +1,28 @@ Source: wayland Section: x11 Priority: optional -Maintainer: Ubuntu Developers +Maintainer: Ubuntu X-SWAT XSBC-Original-Maintainer: Debian X Strike Force Uploaders: Cyril Brulebois Build-Depends: - debhelper (>= 8.1.3), + debhelper (>= 9), quilt, dh-autoreconf, pkg-config, libexpat1-dev, libffi-dev, -Standards-Version: 3.9.2 +Standards-Version: 3.9.3 Vcs-Git: git://git.debian.org/git/pkg-xorg/wayland/wayland Vcs-Browser: http://git.debian.org/?p=pkg-xorg/wayland/wayland.git -Homepage: http://wayland.freedesktop.org Package: libwayland0 Section: libs Architecture: any +Pre-Depends: ${misc:Pre-Depends} +Multi-Arch: same Depends: ${shlibs:Depends}, ${misc:Depends}, -Pre-Depends: ${misc:Pre-Depends} -Multi-Arch: same -Replaces: libwayland-server0, libwayland-client0 -Conflicts: libwayland-server0, libwayland-client0 Description: wayland compositor infrastructure - shared libraries Wayland is a protocol for a compositor to talk to its clients as well as a C library implementation of that protocol. The compositor can be @@ -36,7 +33,8 @@ . This is an experimental library package, neither ABI or API are fixed right now. As a consequence, generated dependencies are made as - strict as possible. It should only be used by mesa and wayland-demos. + strict as possible. It should only be used by mesa and weston for + the time being. Package: libwayland0-dbg Section: debug @@ -65,8 +63,6 @@ libwayland0 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, -Replaces: libwayland-server0-dev, libwayland-client0-dev -Conflicts: libwayland-server0-dev, libwayland-client0-dev Description: wayland compositor infrastructure - development files Wayland is a protocol for a compositor to talk to its clients as well as a C library implementation of that protocol. The compositor can be diff -Nru wayland-0.95.0+git20120801.7f3d2277/debian/copyright wayland-0.95.0+git20120920.4b681a7f/debian/copyright --- wayland-0.95.0+git20120801.7f3d2277/debian/copyright 2012-09-20 10:12:28.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/debian/copyright 2012-09-20 10:02:05.000000000 +0000 @@ -1,4 +1,3 @@ -Format-Specification: http://dep.debian.net/deps/dep5/ Upstream-Name: wayland Upstream-Contact: Kristian Høgsberg Source: http://cgit.freedesktop.org/wayland/wayland @@ -8,11 +7,10 @@ Copyright: © 2011 Cyril Brulebois License: X11 -Files: wayland/* -Files: protocol/* +Files: wayland/*, protocol/* Copyright: © 2008-2011 Kristian Høgsberg © 2011 Benjamin Franzke - © 2010-2011 Intel Corporation + © 2010-2011 Intel Corporation License: X11 License: X11 diff -Nru wayland-0.95.0+git20120801.7f3d2277/debian/libwayland0.lintian-overrides wayland-0.95.0+git20120920.4b681a7f/debian/libwayland0.lintian-overrides --- wayland-0.95.0+git20120801.7f3d2277/debian/libwayland0.lintian-overrides 2012-09-20 10:12:28.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/debian/libwayland0.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -libwayland0: package-name-doesnt-match-sonames libwayland-client0 libwayland-server0 diff -Nru wayland-0.95.0+git20120801.7f3d2277/debian/rules wayland-0.95.0+git20120920.4b681a7f/debian/rules --- wayland-0.95.0+git20120801.7f3d2277/debian/rules 2012-09-20 10:12:28.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/debian/rules 2012-09-20 10:02:05.000000000 +0000 @@ -6,6 +6,8 @@ # Kill *.la files, and forget no-one: override_dh_install: find debian/tmp -name '*.la' -delete + # temporary, decide where to put these + rm -rf debian/tmp/usr/share/doc/wayland dh_install --fail-missing # Debug package: @@ -13,7 +15,7 @@ dh_strip --dbg-package=$(PACKAGE)-dbg override_dh_auto_test: - # the test suite does not 100% pass in headless mode + # the test suite does not pass completely in headless mode dh_auto_test || true %: diff -Nru wayland-0.95.0+git20120801.7f3d2277/debian/source/format wayland-0.95.0+git20120920.4b681a7f/debian/source/format --- wayland-0.95.0+git20120801.7f3d2277/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/debian/source/format 2012-09-20 10:12:28.589737251 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru wayland-0.95.0+git20120801.7f3d2277/debian/source.lintian-overrides wayland-0.95.0+git20120920.4b681a7f/debian/source.lintian-overrides --- wayland-0.95.0+git20120801.7f3d2277/debian/source.lintian-overrides 2012-09-20 10:12:28.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/debian/source.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -package-needs-versioned-debhelper-build-depends 9 diff -Nru wayland-0.95.0+git20120801.7f3d2277/doc/Makefile.in wayland-0.95.0+git20120920.4b681a7f/doc/Makefile.in --- wayland-0.95.0+git20120801.7f3d2277/doc/Makefile.in 2012-08-01 06:22:23.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/doc/Makefile.in 2012-09-20 10:02:23.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.5 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, diff -Nru wayland-0.95.0+git20120801.7f3d2277/doc/Wayland/Makefile.in wayland-0.95.0+git20120920.4b681a7f/doc/Wayland/Makefile.in --- wayland-0.95.0+git20120801.7f3d2277/doc/Wayland/Makefile.in 2012-08-01 06:22:23.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/doc/Wayland/Makefile.in 2012-09-20 10:02:23.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.5 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, diff -Nru wayland-0.95.0+git20120801.7f3d2277/doc/Wayland/en_US/Architecture.xml wayland-0.95.0+git20120920.4b681a7f/doc/Wayland/en_US/Architecture.xml --- wayland-0.95.0+git20120801.7f3d2277/doc/Wayland/en_US/Architecture.xml 2012-08-01 06:22:03.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/doc/Wayland/en_US/Architecture.xml 2012-09-20 10:02:05.000000000 +0000 @@ -255,7 +255,7 @@ In either case, the application must tell the compositor which area of the surface holds new contents. When the - application renders directly the to shared buffer, the + application renders directly to the shared buffer, the compositor needs to be noticed that there is new content. But also when exchanging buffers, the compositor doesn't assume anything changed, and needs a request from the diff -Nru wayland-0.95.0+git20120801.7f3d2277/protocol/Makefile.in wayland-0.95.0+git20120920.4b681a7f/protocol/Makefile.in --- wayland-0.95.0+git20120801.7f3d2277/protocol/Makefile.in 2012-08-01 06:22:23.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/protocol/Makefile.in 2012-09-20 10:02:23.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.5 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, diff -Nru wayland-0.95.0+git20120801.7f3d2277/protocol/wayland.xml wayland-0.95.0+git20120920.4b681a7f/protocol/wayland.xml --- wayland-0.95.0+git20120801.7f3d2277/protocol/wayland.xml 2012-08-01 06:22:03.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/protocol/wayland.xml 2012-09-20 10:02:05.000000000 +0000 @@ -597,7 +597,7 @@ The configure event asks the client to resize its surface. The size is a hint, in the sense that the client is free to ignore it if it doesn't resize, pick a smaller size (to - satisfy aspect ration or resize in steps of NxM pixels). The + satisfy aspect ratio or resize in steps of NxM pixels). The client is free to dismiss all but the last configure event it received. @@ -1006,7 +1006,7 @@ output device. The flipped values correspond to an initial flip around a - vertical axis followed by rotaion. + vertical axis followed by rotation. The purpose is mainly to allow clients render accordingly and tell the compositor, so that for fullscreen surfaces, the diff -Nru wayland-0.95.0+git20120801.7f3d2277/src/Makefile.in wayland-0.95.0+git20120920.4b681a7f/src/Makefile.in --- wayland-0.95.0+git20120801.7f3d2277/src/Makefile.in 2012-08-01 06:22:24.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/src/Makefile.in 2012-09-20 10:02:23.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.5 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, diff -Nru wayland-0.95.0+git20120801.7f3d2277/src/connection.c wayland-0.95.0+git20120920.4b681a7f/src/connection.c --- wayland-0.95.0+git20120801.7f3d2277/src/connection.c 2012-08-01 06:22:03.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/src/connection.c 2012-09-20 10:02:05.000000000 +0000 @@ -436,7 +436,7 @@ { struct wl_closure *closure; struct wl_object **objectp, *object; - uint32_t length, *p, *start, size, *end; + uint32_t length, aligned, *p, *start, size, *end; int dup_fd; struct wl_array **arrayp, *array; const char **sp, *s; @@ -497,7 +497,8 @@ goto err_null; length = s ? strlen(s) + 1: 0; - if (p + DIV_ROUNDUP(length, sizeof *p) + 1 > end) + aligned = (length + 3) & ~3; + if (p + aligned / sizeof *p + 1 > end) goto err; *p++ = length; @@ -507,7 +508,8 @@ *sp = NULL; memcpy(p, s, length); - p += DIV_ROUNDUP(length, sizeof *p); + memset((char *) p + length, 0, aligned - length); + p += aligned / sizeof *p; break; case 'o': closure->types[i] = &ffi_type_pointer; diff -Nru wayland-0.95.0+git20120801.7f3d2277/src/event-loop.c wayland-0.95.0+git20120920.4b681a7f/src/event-loop.c --- wayland-0.95.0+git20120801.7f3d2277/src/event-loop.c 2012-08-01 06:22:03.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/src/event-loop.c 2012-09-20 10:02:05.000000000 +0000 @@ -378,8 +378,8 @@ return n; } -static void -dispatch_idle_sources(struct wl_event_loop *loop) +WL_EXPORT void +wl_event_loop_dispatch_idle(struct wl_event_loop *loop) { struct wl_event_source_idle *source; @@ -398,16 +398,16 @@ struct wl_event_source *source; int i, count, n; - dispatch_idle_sources(loop); + wl_event_loop_dispatch_idle(loop); count = epoll_wait(loop->epoll_fd, ep, ARRAY_LENGTH(ep), timeout); if (count < 0) return -1; - n = 0; + for (i = 0; i < count; i++) { source = ep[i].data.ptr; if (source->fd != -1) - n += source->interface->dispatch(source, &ep[i]); + source->interface->dispatch(source, &ep[i]); } wl_event_loop_process_destroy_list(loop); diff -Nru wayland-0.95.0+git20120801.7f3d2277/src/wayland-client.c wayland-0.95.0+git20120920.4b681a7f/src/wayland-client.c --- wayland-0.95.0+git20120801.7f3d2277/src/wayland-client.c 2012-08-01 06:22:03.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/src/wayland-client.c 2012-09-20 10:02:05.000000000 +0000 @@ -63,6 +63,7 @@ struct wl_proxy proxy; struct wl_connection *connection; int fd; + int close_fd; uint32_t mask; struct wl_map objects; struct wl_list global_listener_list; @@ -300,12 +301,12 @@ }; static int -connect_to_socket(struct wl_display *display, const char *name) +connect_to_socket(const char *name) { struct sockaddr_un addr; socklen_t size; const char *runtime_dir; - int name_size; + int name_size, fd; runtime_dir = getenv("XDG_RUNTIME_DIR"); if (!runtime_dir) { @@ -323,8 +324,8 @@ if (name == NULL) name = "wayland-0"; - display->fd = wl_os_socket_cloexec(PF_LOCAL, SOCK_STREAM, 0); - if (display->fd < 0) + fd = wl_os_socket_cloexec(PF_LOCAL, SOCK_STREAM, 0); + if (fd < 0) return -1; memset(&addr, 0, sizeof addr); @@ -338,7 +339,7 @@ fprintf(stderr, "error: socket path \"%s/%s\" plus null terminator" " exceeds 108 bytes\n", runtime_dir, name); - close(display->fd); + close(fd); /* to prevent programs reporting * "failed to add socket: Success" */ errno = ENAMETOOLONG; @@ -347,21 +348,19 @@ size = offsetof (struct sockaddr_un, sun_path) + name_size; - if (connect(display->fd, (struct sockaddr *) &addr, size) < 0) { - close(display->fd); + if (connect(fd, (struct sockaddr *) &addr, size) < 0) { + close(fd); return -1; } - return 0; + return fd; } WL_EXPORT struct wl_display * -wl_display_connect(const char *name) +wl_display_connect_to_fd(int fd) { struct wl_display *display; const char *debug; - char *connection, *end; - int flags; debug = getenv("WAYLAND_DEBUG"); if (debug) @@ -372,22 +371,8 @@ return NULL; memset(display, 0, sizeof *display); - connection = getenv("WAYLAND_SOCKET"); - if (connection) { - display->fd = strtol(connection, &end, 0); - if (*end != '\0') { - free(display); - return NULL; - } - flags = fcntl(display->fd, F_GETFD); - if (flags != -1) - fcntl(display->fd, F_SETFD, flags | FD_CLOEXEC); - unsetenv("WAYLAND_SOCKET"); - } else if (connect_to_socket(display, name) < 0) { - free(display); - return NULL; - } + display->fd = fd; wl_map_init(&display->objects); wl_list_init(&display->global_listener_list); wl_list_init(&display->global_list); @@ -414,6 +399,36 @@ return display; } +WL_EXPORT struct wl_display * +wl_display_connect(const char *name) +{ + struct wl_display *display; + char *connection, *end; + int flags, fd; + + connection = getenv("WAYLAND_SOCKET"); + if (connection) { + fd = strtol(connection, &end, 0); + if (*end != '\0') + return NULL; + + flags = fcntl(fd, F_GETFD); + if (flags != -1) + fcntl(fd, F_SETFD, flags | FD_CLOEXEC); + unsetenv("WAYLAND_SOCKET"); + } else { + fd = connect_to_socket(name); + if (fd < 0) + return NULL; + } + + display = wl_display_connect_to_fd(fd); + if (display) + display->close_fd = 1; + + return display; +} + WL_EXPORT void wl_display_disconnect(struct wl_display *display) { @@ -429,7 +444,9 @@ &display->global_listener_list, link) free(listener); - close(display->fd); + if (display->close_fd) + close(display->fd); + free(display); } diff -Nru wayland-0.95.0+git20120801.7f3d2277/src/wayland-client.h wayland-0.95.0+git20120920.4b681a7f/src/wayland-client.h --- wayland-0.95.0+git20120801.7f3d2277/src/wayland-client.h 2012-08-01 06:22:03.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/src/wayland-client.h 2012-09-20 10:02:05.000000000 +0000 @@ -73,6 +73,7 @@ typedef void (*wl_callback_func_t)(void *data, uint32_t time); struct wl_display *wl_display_connect(const char *name); +struct wl_display *wl_display_connect_to_fd(int fd); void wl_display_disconnect(struct wl_display *display); int wl_display_get_fd(struct wl_display *display, wl_display_update_func_t update, void *data); diff -Nru wayland-0.95.0+git20120801.7f3d2277/src/wayland-server.c wayland-0.95.0+git20120920.4b681a7f/src/wayland-server.c --- wayland-0.95.0+git20120801.7f3d2277/src/wayland-server.c 2012-08-01 06:22:03.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/src/wayland-server.c 2012-09-20 10:02:05.000000000 +0000 @@ -387,23 +387,27 @@ *gid = client->ucred.gid; } -WL_EXPORT void +WL_EXPORT uint32_t wl_client_add_resource(struct wl_client *client, struct wl_resource *resource) { - if (resource->object.id == 0) + if (resource->object.id == 0) { resource->object.id = wl_map_insert_new(&client->objects, WL_MAP_SERVER_SIDE, resource); - else if (wl_map_insert_at(&client->objects, - resource->object.id, resource) < 0) + } else if (wl_map_insert_at(&client->objects, + resource->object.id, resource) < 0) { wl_resource_post_error(client->display_resource, WL_DISPLAY_ERROR_INVALID_OBJECT, "invalid new id %d", resource->object.id); + return 0; + } resource->client = client; wl_signal_init(&resource->destroy_signal); + + return resource->object.id; } WL_EXPORT struct wl_resource * diff -Nru wayland-0.95.0+git20120801.7f3d2277/src/wayland-server.h wayland-0.95.0+git20120920.4b681a7f/src/wayland-server.h --- wayland-0.95.0+git20120801.7f3d2277/src/wayland-server.h 2012-08-01 06:22:03.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/src/wayland-server.h 2012-09-20 10:02:05.000000000 +0000 @@ -67,6 +67,7 @@ int wl_event_loop_dispatch(struct wl_event_loop *loop, int timeout); +void wl_event_loop_dispatch_idle(struct wl_event_loop *loop); struct wl_event_source *wl_event_loop_add_idle(struct wl_event_loop *loop, wl_event_loop_idle_func_t func, void *data); @@ -354,7 +355,7 @@ #include "wayland-server-protocol.h" -void +uint32_t wl_client_add_resource(struct wl_client *client, struct wl_resource *resource); @@ -440,6 +441,11 @@ int wl_display_init_shm(struct wl_display *display); +struct wl_buffer * +wl_shm_buffer_create(struct wl_client *client, + uint32_t id, int32_t width, int32_t height, + int32_t stride, uint32_t format); + void wl_log_set_handler_server(wl_log_func_t handler); #ifdef __cplusplus diff -Nru wayland-0.95.0+git20120801.7f3d2277/src/wayland-shm.c wayland-0.95.0+git20120920.4b681a7f/src/wayland-shm.c --- wayland-0.95.0+git20120801.7f3d2277/src/wayland-shm.c 2012-08-01 06:22:03.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/src/wayland-shm.c 2012-09-20 10:02:05.000000000 +0000 @@ -255,6 +255,47 @@ return 0; } +WL_EXPORT struct wl_buffer * +wl_shm_buffer_create(struct wl_client *client, + uint32_t id, int32_t width, int32_t height, + int32_t stride, uint32_t format) +{ + struct wl_shm_buffer *buffer; + + switch (format) { + case WL_SHM_FORMAT_ARGB8888: + case WL_SHM_FORMAT_XRGB8888: + break; + default: + return NULL; + } + + buffer = malloc(sizeof *buffer + stride * height); + if (buffer == NULL) + return NULL; + + buffer->buffer.width = width; + buffer->buffer.height = height; + buffer->buffer.busy_count = 0; + buffer->format = format; + buffer->stride = stride; + buffer->offset = 0; + buffer->pool = NULL; + + buffer->buffer.resource.object.id = id; + buffer->buffer.resource.object.interface = &wl_buffer_interface; + buffer->buffer.resource.object.implementation = (void (**)(void)) + &shm_buffer_interface; + + buffer->buffer.resource.data = buffer; + buffer->buffer.resource.client = client; + buffer->buffer.resource.destroy = destroy_buffer; + + wl_client_add_resource(client, &buffer->buffer.resource); + + return &buffer->buffer; +} + WL_EXPORT int wl_buffer_is_shm(struct wl_buffer *buffer) { @@ -281,7 +322,10 @@ if (!wl_buffer_is_shm(buffer_base)) return NULL; - return buffer->pool->data + buffer->offset; + if (buffer->pool) + return buffer->pool->data + buffer->offset; + else + return buffer + 1; } WL_EXPORT uint32_t diff -Nru wayland-0.95.0+git20120801.7f3d2277/tests/Makefile.in wayland-0.95.0+git20120920.4b681a7f/tests/Makefile.in --- wayland-0.95.0+git20120801.7f3d2277/tests/Makefile.in 2012-08-01 06:22:24.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/tests/Makefile.in 2012-09-20 10:02:23.000000000 +0000 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.5 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, diff -Nru wayland-0.95.0+git20120801.7f3d2277/tests/sanity-test.c wayland-0.95.0+git20120920.4b681a7f/tests/sanity-test.c --- wayland-0.95.0+git20120801.7f3d2277/tests/sanity-test.c 2012-08-01 06:22:03.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/tests/sanity-test.c 2012-09-20 10:02:05.000000000 +0000 @@ -29,6 +29,8 @@ #include "test-runner.h" #include "wayland-util.h" +extern int leak_check_enabled; + TEST(empty) { } @@ -68,6 +70,8 @@ { void *p; + assert(leak_check_enabled); + p = malloc(10); /* memory leak */ assert(p); /* assert that we got memory, also prevents * the malloc from getting optimized away. */ @@ -78,6 +82,8 @@ { struct wl_array array; + assert(leak_check_enabled); + wl_array_init(&array); /* call into library that calls malloc */ @@ -90,6 +96,8 @@ { int fd[2]; + assert(leak_check_enabled); + /* leak 2 file descriptors */ if (pipe(fd) < 0) exit(EXIT_SUCCESS); /* failed to fail */ diff -Nru wayland-0.95.0+git20120801.7f3d2277/tests/socket-test.c wayland-0.95.0+git20120920.4b681a7f/tests/socket-test.c --- wayland-0.95.0+git20120801.7f3d2277/tests/socket-test.c 2012-08-01 06:22:03.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/tests/socket-test.c 2012-09-20 10:02:05.000000000 +0000 @@ -36,17 +36,21 @@ #define TOO_LONG (1 + sizeof example_sockaddr_un.sun_path) +/* Ensure the connection doesn't fail due to lack of XDG_RUNTIME_DIR. */ +static void +require_xdg_runtime_dir(void) +{ + char *val = getenv("XDG_RUNTIME_DIR"); + if (!val) + assert(0 && "set $XDG_RUNTIME_DIR to run this test"); +} + TEST(socket_path_overflow_client_connect) { char path[TOO_LONG]; struct wl_display *d; - int ret; - /* Ensure the connection doesn't fail due to lack of - XDG_RUNTIME_DIR. Don't use setenv(), as that allocates - memory and creates a spurious memory leak failure. */ - ret = putenv("XDG_RUNTIME_DIR=."); - assert(ret == 0); + require_xdg_runtime_dir(); memset(path, 'a', sizeof path); path[sizeof path - 1] = '\0'; @@ -62,11 +66,7 @@ struct wl_display *d; int ret; - /* Ensure the connection doesn't fail due to lack of - XDG_RUNTIME_DIR. Don't use setenv(), as that allocates - memory and creates a spurious memory leak failure. */ - ret = putenv("XDG_RUNTIME_DIR=."); - assert(ret == 0); + require_xdg_runtime_dir(); memset(path, 'a', sizeof path); path[sizeof path - 1] = '\0'; diff -Nru wayland-0.95.0+git20120801.7f3d2277/tests/test-runner.c wayland-0.95.0+git20120920.4b681a7f/tests/test-runner.c --- wayland-0.95.0+git20120801.7f3d2277/tests/test-runner.c 2012-08-01 06:22:03.000000000 +0000 +++ wayland-0.95.0+git20120920.4b681a7f/tests/test-runner.c 2012-09-20 10:02:05.000000000 +0000 @@ -39,6 +39,8 @@ static void* (*sys_realloc)(void*, size_t); static void* (*sys_calloc)(size_t, size_t); +int leak_check_enabled; + extern const struct test __start_test_section, __stop_test_section; __attribute__ ((visibility("default"))) void * @@ -95,8 +97,10 @@ cur_fds = count_open_fds(); t->run(); - assert(cur_alloc == num_alloc && "memory leak detected in test."); - assert(cur_fds == count_open_fds() && "fd leak detected"); + if (leak_check_enabled) { + assert(cur_alloc == num_alloc && "memory leak detected in test."); + assert(cur_fds == count_open_fds() && "fd leak detected"); + } exit(EXIT_SUCCESS); } @@ -113,6 +117,8 @@ sys_malloc = dlsym(RTLD_NEXT, "malloc"); sys_free = dlsym(RTLD_NEXT, "free"); + leak_check_enabled = !getenv("NO_ASSERT_LEAK_CHECK"); + if (argc == 2) { t = find_test(argv[1]); if (t == NULL) {