Commit graph

942 commits

Author SHA1 Message Date
Pekka Paalanen
56426d8a4a tests: stylish test-runner.c
Fix a typo, add a comment, change the print format, and add a variable
that will ease implementing tests that are expected to fail.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-19 14:06:08 +03:00
Pekka Paalanen
b1d4eb24c6 tests: fail build if NDEBUG is defined
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-19 12:14:19 +03:00
Pekka Paalanen
84464a3e9b tests: put common test source files in a variable
Makes all test targets have the same common make dependencies.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-19 12:12:13 +03:00
Pekka Paalanen
b7c7963f16 Fix printf format warnings
connection.c:530: warning: format '%lu' expects type 'long unsigned
int', but argument 2 has type 'unsigned int'

/connection.c:560: warning: format '%lu' expects type 'long unsigned
int', but argument 2 has type 'unsigned int'

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-17 15:02:15 -04:00
Kristian Høgsberg
677c5180e6 data-device: Take away pointer focus when we start a dnd drag 2012-04-13 12:51:40 -04:00
Kristian Høgsberg
a9f951b003 data-device: Record the serial number for the current selection
And reject setting a selection that's older than our current selection.
2012-04-13 12:48:38 -04:00
Kristian Høgsberg
74aec06625 data-device: Clear drag focus when we end the drag-and-drop
Otherwise we'll see a spurious leave event when we start the next dnd.
2012-04-13 10:39:24 -04:00
Kristian Høgsberg
b68b5e9e0c tests: Make leak check work again by setting default visibility for malloc/free
We compile the test cases with -fvisibility=hidden which makes
our malloc/free wrappers fail to override system malloc/free.
2012-04-13 10:13:49 -04:00
Kristian Høgsberg
d8b66a00f4 tests: Fix warning in memory leak assert 2012-04-13 10:13:21 -04:00
Kristian Høgsberg
ac06144cc9 tests: Fix signedness warnings 2012-04-13 10:11:11 -04:00
Kristian Høgsberg
fa5f7b1191 server: Add client destroy signal 2012-04-13 09:53:15 -04:00
Neil Roberts
18a770c80d Add a public header for the version number
This adds a public header so that applications can get the Wayland
version number at compile time. This can be used to make applications
that support compiling against multiple versions of Wayland.

There is a separate installed header called cogl-version.h which gets
included by both wayland-client.h and wayland-server.h

The canonical place for the version number is the configure.ac script
which splits it into three separate m4 defines for the major, minor
and micro version. These are copied into the generated
wayland-version.h header using AC_SUBST. There is also a string form
of the complete version number.

The version number is now also automatically copied into the two .pc
files.

Because the major, minor and micro parts are required it is no longer
possible to leave the version number as 'master' when building from
git. Most projects seem to immediately bump the git repo to a fake
version number (usually odd) after making a release so that there is
always a relative number that can be used for comparison. This patch
sets the git version to 0.99.0 under the assumption that the next
release will be 1.0.0.
2012-04-12 17:54:44 -04:00
Kristian Høgsberg
8e5866a54d Update TODO 2012-04-12 17:43:12 -04:00
Kristian Høgsberg
6802eaa68a Introduce wl_signal
This is mostly renaming and consolidating the listener_list pattern
into something more concise and reusable.
2012-04-12 15:52:44 -04:00
Kristian Høgsberg
5535f155d8 Switch protocol to using serial numbers for ordering events and requests
The wayland protocol, as X, uses timestamps to match up certain
requests with input events.  The problem is that sometimes we need to
send out an event that doesn't have a corresponding timestamped input
event.  For example, the pointer focus surface goes away and new
surface needs to receive a pointer enter event.  These events are
normally timestamped with the evdev event timestamp, but in this case,
we don't have a evdev timestamp.  So we have to go to gettimeofday (or
clock_gettime()) and then we don't know if it's coming from the same
time source etc.

