2008-01-31 Rob Bradford <rob@openedhand.com>

* clutter/x11/clutter-backend-x11-private.h:
	Add missing start to comment

	* clutter/x11/clutter-backend-x11.c:
	* clutter/x11/clutter-event-x11.c:
	* clutter/x11/clutter-stage-x11.c:
	* clutter/x11/clutter-x11.h:
	Remove tabs.
This commit is contained in:
Robert Bradford 2008-01-31 11:24:11 +00:00
parent 6a8cdee27f
commit e40ba6e9b7
6 changed files with 145 additions and 134 deletions

View File

@ -1,3 +1,14 @@
2008-01-31 Rob Bradford <rob@openedhand.com>
* clutter/x11/clutter-backend-x11-private.h:
Add missing start to comment
* clutter/x11/clutter-backend-x11.c:
* clutter/x11/clutter-event-x11.c:
* clutter/x11/clutter-stage-x11.c:
* clutter/x11/clutter-x11.h:
Remove tabs.
2008-01-30 Emmanuele Bassi <ebassi@openedhand.com>
* README: Add the osx flavour, and mark it experimental,

View File

@ -1,4 +1,4 @@
* An OpenGL based 'interactive canvas' library.
/* An OpenGL based 'interactive canvas' library.
* Authored By Matthew Allum <mallum@openedhand.com>
* Copyright (C) 2006-2007 OpenedHand
*

View File

@ -327,7 +327,7 @@ clutter_backend_x11_init (ClutterBackendX11 *backend_x11)
static int
error_handler(Display *xdpy,
XErrorEvent *error)
XErrorEvent *error)
{
TrappedErrorCode = error->error_code;
return 0;
@ -488,8 +488,8 @@ clutter_x11_remove_filter (ClutterX11FilterFunc func,
if (filter->func == func && filter->data == data)
{
backend_singleton->event_filters =
g_slist_remove_link (backend_singleton->event_filters, this);
backend_singleton->event_filters =
g_slist_remove_link (backend_singleton->event_filters, this);
g_slist_free_1 (this);
g_free (filter);

View File

@ -108,10 +108,10 @@ check_xpending (ClutterBackend *backend)
static gboolean
xembed_send_message (ClutterBackendX11 *backend_x11,
Window window,
long message,
long detail,
long data1,
long data2)
long message,
long detail,
long data1,
long data2)
{
XEvent ev;
@ -330,8 +330,8 @@ handle_xembed_event (ClutterBackendX11 *backend_x11,
static gboolean
event_translate (ClutterBackend *backend,
ClutterEvent *event,
XEvent *xevent)
ClutterEvent *event,
XEvent *xevent)
{
ClutterBackendX11 *backend_x11;
ClutterStageX11 *stage_x11;
@ -356,23 +356,23 @@ event_translate (ClutterBackend *backend,
node = backend_x11->event_filters;
while (node)
{
filter = node->data;
{
filter = node->data;
switch (filter->func (xevent, event, filter->data))
{
case CLUTTER_X11_FILTER_CONTINUE:
break;
case CLUTTER_X11_FILTER_TRANSLATE:
return TRUE;
case CLUTTER_X11_FILTER_REMOVE:
return FALSE;
default:
break;
}
switch (filter->func (xevent, event, filter->data))
{
case CLUTTER_X11_FILTER_CONTINUE:
break;
case CLUTTER_X11_FILTER_TRANSLATE:
return TRUE;
case CLUTTER_X11_FILTER_REMOVE:
return FALSE;
default:
break;
}
node = node->next;
}
node = node->next;
}
}
res = TRUE;
@ -390,7 +390,7 @@ event_translate (ClutterBackend *backend,
if (xevent->xconfigure.width != stage_width ||
xevent->xconfigure.height != stage_height)
{
clutter_actor_set_size (CLUTTER_ACTOR (stage),
clutter_actor_set_size (CLUTTER_ACTOR (stage),
xevent->xconfigure.width,
xevent->xconfigure.height);
}
@ -426,16 +426,16 @@ event_translate (ClutterBackend *backend,
{
if (atoms[i] == backend_x11->atom_NET_WM_STATE_FULLSCREEN)
fullscreen_set = TRUE;
}
}
is_fullscreen =
(stage_x11->state & CLUTTER_STAGE_STATE_FULLSCREEN);
if (fullscreen_set != is_fullscreen)
{
if (fullscreen_set)
{
if (fullscreen_set)
stage_x11->state |= CLUTTER_STAGE_STATE_FULLSCREEN;
else
else
stage_x11->state &= ~CLUTTER_STAGE_STATE_FULLSCREEN;
event->type = CLUTTER_STAGE_STATE;
@ -447,8 +447,8 @@ event_translate (ClutterBackend *backend,
res = FALSE;
XFree (data);
}
else
}
else
res = FALSE;
}
break;
@ -465,29 +465,29 @@ event_translate (ClutterBackend *backend,
case FocusIn:
if (!(stage_x11->state & CLUTTER_STAGE_STATE_ACTIVATED))
{
/* TODO: check xevent->xfocus.detail ? */
stage_x11->state |= CLUTTER_STAGE_STATE_ACTIVATED;
{
/* TODO: check xevent->xfocus.detail ? */
stage_x11->state |= CLUTTER_STAGE_STATE_ACTIVATED;
event->type = CLUTTER_STAGE_STATE;
event->stage_state.changed_mask = CLUTTER_STAGE_STATE_ACTIVATED;
event->stage_state.new_state = stage_x11->state;
}
event->type = CLUTTER_STAGE_STATE;
event->stage_state.changed_mask = CLUTTER_STAGE_STATE_ACTIVATED;
event->stage_state.new_state = stage_x11->state;
}
else
res = FALSE;
res = FALSE;
break;
case FocusOut:
if (stage_x11->state & CLUTTER_STAGE_STATE_ACTIVATED)
{
stage_x11->state &= ~CLUTTER_STAGE_STATE_ACTIVATED;
{
stage_x11->state &= ~CLUTTER_STAGE_STATE_ACTIVATED;
event->type = CLUTTER_STAGE_STATE;
event->stage_state.changed_mask = CLUTTER_STAGE_STATE_ACTIVATED;
event->stage_state.new_state = stage_x11->state;
}
event->type = CLUTTER_STAGE_STATE;
event->stage_state.changed_mask = CLUTTER_STAGE_STATE_ACTIVATED;
event->stage_state.new_state = stage_x11->state;
}
else
res = FALSE;
res = FALSE;
break;
case Expose:

