Commit Graph

978 Commits

Author SHA1 Message Date
Christophe Fergeau
e261cb2d54 s/__visible__/SPICE_GNUC_VISIBLE
The C specification reserves use of identifiers starting with __
to the compiler so we shouldn't use one such symbol.
2011-06-22 16:29:52 +02:00
Christophe Fergeau
df95fc65fb add check for pyparsing
Check both in configure.ac (after checking if we need to rebuild
the marshalling files) and in the python script using pyparsing
(for people modifying .proto files in tarballs)
2011-06-22 16:24:32 +02:00
Marc-André Lureau
0400769de1 sndworker: check the caps before sending volume messages 2011-06-22 12:12:51 +02:00
Marc-André Lureau
d1758b3288 sndworker: add AudioVolume/AudioMute messages
These messages allow the guest to send the audio device volume to the
client. It uses an arbitrary scale of 16bits, which works good enough
for now.

Save VolumeState in {Playback,Record}State, so that we can send the
current volume on channel connection.

Note about future improvements:
- add exact dB support
- add client to guest volume change

Updated since v2:
- bumped record and playback interface minor version to allow
  conditional compilation
Updated since v1:
- sync record volume on connection too
2011-06-22 12:12:26 +02:00
Marc-André Lureau
5ec91855d8 python: remove c-ism trailing ; 2011-06-21 13:20:33 +02:00
Marc-André Lureau
aa57d2f70c codegen: typedef the protocol enums
Commit 9d5ef9beeca722b2ceff7d15aaa3aaaaf07ecfbf in spice-protocol
introduced a typedef manually in the generated enums.h header.