However for all these cases we don't need a real time timestamp, we
just need a serial number that encodes the order of events inside the
server.  So we introduce a serial number mechanism that we can use to
order events.  We still need real-time timestamps for actual input
device events (motion, buttons, keys, touch), to be able to reason
about double-click speed and movement speed so events that correspond to user input carry both a serial number and a timestamp.

The serial number also give us a mechanism to key together events that
are "logically the same" such as a unicode event and a keycode event,
or a motion event and a relative event from a raw device.
2012-04-11 22:27:26 -04:00
Jørgen Lind
a13aab4e15 remove superfluous functions 2012-04-11 08:17:20 -04:00
Benjamin Franzke
e6a9e1b302 wayland-util.h: Include stddef.h for size_t 2012-04-06 15:54:38 +02:00
Kristian Høgsberg
aa777e5b10 shm: Allocate shm buffers through new wl_shm_pool interface
There's a big cost to setting up and tearing down a mmap and faulting in
the pages to back it.  For cases where we're continuously reallocating
shm wl_buffers (resizing a surface, typically) it is a big performance
improvement to be able to reuse a mmap area.  This change makes the shm
buffer allocation a two step process: first allocate a wl_shm_pool, then
allocate a buffer from the pool.  The wl_shm_pool encapsulate the shared
memory pool, and lets clients allocate wl_buffers backed by chunks of that
memory.  Buffers are allocated at an offset into the pool, so it's possible
to create multiple buffers from one pool, for example for icons or cursor
images.
2012-04-03 12:34:22 -04:00
Alex Wu
68cf7a1a42 wayland-utils: add wl_list_for_each_reverse_safe macro.
Add the safe version for wl_list_for_each_reverse
2012-04-02 22:12:56 -04:00
Kristian Høgsberg
3cddb3c692 Fix remaining signedness errors
We can change the data type for 'size' but we have to cast len to size_t
for the comparisons with sizeof results.
2012-03-30 11:27:02 -04:00
Kristian Høgsberg
0ca75a4f32 wayland-util: Fix wl_array signedness warnings 2012-03-30 10:43:36 -04:00
Kristian Høgsberg
3fb304bb3e connection.c: Fix signedness warnings 2012-03-30 10:43:32 -04:00
Kristian Høgsberg
ba32db9532 Move DIV_ROUNDUP out of public header, remove unused ALIGN 2012-03-30 10:28:39 -04:00
Kristian Høgsberg
485dd7b6e2 shm: Fix stride signedness in protocol
Make stride argument of wl_shm.create_buffer a signed integer.
2012-03-30 10:24:29 -04:00
Pekka Paalanen
4560b6b6b4 server: fix button signedness in wl_grab_interface
wl_input_device::grab_button is unsigned but the button parameter to
wl_grab_interface::button is signed. This lead to a warning in
data-device.c.

The button number is unsigned in the protocol, so make it unsigned in
the wl_grab_interface API, too. Fixes the compiler warning "comparison
between signed and unsigned integer expressions".

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-30 10:14:51 -04:00
Pekka Paalanen
03c40a8c99 scanner: fix a signedness warning
Trivial fix to a
warning: comparison between signed and unsigned integer expressions

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-30 10:12:35 -04:00
Pekka Paalanen
c2a405be5a shm: fix cosmetic gcc warnings
Fix warning: 'static' is not at beginning of declaration

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-30 10:09:38 -04:00
Pekka Paalanen
00ea1701f2 server: fix signedness in wl_client_connection_data
The variables opcode and size were unsigned, which lead to warnings
about comparisons of signed vs. unsigned.

Change these variable to signed. Their usage never relies on being
unsigned.

This also fixes (an assumed) printf format string problem, where these
were printed with %d, not %u.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-30 09:32:26 -04:00
Pekka Paalanen
0e81a0b157 configure: add -Wextra -Wno-unused-parameter
This adds more gcc warnings that should be useful, and suppresses the
unused parameter warnings that are not wanted.

