本文整理汇总了C++中GDK_X11_SCREEN函数的典型用法代码示例。如果您正苦于以下问题:C++ GDK_X11_SCREEN函数的具体用法?C++ GDK_X11_SCREEN怎么用?C++ GDK_X11_SCREEN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GDK_X11_SCREEN函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gdk_x11_screen_get_window_manager_name
/**
* gdk_x11_screen_get_window_manager_name:
* @screen: a #GdkScreen
*
* Returns the name of the window manager for @screen.
*
* Return value: the name of the window manager screen @screen, or
* "unknown" if the window manager is unknown. The string is owned by GDK
* and should not be freed.
*
* Since: 2.2
**/
const char*
gdk_x11_screen_get_window_manager_name (GdkScreen *screen)
{
GdkX11Screen *x11_screen;
GdkDisplay *display;
x11_screen = GDK_X11_SCREEN (screen);
display = x11_screen->display;
if (!G_LIKELY (GDK_X11_DISPLAY (display)->trusted_client))
return x11_screen->window_manager_name;
fetch_net_wm_check_window (screen);
if (x11_screen->need_refetch_wm_name)
{
/* Get the name of the window manager */
x11_screen->need_refetch_wm_name = FALSE;
g_free (x11_screen->window_manager_name);
x11_screen->window_manager_name = g_strdup ("unknown");
if (x11_screen->wmspec_check_window != None)
{
Atom type;
gint format;
gulong n_items;
gulong bytes_after;
gchar *name;
name = NULL;
gdk_x11_display_error_trap_push (display);
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
x11_screen->wmspec_check_window,
gdk_x11_get_xatom_by_name_for_display (display,
"_NET_WM_NAME"),
0, G_MAXLONG, False,
gdk_x11_get_xatom_by_name_for_display (display,
"UTF8_STRING"),
&type, &format,
&n_items, &bytes_after,
(guchar **)&name);
gdk_x11_display_error_trap_pop_ignored (display);
if (name != NULL)
{
g_free (x11_screen->window_manager_name);
x11_screen->window_manager_name = g_strdup (name);
XFree (name);
}
}
}
return GDK_X11_SCREEN (screen)->window_manager_name;
}
示例2: gdk_x11_screen_get_height_mm
static gint
gdk_x11_screen_get_height_mm (GdkScreen *screen)
{
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
return HeightMMOfScreen (GDK_X11_SCREEN (screen)->xscreen);
}
示例3: gdk_x11_screen_get_display
static GdkDisplay *
gdk_x11_screen_get_display (GdkScreen *screen)
{
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
return GDK_X11_SCREEN (screen)->display;
}
示例4: gdk_x11_screen_get_n_monitors
static gint
gdk_x11_screen_get_n_monitors (GdkScreen *screen)
{
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
return GDK_X11_SCREEN (screen)->n_monitors;
}
示例5: gdk_x11_screen_get_root_window
static GdkWindow *
gdk_x11_screen_get_root_window (GdkScreen *screen)
{
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
return GDK_X11_SCREEN (screen)->root_window;
}
示例6: gdk_x11_screen_get_width
static gint
gdk_x11_screen_get_width (GdkScreen *screen)
{
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
return WidthOfScreen (GDK_X11_SCREEN (screen)->xscreen);
}
示例7: gdk_x11_screen_get_primary_monitor
static gint
gdk_x11_screen_get_primary_monitor (GdkScreen *screen)
{
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
return GDK_X11_SCREEN (screen)->primary_monitor;
}
示例8: _gdk_x11_screen_new
GdkScreen *
_gdk_x11_screen_new (GdkDisplay *display,
gint screen_number)
{
GdkScreen *screen;
GdkX11Screen *x11_screen;
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
screen = g_object_new (GDK_TYPE_X11_SCREEN, NULL);
x11_screen = GDK_X11_SCREEN (screen);
x11_screen->display = display;
x11_screen->xdisplay = display_x11->xdisplay;
x11_screen->xscreen = ScreenOfDisplay (display_x11->xdisplay, screen_number);
x11_screen->screen_num = screen_number;
x11_screen->xroot_window = RootWindow (display_x11->xdisplay,screen_number);
x11_screen->wmspec_check_window = None;
/* we want this to be always non-null */
x11_screen->window_manager_name = g_strdup ("unknown");
init_multihead (screen);
init_randr_support (screen);
_gdk_x11_screen_init_visuals (screen);
_gdk_x11_screen_init_root_window (screen);
return screen;
}
示例9: gdk_x11_screen_is_composited
static gboolean
gdk_x11_screen_is_composited (GdkScreen *screen)
{
GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
return x11_screen->is_composited;
}
示例10: gdk_x11_screen_get_rgba_visual
static GdkVisual *
gdk_x11_screen_get_rgba_visual (GdkScreen *screen)
{
GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
return x11_screen->rgba_visual;
}
示例11: update_bounding_box
static void
update_bounding_box (GdkScreen *screen)
{
GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
GdkX11Display *x11_display = GDK_X11_DISPLAY (x11_screen->display);
gint i, x1, y1, x2, y2;
x1 = y1 = G_MAXINT;
x2 = y2 = G_MININT;
for (i = 0; i < x11_display->monitors->len; i++)
{
GdkX11Monitor *monitor = x11_display->monitors->pdata[i];
GdkRectangle geometry;
gdk_monitor_get_geometry (GDK_MONITOR (monitor), &geometry);
x1 = MIN (x1, geometry.x);
y1 = MIN (y1, geometry.y);
x2 = MAX (x2, geometry.x + geometry.width);
y2 = MAX (y2, geometry.y + geometry.height);
}
x11_screen->width = x2 - x1;
x11_screen->height = y2 - y1;
}
示例12: process_monitors_change
static void
process_monitors_change (GdkScreen *screen)
{
GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
gint n_monitors;
gint primary_monitor;
GdkX11Monitor *monitors;
gboolean changed;
primary_monitor = x11_screen->primary_monitor;
n_monitors = x11_screen->n_monitors;
monitors = x11_screen->monitors;
x11_screen->n_monitors = 0;
x11_screen->monitors = NULL;
init_multihead (screen);
changed =
!compare_monitors (monitors, n_monitors,
x11_screen->monitors, x11_screen->n_monitors) ||
x11_screen->primary_monitor != primary_monitor;
free_monitors (monitors, n_monitors);
if (changed)
g_signal_emit_by_name (screen, "monitors-changed");
}
示例13: get_netwm_cardinal_property
static guint32
get_netwm_cardinal_property (GdkScreen *screen,
const gchar *name)
{
GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
GdkAtom atom;
guint32 prop = 0;
Atom type;
gint format;
gulong nitems;
gulong bytes_after;
guchar *data;
atom = gdk_atom_intern_static_string (name);
if (!gdk_x11_screen_supports_net_wm_hint (screen, atom))
return 0;
XGetWindowProperty (x11_screen->xdisplay,
x11_screen->xroot_window,
gdk_x11_get_xatom_by_name_for_display (GDK_SCREEN_DISPLAY (screen), name),
0, G_MAXLONG,
False, XA_CARDINAL, &type, &format, &nitems,
&bytes_after, &data);
if (type == XA_CARDINAL)
{
prop = *(gulong *)data;
XFree (data);
}
return prop;
}
示例14: gdk_x11_screen_get_setting
static gboolean
gdk_x11_screen_get_setting (GdkScreen *screen,
const gchar *name,
GValue *value)
{
GdkX11Screen *x11_screen = GDK_X11_SCREEN (screen);
const GValue *setting;
if (x11_screen->xsettings == NULL)
goto out;
setting = g_hash_table_lookup (x11_screen->xsettings, name);
if (setting == NULL)
goto out;
if (!g_value_transform (setting, value))
{
g_warning ("Cannot transform xsetting %s of type %s to type %s\n",
name,
g_type_name (G_VALUE_TYPE (setting)),
g_type_name (G_VALUE_TYPE (value)));
goto out;
}
return TRUE;
out:
return _gdk_x11_get_xft_setting (screen, name, value);
}
示例15: gdk_x11_screen_dispose
static void
gdk_x11_screen_dispose (GObject *object)
{
GdkX11Screen *x11_screen = GDK_X11_SCREEN (object);
int i;
for (i = 0; i < 32; ++i)
{
if (x11_screen->subwindow_gcs[i])
{
XFreeGC (x11_screen->xdisplay, x11_screen->subwindow_gcs[i]);
x11_screen->subwindow_gcs[i] = 0;
}
}
_gdk_x11_xsettings_finish (x11_screen);
if (x11_screen->root_window)
_gdk_window_destroy (x11_screen->root_window, TRUE);
for (i = 0; i < x11_screen->nvisuals; i++)
g_object_run_dispose (G_OBJECT (x11_screen->visuals[i]));
G_OBJECT_CLASS (gdk_x11_screen_parent_class)->dispose (object);
x11_screen->xdisplay = NULL;
x11_screen->xscreen = NULL;
x11_screen->screen_num = -1;
x11_screen->xroot_window = None;
x11_screen->wmspec_check_window = None;
}