Commit Graph

28 Commits

Author SHA1 Message Date
Christophe Fergeau
ae931c7dab Add more red_qxl_ methods
Add red_qxl_ methods wrapping the QXLInterface vfuncs. This allows to
remove most of the qxl_get_interface() use outside of red-qxl.c

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-03-17 16:26:56 +00:00
Christophe Fergeau
a653044011 Rename red_channel_pipe_item_init to pipe_item_init
The RedChannel argument is not used by pipe_item_init. Removing it
will make code simpler in places where we don't have a RedChannel
directly available.
This is acting on a PipeItem object so correct name is pipe_item_init.

Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-03-10 11:36:52 +00:00
Frediano Ziglio
e9ed125dbd use QXLState instead of RedDispatcher
Considering that:
- QXLState is the state of QXLInstance implementation;
- RedDispatcher is the implementation of QXL;
- qif (QXLInterface*) field can be computed really easy from QXLInstance;
- most of its state is private.
Make all structure private and use QXLState instead of RedDispatcher.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-03-04 15:47:45 +00:00
Frediano Ziglio
597f30d5b7 reduce header dependencies
Avoid to include headers in cursor-channel.h which are only
used by cursor-channel.c

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-03-04 14:24:54 +00:00
Jonathon Jongsma
3644783e24 CommonChannel -> CommonGraphicsChannel
Rename this struct to make it clear that it's only the base class for
graphics channels (e.g. display and cursor), not all channels.

Also renamed CommonChannelClient to CommonGraphicsChannelClient.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-17 12:58:40 +00:00
Christophe Fergeau
705be34b5e Remove CursorItem::group_id
Now that the group_id is known to RedCursorCmd, we don't need to store
it separately in CursorItem.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-02-15 12:29:16 +00:00
Christophe Fergeau
8091df87b3 red-parse-qxl: Use QXLReleaseInfoExt instead of QXLReleaseInfo
This should allow to avoid moving the group_id separately from the QXL
commands all over the code.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-02-15 12:29:15 +00:00
Frediano Ziglio
fbdea0fa79 CommonChannel: hold a reference to QXLInstance instead of RedWorker
CommonChannel does not need to know about RedWorker.
This reduce a bit dependencies between objects.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-02-11 23:51:46 +00:00
Frediano Ziglio
721528fe37 remove unused structure definition
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-02-11 23:51:46 +00:00
Christophe Fergeau
5a603f2b63 Remove GSlice use
It's being slowly deprecated in glib
https://bugzilla.gnome.org/show_bug.cgi?id=754687

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-01-14 16:39:36 +00:00
Francois Gouget
cbc4e07682 server: Rename DISPLAY_CLIENT_TIMEOUT and de-duplicate it
Given that it is used for both cursor and display, COMMON_CLIENT_TIMEOUT
seems more appropriate. Also define it only in red-worker.h.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-12-14 10:53:40 +00:00
Frediano Ziglio
f31536802a worker: change red_worker_new_channel result to CommonChannel*
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-12-03 10:41:46 +00:00
Marc-André Lureau
82fa233fa6 server: rename _tmpl files
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-26 13:33:36 +00:00
Pavel Grunt
0426524546 syntax-check: Add missing #include <config.h> 2015-11-09 19:41:28 +01:00
Fabiano Fidêncio
3cc2513d33 cursor: fix wrong logic when initializing the channel
It's a regression introduced by commit e601e920bd. The logic error was
introduced when trying to achieve the following code[0]. but rewritten
to prefer an early return, which was wrogly negated.

[0]:
if (cursor_is_connected(worker)
    && !COMMON_CHANNEL(worker->cursor_channel)->during_target_migrate) {
        red_channel_pipes_add_type(RED_CHANNEL(worker->cursor_channel),
                                   PIPE_ITEM_TYPE_CURSOR_INIT);
}

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-04 11:20:48 +00:00
Marc-André Lureau
d8f89125fb Various changes in RedWorker and CursorChannel related to error and warning messages.
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-04 10:27:09 +00:00
Marc-André Lureau
d9a0629bc1 Store QXLInstance in CursorItem
Doing so allows us to remove the extra QXLInstance parameter from
cursor_item_unref() and makes the code a bit cleaner.

Also add cursor_item_ref().

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-03 09:53:46 +00:00
Marc-André Lureau
e601e920bd server: make more of cursor private
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-03 09:07:18 +00:00
Marc-André Lureau
c9e3b058e4 server: make cursor channel private
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-03 09:06:55 +00:00
Marc-André Lureau
0eedafaf0c Various minor style changes to worker and cursor channel
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-30 17:55:59 +00:00
Marc-André Lureau
2eb732bd4d __new_channel -> red_worker_new_channel()
Rename and lightly refactor the function that creates new common
channels for RedWorker (essentially Cursor and Display channels).

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-30 17:15:18 +00:00
Marc-André Lureau
2d934ed82e Make cursor_channel_disconnect a CursorChannel method
The first argument should be CursorChannel* rather than RedChannel*
since it's essentially a CursorChannel method.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-30 16:56:13 +00:00
Marc-André Lureau
7b39f818b8 Remove a couple single-use static functions
red_cursor_marshall_inval(), red_migrate_cursor() and
on_new_cursor_channel() were short functions that were each only called
from a single location, so there's no need for them to be separate
functions.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-30 08:48:00 +00:00
Marc-André Lureau
30c9ff7a8f CursorChannel* arg in cursor_channel_client_new()
Instead of passing a CommonChannel* argument, use CursorChannel* since
this function is only valid for CursorChannels.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-30 08:47:56 +00:00
Marc-André Lureau
591f39e7cc common_channel_client_create -> common_channel_new_client
Rename and re-order the initial arguments to make this function look and
act more like a method of the CommonChannel class.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-30 08:47:53 +00:00
Marc-André Lureau
8f5a5582c0 Change red_marshall_verb() to accept a VerbItem
Instead of passing a verb enumeration value, pass the verb pipe item

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-30 08:47:50 +00:00
Marc-André Lureau
26005ddb04 Remove unused parameter from cursor_channel_new()
cursor_channel_new() is only called from one location, and always passes
FALSE as the value for the 'migrate' paramater. In addition, this
parameter is not used within the function. Remove it.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-30 08:47:45 +00:00
Marc-André Lureau
070e0fcd63 worker: move some cursor code to cursor-channel.c
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-10-29 09:58:25 +00:00