Most importantly, this change enables warnings about comparison between
signed and unsigned.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-30 09:32:24 -04:00
Kristian Høgsberg
5b72fc7528 docs: Touch ouput dir Wayland to update timestamp
Prevents rebuild every time.
2012-03-29 14:11:16 -04:00
Kristian Høgsberg
4fe458346c Remove unused bits from wayland-server.h 2012-03-29 14:03:40 -04:00
Kristian Høgsberg
6c57ab016d Update TODO 2012-03-28 23:13:59 -04:00
Peter Hutterer
f68e156b8f doc: consistently indent the xml files by 2 spaces
2 spaces is enough for xml, otherwise we end up with too little room for the
actual text.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-28 23:05:45 -04:00
Peter Hutterer
966e8ec9c0 doc: rename Procotol to ProtocolSpec and WaylandProtocol to Protocol
The former is the actual specification, the latter notes about the protocol.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-28 23:05:32 -04:00
Peter Hutterer
adf300dc13 doc: remove unused example files
These files were left in as examples, we have real-world examples now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-28 23:05:14 -04:00
Peter Hutterer
3d7f7e2f4a doc: move documentation from the tex file to docbook
And remove the .tex file

Minor changes:
- where the .tex file had some interface descriptions, the docbook source
  now links to the actual protocol. The exception here is the shared object
  cache which is simply a <programlisting> until the protocol spec exists.
- "Implementation" section skipped, this seems in need of an update anyway
  and may be better documented elsewhere (wiki?)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-28 23:04:25 -04:00
Kristian Høgsberg
3891c73511 Fix formatting warning 2012-03-27 16:36:25 -04:00
Ander Conselvan de Oliveira
897a4ec62d data-device: notify the compositor about new drag icons
Let the compositor use a listener to be notified when a new drag icon
is set up.
2012-03-27 16:32:02 -04:00
Kristian Høgsberg
83685c506e Remove wl_buffer.damage and simplify shm implementation 2012-03-26 16:33:24 -04:00
U. Artie Eoff
a0e590a0f3 Add simple memory leak check to all tests.
Wrap all tests with a memory balance check to detect potential
memory leaks.
Fixed a few tests that had memory leaks contained in the tests
themselves.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-03-24 14:37:42 -04:00
Kristian Høgsberg
9086b60d81 connection-test: Add test case to stress connection buffers
This catches the bug fixed in cab70c9e5d.
2012-03-24 14:35:53 -04:00
Kristian Høgsberg
b01ae07727 connection-test: Test fd transport 2012-03-24 14:27:30 -04:00
Kristian Høgsberg
fa4769cadd connection-test: Add more test cases 2012-03-23 16:57:34 -04:00
Kristian Høgsberg
33ad8a3315 connection-test: Store expected result in struct marshal_data 2012-03-23 16:56:19 -04:00
Kristian Høgsberg
0ca52cce98 tests: Add marshal+demarshal connection test 2012-03-23 11:41:34 -04:00
Kristian Høgsberg
f67f6395b1 tests: Use different connections for read and write tests
The connection tests so far only use one connection at a time, but this
prepares for tests that use a connection on both sides of the socket.
2012-03-23 11:32:17 -04:00
Kristian Høgsberg
1c5578e87f connection: Just look at buffer size and remove redundant n_fds_out
Instead of maintaining a count of the fds in the buffer, just compute
that from the buffer size.  That way we don't get out of sync.
2012-03-23 00:48:19 -04:00
Kristian Høgsberg
cab70c9e5d connection: Set n_fds_out to 0 when we send out the fds
This needs to happen always, not just when the fd buffer overflows.
2012-03-23 00:27:04 -04:00
Scott Moreau
75480a1eeb Add protocol for axis events 2012-03-22 12:34:17 -04:00
Kristian Høgsberg
7746a80e2a tests: Remove debug printf 2012-03-21 10:32:06 -04:00