Exemple #1
0
/**
 * gdk_visual_get_screen:
 * @visual: a #GdkVisual
 *
 * Gets the screen to which this visual belongs
 *
 * Returns: (transfer none): the screen to which this visual belongs.
 *
 * Since: 2.2
 */
GdkScreen *
gdk_visual_get_screen (GdkVisual *visual)
{
  g_return_val_if_fail (GDK_IS_VISUAL (visual), NULL);

  return visual->screen;
}
Exemple #2
0
/**
 * gdk_visual_get_bits_per_rgb:
 * @visual: a #GdkVisual
 *
 * Returns the number of significant bits per red, green and blue value.
 *
 * Returns: The number of significant bits per color value for @visual.
 *
 * Since: 2.22
 */
gint
gdk_visual_get_bits_per_rgb (GdkVisual *visual)
{
  g_return_val_if_fail (GDK_IS_VISUAL (visual), 0);

  return visual->bits_per_rgb;
}
Exemple #3
0
/**
 * gdk_visual_get_colormap_size:
 * @visual: A #GdkVisual.
 *
 * Returns the size of a colormap for this visual.
 *
 * Returns: The size of a colormap that is suitable for @visual.
 *
 * Since: 2.22
 */
gint
gdk_visual_get_colormap_size (GdkVisual *visual)
{
  g_return_val_if_fail (GDK_IS_VISUAL (visual), 0);

  return visual->colormap_size;
}
Exemple #4
0
/**
 * gdk_visual_get_byte_order:
 * @visual: A #GdkVisual.
 *
 * Returns the byte order of this visual.
 *
 * Returns: A #GdkByteOrder stating the byte order of @visual.
 *
 * Since: 2.22
 */
GdkByteOrder
gdk_visual_get_byte_order (GdkVisual *visual)
{
  g_return_val_if_fail (GDK_IS_VISUAL (visual), 0);

  return visual->byte_order;
}
Exemple #5
0
/**
 * gdk_visual_get_depth:
 * @visual: A #GdkVisual.
 *
 * Returns the bit depth of this visual.
 *
 * Returns: The bit depth of this visual.
 *
 * Since: 2.22
 */
gint
gdk_visual_get_depth (GdkVisual *visual)
{
  g_return_val_if_fail (GDK_IS_VISUAL (visual), 0);

  return visual->depth;
}
Exemple #6
0
/**
 * gdk_visual_get_visual_type:
 * @visual: A #GdkVisual.
 *
 * Returns the type of visual this is (PseudoColor, TrueColor, etc).
 *
 * Returns: A #GdkVisualType stating the type of @visual.
 *
 * Since: 2.22
 */
GdkVisualType
gdk_visual_get_visual_type (GdkVisual *visual)
{
  g_return_val_if_fail (GDK_IS_VISUAL (visual), 0);

  return visual->type;
}
Exemple #7
0
/* private at present... */
gboolean
_gdk_x11_gl_overlay_get_info (GdkVisual        *visual,
                              GdkGLOverlayInfo *overlay_info)
{
  __SOVPropArray *sov_props;
  VisualID xvisualid;
  int i;

  GDK_GL_NOTE_FUNC_PRIVATE ();

  g_return_val_if_fail (GDK_IS_VISUAL (visual), FALSE);
  g_return_val_if_fail (overlay_info != NULL, FALSE);

  /* Get SOV properties. */

#ifdef GDKGLEXT_MULTIHEAD_SUPPORT
  sov_props = gdk_gl_overlay_get_sov_props (gdk_visual_get_screen (visual));
#else  /* GDKGLEXT_MULTIHEAD_SUPPORT */
  sov_props = gdk_gl_overlay_get_sov_props (NULL);
#endif /* GDKGLEXT_MULTIHEAD_SUPPORT */

  /* Look up SOV property for the visual. */

  xvisualid = GDK_VISUAL_XVISUAL (visual)->visualid;

  for (i = 0; i < sov_props->num; i++)
    {
      if ((VisualID) (sov_props->prop[i].overlay_visual) == xvisualid)
        {
          overlay_info->visual           = visual;
          overlay_info->transparent_type = sov_props->prop[i].transparent_type;
          overlay_info->value            = sov_props->prop[i].value;
          overlay_info->layer            = sov_props->prop[i].layer;

          GDK_GL_NOTE (MISC, g_message (" -- overlay visual"));
          GDK_GL_NOTE (MISC, g_print ("transparent_type = %d\n",
                                      overlay_info->transparent_type));
          GDK_GL_NOTE (MISC, g_print ("value = %u\n",
                                      overlay_info->value));
          GDK_GL_NOTE (MISC, g_print ("layer = %d\n",
                                      overlay_info->layer));

          return TRUE;
        }
    }

  /* meaningless */
  overlay_info->visual           = visual;
  overlay_info->transparent_type = GDK_GL_OVERLAY_TRANSPARENT_NONE;
  overlay_info->value            = 0;
  overlay_info->layer            = 0;

  GDK_GL_NOTE (MISC, g_message (" -- not overlay visual"));
      
  return FALSE;
}
Exemple #8
0
/**
 * gdk_visual_get_blue_pixel_details:
 * @visual: a #GdkVisual
 * @mask: (out) (allow-none): A pointer to a #guint32 to be filled in, or %NULL
 * @shift: (out) (allow-none): A pointer to a #gint to be filled in, or %NULL
 * @precision: (out) (allow-none): A pointer to a #gint to be filled in, or %NULL
 *
 * Obtains values that are needed to calculate blue pixel values in TrueColor
 * and DirectColor. The “mask” is the significant bits within the pixel.
 * The “shift” is the number of bits left we must shift a primary for it
 * to be in position (according to the "mask"). Finally, "precision" refers
 * to how much precision the pixel value contains for a particular primary.
 *
 * Since: 2.22
 */
void
gdk_visual_get_blue_pixel_details (GdkVisual *visual,
                                   guint32   *mask,
                                   gint      *shift,
                                   gint      *precision)
{
  g_return_if_fail (GDK_IS_VISUAL (visual));

  if (mask)
    *mask = visual->blue_mask;

  if (shift)
    *shift = visual->blue_shift;

  if (precision)
    *precision = visual->blue_prec;
}