本文整理汇总了C++中CLUTTER_BACKEND_X11函数的典型用法代码示例。如果您正苦于以下问题:C++ CLUTTER_BACKEND_X11函数的具体用法?C++ CLUTTER_BACKEND_X11怎么用?C++ CLUTTER_BACKEND_X11使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CLUTTER_BACKEND_X11函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clutter_stage_x11_get_geometry
static void
clutter_stage_x11_get_geometry (ClutterStageWindow *stage_window,
cairo_rectangle_int_t *geometry)
{
ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window);
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend);
geometry->x = geometry->y = 0;
/* If we're fullscreen, return the size of the display.
*
* FIXME - this is utterly broken for anything that is not a single
* head set up; the window manager will give us the right size in a
* ConfigureNotify, but between the fullscreen signal emission on the
* stage and the following frame, the size returned by the stage will
* be wrong.
*/
if (_clutter_stage_is_fullscreen (stage_cogl->wrapper) &&
stage_x11->fullscreening)
{
geometry->width = DisplayWidth (backend_x11->xdpy, backend_x11->xscreen_num);
geometry->height = DisplayHeight (backend_x11->xdpy, backend_x11->xscreen_num);
return;
}
geometry->width = stage_x11->xwin_width;
geometry->height = stage_x11->xwin_height;
}
示例2: clutter_backend_glx_create_stage
static ClutterStageWindow *
clutter_backend_glx_create_stage (ClutterBackend *backend,
ClutterStage *wrapper,
GError **error)
{
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend);
ClutterStageWindow *stage_window;
ClutterStageX11 *stage_x11;
CLUTTER_NOTE (BACKEND, "Creating stage of type '%s'",
g_type_name (CLUTTER_STAGE_TYPE));
stage_window = g_object_new (CLUTTER_TYPE_STAGE_GLX, NULL);
/* copy backend data into the stage */
stage_x11 = CLUTTER_STAGE_X11 (stage_window);
stage_x11->wrapper = wrapper;
CLUTTER_NOTE (BACKEND,
"GLX stage created[%p] (dpy:%p, screen:%d, root:%u, wrap:%p)",
stage_window,
backend_x11->xdpy,
backend_x11->xscreen_num,
(unsigned int) backend_x11->xwin_root,
wrapper);
return stage_window;
}
示例3: set_wm_title
static inline void
set_wm_title (ClutterStageX11 *stage_x11)
{
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend);
if (stage_x11->xwin == None || stage_x11->is_foreign_xwin)
return;
if (stage_x11->title == NULL)
{
XDeleteProperty (backend_x11->xdpy,
stage_x11->xwin,
backend_x11->atom_NET_WM_NAME);
}
else
{
XChangeProperty (backend_x11->xdpy,
stage_x11->xwin,
backend_x11->atom_NET_WM_NAME,
backend_x11->atom_UTF8_STRING,
8,
PropModeReplace,
(unsigned char *) stage_x11->title,
(int) strlen (stage_x11->title));
}
}
示例4: clutter_backend_egl_create_stage
static ClutterStageWindow *
clutter_backend_egl_create_stage (ClutterBackend *backend,
ClutterStage *wrapper,
GError **error)
{
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend);
ClutterStageX11 *stage_x11;
ClutterStageWindow *stage;
CLUTTER_NOTE (BACKEND, "Creating stage of type '%s'",
g_type_name (CLUTTER_STAGE_TYPE));
stage = g_object_new (CLUTTER_TYPE_STAGE_EGL, NULL);
/* copy backend data into the stage */
stage_x11 = CLUTTER_STAGE_X11 (stage);
stage_x11->wrapper = wrapper;
CLUTTER_NOTE (MISC, "EGLX stage created (display:%p, screen:%d, root:%u)",
backend_x11->xdpy,
backend_x11->xscreen_num,
(unsigned int) backend_x11->xwin_root);
return stage;
}
示例5: clutter_backend_x11_create_stage
static ClutterStageWindow *
clutter_backend_x11_create_stage (ClutterBackend *backend,
ClutterStage *wrapper,
GError **error)
{
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend);
ClutterEventTranslator *translator;
ClutterStageWindow *stage;
stage = g_object_new (CLUTTER_TYPE_STAGE_X11,
"backend", backend,
"wrapper", wrapper,
NULL);
/* the X11 stage does event translation */
translator = CLUTTER_EVENT_TRANSLATOR (stage);
_clutter_backend_add_event_translator (backend, translator);
CLUTTER_NOTE (MISC, "X11 stage created (display:%p, screen:%d, root:%u)",
backend_x11->xdpy,
backend_x11->xscreen_num,
(unsigned int) backend_x11->xwin_root);
return stage;
}
示例6: _clutter_stage_x11_get_root_coords
gboolean
_clutter_stage_x11_get_root_coords (ClutterStageX11 *stage_x11,
gint *root_x,
gint *root_y)
{
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend);
gint return_val;
Window child;
gint tx, ty;
return_val = XTranslateCoordinates (backend_x11->xdpy,
stage_x11->xwin,
backend_x11->xwin_root,
0, 0, &tx, &ty,
&child);
if (root_x)
*root_x = tx;
if (root_y)
*root_y = ty;
return (return_val == 0);
}
示例7: events_queue
static void
events_queue (ClutterBackend *backend)
{
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend);
ClutterBackendX11Class *backend_x11_class =
CLUTTER_BACKEND_X11_GET_CLASS (backend_x11);
ClutterEvent *event;
Display *xdisplay = backend_x11->xdpy;
XEvent xevent;
ClutterMainContext *clutter_context;
clutter_context = _clutter_context_get_default ();
while (!clutter_events_pending () && XPending (xdisplay))
{
XNextEvent (xdisplay, &xevent);
if (backend_x11_class->handle_event (backend_x11, &xevent))
continue;
event = clutter_event_new (CLUTTER_NOTHING);
if (event_translate (backend, event, &xevent))
{
/* push directly here to avoid copy of queue_put */
g_queue_push_head (clutter_context->events_queue, event);
}
else
{
clutter_event_free (event);
}
}
}
示例8: clutter_x11_add_filter
/**
* clutter_x11_add_filter: (skip)
* @func: a filter function
* @data: user data to be passed to the filter function, or %NULL
*
* Adds an event filter function.
*
* Since: 0.6
*/
void
clutter_x11_add_filter (ClutterX11FilterFunc func,
gpointer data)
{
ClutterX11EventFilter *filter;
ClutterBackend *backend = clutter_get_default_backend ();
ClutterBackendX11 *backend_x11;
g_return_if_fail (func != NULL);
if (backend == NULL)
{
g_critical ("The Clutter backend has not been initialised");
return;
}
if (!CLUTTER_IS_BACKEND_X11 (backend))
{
g_critical ("The Clutter backend is not a X11 backend");
return;
}
backend_x11 = CLUTTER_BACKEND_X11 (backend);
filter = g_new0 (ClutterX11EventFilter, 1);
filter->func = func;
filter->data = data;
backend_x11->event_filters =
g_slist_append (backend_x11->event_filters, filter);
return;
}
示例9: clutter_x11_get_current_event_time
/**
* clutter_x11_get_current_event_time: (skip)
*
* Retrieves the timestamp of the last X11 event processed by
* Clutter. This might be different from the timestamp returned
* by clutter_get_current_event_time(), as Clutter may synthesize
* or throttle events.
*
* Return value: a timestamp, in milliseconds
*
* Since: 1.0
*/
Time
clutter_x11_get_current_event_time (void)
{
ClutterBackend *backend = clutter_get_default_backend ();
return CLUTTER_BACKEND_X11 (backend)->last_event_time;
}
示例10: clutter_backend_glx_dispose
static void
clutter_backend_glx_dispose (GObject *gobject)
{
ClutterBackendGLX *backend_glx = CLUTTER_BACKEND_GLX (gobject);
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (gobject);
/* Unrealize all shaders, since the GL context is going away */
_clutter_shader_release_all ();
if (backend_glx->gl_context)
{
glXMakeContextCurrent (backend_x11->xdpy, None, None, NULL);
glXDestroyContext (backend_x11->xdpy, backend_glx->gl_context);
backend_glx->gl_context = None;
}
if (backend_glx->dummy_glxwin)
{
glXDestroyWindow (backend_x11->xdpy, backend_glx->dummy_glxwin);
backend_glx->dummy_glxwin = None;
}
if (backend_glx->dummy_xwin)
{
XDestroyWindow (backend_x11->xdpy, backend_glx->dummy_xwin);
backend_glx->dummy_xwin = None;
}
G_OBJECT_CLASS (clutter_backend_glx_parent_class)->dispose (gobject);
}
示例11: clutter_stage_glx_unrealize
static void
clutter_stage_glx_unrealize (ClutterStageWindow *stage_window)
{
ClutterBackend *backend = clutter_get_default_backend ();
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend);
ClutterStageX11 *stage_x11 = CLUTTER_STAGE_X11 (stage_window);
ClutterStageGLX *stage_glx = CLUTTER_STAGE_GLX (stage_window);
/* Note unrealize should free up any backend stage related resources */
CLUTTER_NOTE (BACKEND, "Unrealizing stage");
clutter_x11_trap_x_errors ();
if (stage_glx->glxwin != None)
{
glXDestroyWindow (backend_x11->xdpy, stage_glx->glxwin);
stage_glx->glxwin = None;
}
if (!stage_x11->is_foreign_xwin && stage_x11->xwin != None)
{
XDestroyWindow (backend_x11->xdpy, stage_x11->xwin);
stage_x11->xwin = None;
}
else
stage_x11->xwin = None;
XSync (backend_x11->xdpy, False);
clutter_x11_untrap_x_errors ();
CLUTTER_MARK ();
}
示例12: _clutter_backend_x11_events_init
void
_clutter_backend_x11_events_init (ClutterBackend *backend)
{
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend);
GSource *source;
ClutterEventSource *event_source;
int connection_number;
gchar *name;
connection_number = ConnectionNumber (backend_x11->xdpy);
CLUTTER_NOTE (EVENT, "Connection number: %d", connection_number);
source = backend_x11->event_source = clutter_event_source_new (backend);
event_source = (ClutterEventSource *) source;
g_source_set_priority (source, CLUTTER_PRIORITY_EVENTS);
name = g_strdup_printf ("Clutter X11 Event (connection: %d)",
connection_number);
g_source_set_name (source, name);
g_free (name);
event_source->event_poll_fd.fd = connection_number;
event_source->event_poll_fd.events = G_IO_IN;
event_sources = g_list_prepend (event_sources, event_source);
g_source_add_poll (source, &event_source->event_poll_fd);
g_source_set_can_recurse (source, TRUE);
g_source_attach (source, NULL);
}
示例13: get_xkb
static XkbDescPtr
get_xkb (ClutterKeymapX11 *keymap_x11)
{
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (keymap_x11->backend);
if (keymap_x11->max_keycode == 0)
XDisplayKeycodes (backend_x11->xdpy,
&keymap_x11->min_keycode,
&keymap_x11->max_keycode);
if (keymap_x11->xkb_desc == NULL)
{
int flags = XkbKeySymsMask
| XkbKeyTypesMask
| XkbModifierMapMask
| XkbVirtualModsMask;
keymap_x11->xkb_desc = XkbGetMap (backend_x11->xdpy, flags, XkbUseCoreKbd);
if (G_UNLIKELY (keymap_x11->xkb_desc == NULL))
{
g_error ("Failed to get the keymap from XKB");
return NULL;
}
flags = XkbGroupNamesMask | XkbVirtualModNamesMask;
XkbGetNames (backend_x11->xdpy, flags, keymap_x11->xkb_desc);
update_modmap (backend_x11->xdpy, keymap_x11);
}
else if (keymap_x11->xkb_map_serial != backend_x11->keymap_serial)
{
int flags = XkbKeySymsMask
| XkbKeyTypesMask
| XkbModifierMapMask
| XkbVirtualModsMask;
CLUTTER_NOTE (BACKEND, "Updating XKB keymap");
XkbGetUpdatedMap (backend_x11->xdpy, flags, keymap_x11->xkb_desc);
flags = XkbGroupNamesMask | XkbVirtualModNamesMask;
XkbGetNames (backend_x11->xdpy, flags, keymap_x11->xkb_desc);
update_modmap (backend_x11->xdpy, keymap_x11);
keymap_x11->xkb_map_serial = backend_x11->keymap_serial;
}
if (keymap_x11->num_lock_mask == 0)
keymap_x11->num_lock_mask = XkbKeysymToModifiers (backend_x11->xdpy,
XK_Num_Lock);
if (keymap_x11->scroll_lock_mask == 0)
keymap_x11->scroll_lock_mask = XkbKeysymToModifiers (backend_x11->xdpy,
XK_Scroll_Lock);
return keymap_x11->xkb_desc;
}
示例14: _clutter_stage_x11_set_user_time
void
_clutter_stage_x11_set_user_time (ClutterStageX11 *stage_x11,
guint32 user_time)
{
ClutterStageCogl *stage_cogl = CLUTTER_STAGE_COGL (stage_x11);
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (stage_cogl->backend);
set_user_time (backend_x11, stage_x11, user_time);
}
示例15: clutter_backend_x11_get_keymap_direction
static PangoDirection
clutter_backend_x11_get_keymap_direction (ClutterBackend *backend)
{
ClutterBackendX11 *backend_x11 = CLUTTER_BACKEND_X11 (backend);
if (G_UNLIKELY (backend_x11->keymap == NULL))
return PANGO_DIRECTION_NEUTRAL;
return _clutter_keymap_x11_get_direction (backend_x11->keymap);
}