View File

@ -53,9 +53,9 @@ G_DEFINE_TYPE (ClutterStageX11, clutter_stage_x11, CLUTTER_TYPE_STAGE);
static void
send_wmspec_change_state (ClutterBackendX11 *backend_x11,
Window window,
Atom state,
gboolean add)
Window window,
Atom state,
gboolean add)
{
XClientMessageEvent xclient;
@ -73,8 +73,8 @@ send_wmspec_change_state (ClutterBackendX11 *backend_x11,
xclient.data.l[4] = 0;
XSendEvent (backend_x11->xdpy,
DefaultRootWindow(backend_x11->xdpy),
False,
DefaultRootWindow(backend_x11->xdpy),
False,
SubstructureRedirectMask|SubstructureNotifyMask,
(XEvent *)&xclient);
}
@ -93,13 +93,13 @@ clutter_stage_x11_fix_window_size (ClutterStageX11 *stage_x11)
size_hints = XAllocSizeHints();
if (!resize)
{
size_hints->max_width = size_hints->min_width =
{
size_hints->max_width = size_hints->min_width =
stage_x11->xwin_width;
size_hints->max_height = size_hints->min_height =
size_hints->max_height = size_hints->min_height =
stage_x11->xwin_height;
size_hints->flags = PMinSize|PMaxSize;
}
size_hints->flags = PMinSize|PMaxSize;
}
XSetWMNormalHints (stage_x11->xdpy, stage_x11->xwin, size_hints);
@ -154,7 +154,7 @@ clutter_stage_x11_set_wm_protocols (ClutterStageX11 *stage_x11)
static void
clutter_stage_x11_query_coords (ClutterActor *self,
ClutterActorBox *box)
ClutterActorBox *box)
{
ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (self);
@ -165,7 +165,7 @@ clutter_stage_x11_query_coords (ClutterActor *self,
static void
clutter_stage_x11_request_coords (ClutterActor *self,
ClutterActorBox *box)
ClutterActorBox *box)
{
ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (self);
gint new_width, new_height;
@ -180,30 +180,30 @@ clutter_stage_x11_request_coords (ClutterActor *self,
stage_x11->xwin_height = new_height;
if (stage_x11->xwin != None)
{
XResizeWindow (stage_x11->xdpy,
stage_x11->xwin,
stage_x11->xwin_width,
stage_x11->xwin_height);
{
XResizeWindow (stage_x11->xdpy,
stage_x11->xwin,
stage_x11->xwin_width,
stage_x11->xwin_height);
clutter_stage_x11_fix_window_size (stage_x11);
}
clutter_stage_x11_fix_window_size (stage_x11);
}
if (stage_x11->xpixmap != None)
{
/* Need to recreate to resize */
clutter_actor_unrealize (self);
clutter_actor_realize (self);
}
{
/* Need to recreate to resize */
clutter_actor_unrealize (self);
clutter_actor_realize (self);
}
CLUTTER_SET_PRIVATE_FLAGS(self, CLUTTER_ACTOR_SYNC_MATRICES);
}
if (stage_x11->xwin != None) /* Do we want to bother ? */
XMoveWindow (stage_x11->xdpy,
stage_x11->xwin,
CLUTTER_UNITS_TO_INT (box->x1),
CLUTTER_UNITS_TO_INT (box->y1));
stage_x11->xwin,
CLUTTER_UNITS_TO_INT (box->x1),
CLUTTER_UNITS_TO_INT (box->y1));
}
static void
@ -218,76 +218,76 @@ clutter_stage_x11_set_fullscreen (ClutterStage *stage,
if (fullscreen)
{
if (stage_x11->xwin != None)
{
{
/* if the actor is not mapped we resize the stage window to match
* the size of the screen; this is useful for e.g. EGLX to avoid
* a resize when calling clutter_stage_fullscreen() before showing
* the stage
*/
if (!CLUTTER_ACTOR_IS_MAPPED (stage_x11))
{
gint width, height;
if (!CLUTTER_ACTOR_IS_MAPPED (stage_x11))
{
gint width, height;
width = DisplayWidth (stage_x11->xdpy, stage_x11->xscreen);
height = DisplayHeight (stage_x11->xdpy, stage_x11->xscreen);
width = DisplayWidth (stage_x11->xdpy, stage_x11->xscreen);
height = DisplayHeight (stage_x11->xdpy, stage_x11->xscreen);
clutter_actor_set_size (CLUTTER_ACTOR (stage_x11),
width, height);
clutter_actor_set_size (CLUTTER_ACTOR (stage_x11),
width, height);
/* FIXME: This wont work if we support more states */
XChangeProperty (stage_x11->xdpy,
/* FIXME: This wont work if we support more states */
XChangeProperty (stage_x11->xdpy,
stage_x11->xwin,
backend_x11->atom_NET_WM_STATE, XA_ATOM, 32,
PropModeReplace,
(unsigned char *) &backend_x11->atom_NET_WM_STATE_FULLSCREEN, 1);
}
else
{
/* We need to set window user resize-able for metacity at
* at least to allow the window to fullscreen *sigh*
*/
if (clutter_stage_get_user_resizable (stage) == TRUE)
was_resizeable = TRUE;
else
clutter_stage_set_user_resizable (stage, TRUE);
}
else
{
/* We need to set window user resize-able for metacity at
* at least to allow the window to fullscreen *sigh*
*/
if (clutter_stage_get_user_resizable (stage) == TRUE)
was_resizeable = TRUE;
else
clutter_stage_set_user_resizable (stage, TRUE);
send_wmspec_change_state(backend_x11, stage_x11->xwin,
backend_x11->atom_NET_WM_STATE_FULLSCREEN,
TRUE);
}
send_wmspec_change_state(backend_x11, stage_x11->xwin,
backend_x11->atom_NET_WM_STATE_FULLSCREEN,
TRUE);
}
stage_x11->fullscreen_on_map = TRUE;
}
}
}
else
{
if (stage_x11->xwin != None)
{
if (!CLUTTER_ACTOR_IS_MAPPED (stage_x11))
{
/* FIXME: This wont work if we support more states */
XDeleteProperty (stage_x11->xdpy,
stage_x11->xwin,
backend_x11->atom_NET_WM_STATE);
}
else
{
clutter_stage_set_user_resizable (stage, TRUE);
{
if (!CLUTTER_ACTOR_IS_MAPPED (stage_x11))
{
/* FIXME: This wont work if we support more states */
XDeleteProperty (stage_x11->xdpy,
stage_x11->xwin,
backend_x11->atom_NET_WM_STATE);
}
else
{
clutter_stage_set_user_resizable (stage, TRUE);
send_wmspec_change_state(backend_x11,
stage_x11->xwin,
backend_x11->atom_NET_WM_STATE_FULLSCREEN,
FALSE);
send_wmspec_change_state(backend_x11,
stage_x11->xwin,
backend_x11->atom_NET_WM_STATE_FULLSCREEN,
FALSE);
/* reset the windows state - this isn't fun - see above */
if (!was_resizeable)
clutter_stage_set_user_resizable (stage, FALSE);
/* reset the windows state - this isn't fun - see above */
if (!was_resizeable)
clutter_stage_set_user_resizable (stage, FALSE);
was_resizeable = FALSE;
}
was_resizeable = FALSE;
}
stage_x11->fullscreen_on_map = FALSE;
}
}
}
CLUTTER_SET_PRIVATE_FLAGS (stage, CLUTTER_ACTOR_SYNC_MATRICES);
@ -337,7 +337,7 @@ clutter_stage_x11_set_cursor_visible (ClutterStage *stage,
static void
clutter_stage_x11_set_title (ClutterStage *stage,
const gchar *title)
const gchar *title)
{
ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage);
ClutterBackendX11 *backend_x11 = stage_x11->backend;
@ -348,25 +348,25 @@ clutter_stage_x11_set_title (ClutterStage *stage,
if (title == NULL)
{
XDeleteProperty (stage_x11->xdpy,
stage_x11->xwin,
backend_x11->atom_NET_WM_NAME);
stage_x11->xwin,
backend_x11->atom_NET_WM_NAME);
}
else
{
XChangeProperty (stage_x11->xdpy,
stage_x11->xwin,
backend_x11->atom_NET_WM_NAME,
backend_x11->atom_UTF8_STRING,
8,
PropModeReplace,
(unsigned char*)title,
(int)strlen(title));
stage_x11->xwin,
backend_x11->atom_NET_WM_NAME,
backend_x11->atom_UTF8_STRING,
8,
PropModeReplace,
(unsigned char*)title,
(int)strlen(title));
}
}
static void
clutter_stage_x11_set_user_resize (ClutterStage *stage,
gboolean value)
gboolean value)
{
ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage);

View File

@ -76,8 +76,8 @@ typedef enum {
* Since: 0.6
*/
typedef ClutterX11FilterReturn (*ClutterX11FilterFunc) (XEvent *xev,
ClutterEvent *cev,
gpointer data);
ClutterEvent *cev,
gpointer data);
void clutter_x11_trap_x_errors (void);
gint clutter_x11_untrap_x_errors (void);
@ -94,7 +94,7 @@ gboolean clutter_x11_set_stage_foreign (ClutterStage *stage,
void clutter_x11_add_filter (ClutterX11FilterFunc func,
gpointer data);
void clutter_x11_remove_filter (ClutterX11FilterFunc func,
gpointer data);
gpointer data);
G_END_DECLS