This patch adds them automatically to all enums during enums.h generation.
2011-06-21 13:17:17 +02:00
Yonit Halperin
8131249d6c client: fix for redundant shift+f11 RHBZ #674532
After shift+F11, both in Windows 7 and xp clients, WM_KEYUP events were missing for
SHIFT and F11. For F11 it was less important since unpress_all was preformed for all keys.
However, we perform sync for all the keyboard modifiers and the GetKeyboardState returns "down" for shift.
In windows7 client, we sometimes received afterwards a F11 KEYDOWN event repetition, and this caused SHIFT+F11 to be called again.
Not performing hiding of the windows while changing client resolutions, solved the problem of missing events, and I don't see any difference
in how spice looks while toggling to full screen.
Using GetAsyncKeyState, returns "UP" for shift in windows 7, and helps avoid performing shift+f11 again, if there is an F11 repetition
before we receive the KEYUP event for shift.
2011-06-14 10:15:41 +03:00
Arnon Gilboa
d1a1a1b4c7 client/windows: enable image randomization (ASLR) rhbz#701111
Enable image randomized base address, hindering some types of
security attacks by making it more difficult for an attacker
to predict target addresses.
2011-05-30 10:02:19 +03:00
Arnon Gilboa
ec56898570 client/windows: remove slash from x64 build dir
otherwise x64 is built in root if REDC_BUILD_DIR is not defined
2011-05-30 10:02:12 +03:00
Alon Levy
65350d2ab3 server/smartcard: fix use after free 2011-05-24 13:19:09 +03:00
Arnon Gilboa
a973e87a05 client/windows: remove precompiled header for common.h (fix broken windows debug build)
-Release currently doesn't use precompiled headers at all
-Debug is broken since common/*.c files don't include common.h
-PCH can be enabled for all but specifically-chosen c-files
2011-05-22 14:59:55 +03:00
Arnon Gilboa
87a834f227 common: add WIN64 ifdef for spice_bit_find_msb (fix broken windows x64 build)
inline __asm is not supported in x64, so use the naive implementation
until x64 asm implemented.
2011-05-22 14:53:13 +03:00
Yonit Halperin
d63fd4c5b0 client: fix flipped video in Linux guest on windows client, RHBZ #667689
Video streams from Linux guests are oriented top-down, where gdi_canvas_put_image always
received display context for down-top oriented bitmap. I fixed create_bitmap
to consider the stream orientation.
2011-05-19 12:57:41 +03:00
Arnon Gilboa
483d13ce61 common: use INLINE instead of inline
needed for spice/common files used by the client, server & qxl driver.
in windows _inline works for both c/c++, while inline is c++ only.
compiling the client with mixed c/c++ code required this define.
2011-05-12 15:21:08 +03:00
Arnon Gilboa
8776562115 client/windows: undef SIZE_MAX in stdint.h
eliminating redefinition warning
2011-05-12 15:21:07 +03:00
Arnon Gilboa
ba426a3a4c common: fix ssl_verify windows build errors 2011-05-12 15:13:40 +03:00
Arnon Gilboa
ccddcdb82a client/windows: add common\ssl_verify.c/h to project
disable WarnAsError, due to c/c++ warnings
2011-05-12 15:13:40 +03:00
Arnon Gilboa
4ea4d4dc35 client/windows: inc version to 0,9,0,0 2011-05-12 15:13:39 +03:00
Arnon Gilboa
d3577b2772 client/windows: init PACKAGE_VERSION
in windows, we set PACKAGE_VERSION to the binary version
since we don't have config.h as generated by linux configure
2011-05-12 15:13:39 +03:00
Alon Levy
34e9375cc0 client: fix return code when missing host 2011-05-12 12:38:23 +03:00
Alon Levy
34949178a8 server/red_worker: stat_now cleanup
static, remove inline, add (void), and empty line after function variables.
2011-05-09 09:59:57 +03:00
Alon Levy
db7d6c866e server/red_worker: fix typo (lats_send_time) 2011-05-09 09:46:26 +03:00
Alon Levy
87486fd790 server/tests: show port to connect to 2011-05-09 09:46:22 +03:00
Marc-André Lureau
148dabdf62 server: bump SPICE_SERVER_VERSION to 0.9.0
SASL functions will be released with 0.9.0
2011-05-08 19:05:41 +02:00
Zeeshan Ali (Khattak)
73dc16c02b server: Unset executable bit of red_tunnel_worker.h 2011-05-05 20:04:49 +03:00
Marc-André Lureau
138c421193 build: fix gettimeofday warning
CC     test_playback.o
test_playback.c: In function ‘playback_timer_cb’:
test_playback.c:56:5: warning: implicit declaration of function ‘gettimeofday’
2011-05-03 17:16:46 +02:00
Marc-André Lureau
d46f9d3f4e client: make use of ssl_verify.c
Fixed since v1:
- don't include C code, rather use the common lib
- add missing spice_openssl_verify_free() call
- keep the extra-parsing of subject for error reporting
2011-05-03 17:16:46 +02:00
Marc-André Lureau
c16b1a924b common: add ssl_verify.c common code
Code adapter from RedPeer::ssl_verify_callback() and used by
spice-gtk.

Since v1:
 - fixed Makefile.am
 - added config.h include
 - autoconf alloca added in patch series
 - moved int escape inside for loop
 - added a failed case when missing assignment
 - replaced strlen () by -1
 - skip spaces after comma
 - c++ guards

I didn't use bool, because openSSL uses int, and it is more future
proof for error reporting.
2011-05-03 16:49:56 +02:00
Marc-André Lureau
2b78b4968a common: add ring_get_length() for debugging purposes
Please notice it has a "static" modifier, like the rest of the inlined
functions in ring.h, so it won't warn if it isn't used.
2011-05-03 16:49:56 +02:00
Marc-André Lureau
dc1d4bdb68 common: mem.h add alloca definition
We don't support the autoconf ALLOCA/C_ALLOC fallback. If one day,
someone cares for a weird platform, he can fix it.
2011-05-03 16:49:56 +02:00
Marc-André Lureau
fc80f096e4 common: spice_memdup could accept NULL
(this patch is not to solve a crash fix, but to align with glib API)
2011-05-03 16:49:56 +02:00
Marc-André Lureau
27f771566d common: add windows.h where required, make gdi_handlers static
This patch has not been verified with VS/brew. It should be safe
hopefully. Compilation is fine with mingw32/spice-gtk.
2011-05-03 16:49:56 +02:00
Marc-André Lureau
aae0357023 build: require c99
Because we use c99: stdbool.h, inttypes.h, bool, variadic macros, // comments, ...
2011-05-03 16:49:43 +02:00
Christophe Fergeau
68c6014ff0 move get_time_stamp to main_channel.c
There is only one user of get_time_stamp from spice_common.h so
it's not really useful to keep it there.
2011-05-03 14:44:12 +02:00
Christophe Fergeau
54f028a01d use standard do { } while (0) for spice_common.h macros 2011-05-03 14:44:12 +02:00
Christophe Fergeau
2a611d9955 move WARN and WARN_ONCE to spice_common.h 2011-05-03 14:44:11 +02:00
Christophe Fergeau
edfe268358 common: use PANIC from spice_common.h 2011-05-03 14:44:11 +02:00
Christophe Fergeau
48db4c2181 common,server: use ASSERT from spice_common.h
spice_common.h provides an ASSERT macro, no need to duplicate it
in many places. For now client/debug.h keeps its own copy since
debug.h and spice_common.h have clashes on other macros which are
trickier to unify.
2011-05-03 14:44:11 +02:00
Christophe Fergeau
f88dc6eecb server: use gcc builtin for atomic get/set bit 2011-05-03 14:44:11 +02:00
Christophe Fergeau
1caee1f216 client: remove unused mb() macro 2011-05-03 14:44:11 +02:00
Christophe Fergeau
172edf298f common: don't duplicate find_msb implementation 2011-05-03 14:44:11 +02:00
Christophe Fergeau
cdba4ead67 remove void * arithmetic
With -Wpointer-arith, gcc complains about void pointer arithmetic.
This is not a big deal with gcc, but could be with other compilers,
so it's better to cast to char */uint8_t * before doing the
arithmetic on such pointers.
2011-05-03 14:44:11 +02:00
Christophe Fergeau
e17767e892 add missing static 2011-05-03 14:44:11 +02:00
Christophe Fergeau
12b9654bf4 configure.ac: remove setting default C(XX)FLAGS
automake/autoconf already set them for us to -g -O2 if there are
no flags defined.
2011-05-03 14:44:11 +02:00
Christophe Fergeau
4a989d6c7a win32: remove obsolete preprocessor #defines
SW_CANVAS_NO_CHUNKS isn't used anywhere but in this file.
SW_CANVAS_CACHE is now defined directly in the files where it's
needed so we no longer need it in the .vcproj file.
2011-05-03 14:44:11 +02:00
Christophe Fergeau
7e2373c2e9 add comment to beginning of autogenerated files 2011-05-03 14:44:11 +02:00
Christophe Fergeau
e0c20725c8 s/USE_OGL/USE_OPENGL
This is more explicit about what it does, and not much longer
2011-05-03 14:44:11 +02:00
Christophe Fergeau
c1b7ecac3f use AC_DEFINE instead of hardcoding preprocessor flags
Now that all source files include config.h, we can use AC_DEFINE
to enable/disable optional features (opengl, cegui). This is
cleaner than directly appending -Dxxx directives to the preprocessor
flags. This also guarantees that everything will be appropriately
rebuilt when using the same source tree to build first with opengl
support and then without (the config.h timestamp will change,
triggering a rebuild of the files including it)
2011-05-03 14:44:11 +02:00
Christophe Fergeau
7e30572ab1 add config.h to autogenerated files too
Modify the python (de)marshaller generator to add #include
<config.h> at the beginning of the C files it generates
2011-05-03 14:44:10 +02:00
Christophe Fergeau
78c1465ed3 add #include <config.h> to all source files
When using config.h, it must be the very first include in all source
files since it contains #define that may change the compilation process
(eg libc structure layout changes when it's used to enable large file
support on 32 bit x86 archs). This commit adds it at the beginning
of all .c and .cpp files
2011-05-03 14:44:10 +02:00