Exemple #1
0
void nsRegionGTK::SetTo(const nsIRegion &aRegion)
{
    Init();

    nsRegionGTK *pRegion = (nsRegionGTK *)&aRegion;

    mRegion = gdk_region_copy(pRegion->mRegion);
}
Exemple #2
0
    wxRegionRefData(const wxRegionRefData& refData)
        : wxGDIRefData()
    {
#ifdef __WXGTK3__
        m_region = cairo_region_copy(refData.m_region);
#else
        m_region = gdk_region_copy(refData.m_region);
#endif
    }
Exemple #3
0
void nsRegionGTK::Union(const nsIRegion &aRegion)
{
    nsRegionGTK *pRegion = (nsRegionGTK *)&aRegion;

    if (pRegion->mRegion && !::gdk_region_empty(pRegion->mRegion)) {
        if (mRegion) {
            if (::gdk_region_empty(mRegion)) {
                ::gdk_region_destroy(mRegion);
                mRegion = gdk_region_copy(pRegion->mRegion);
            } else {
                GdkRegion *nRegion = ::gdk_regions_union(mRegion, pRegion->mRegion);
                ::gdk_region_destroy(mRegion);
                mRegion = nRegion;
            }
        } else
            mRegion = gdk_region_copy(pRegion->mRegion);
    }
}
Exemple #4
0
wxRegion::wxRegion( GdkRegion *region )
{
    m_refData = new wxRegionRefData();
    M_REGIONDATA->m_region = gdk_region_copy( region );
}
Exemple #5
0
 wxRegionRefData(const wxRegionRefData& refData)
     : wxObjectRefData()
 {
     m_region = gdk_region_copy(refData.m_region);
 }
Exemple #6
0
wxRegion::wxRegion(const GdkRegion* region)
{
    m_refData = new wxRegionRefData();
    M_REGIONDATA->m_region = gdk_region_copy(const_cast<GdkRegion*>(region));
}
Exemple #7
0
/**
 * gdk_event_copy:
 * @event: a #GdkEvent
 * 
 * Copies a #GdkEvent, copying or incrementing the reference count of the
 * resources associated with it (e.g. #GdkWindow's and strings).
 * 
 * Return value: a copy of @event. The returned #GdkEvent should be freed with
 * gdk_event_free().
 **/
GdkEvent*
gdk_event_copy (const GdkEvent *event)
{
  GdkEventPrivate *new_private;
  GdkEvent *new_event;
  
  g_return_val_if_fail (event != NULL, NULL);
  
  new_event = gdk_event_new (GDK_NOTHING);
  new_private = (GdkEventPrivate *)new_event;

  *new_event = *event;
  if (new_event->any.window)
    g_object_ref (new_event->any.window);

  if (gdk_event_is_allocated (event))
    {
      GdkEventPrivate *private = (GdkEventPrivate *)event;

      new_private->screen = private->screen;
    }
  
  switch (event->any.type)
    {
    case GDK_KEY_PRESS:
    case GDK_KEY_RELEASE:
      new_event->key.string = g_strdup (event->key.string);
      break;
      
    case GDK_ENTER_NOTIFY:
    case GDK_LEAVE_NOTIFY:
      if (event->crossing.subwindow != NULL)
	g_object_ref (event->crossing.subwindow);
      break;
      
    case GDK_DRAG_ENTER:
    case GDK_DRAG_LEAVE:
    case GDK_DRAG_MOTION:
    case GDK_DRAG_STATUS:
    case GDK_DROP_START:
    case GDK_DROP_FINISHED:
      g_object_ref (event->dnd.context);
      break;
      
    case GDK_EXPOSE:
    case GDK_DAMAGE:
      if (event->expose.region)
	new_event->expose.region = gdk_region_copy (event->expose.region);
      break;
      
    case GDK_SETTING:
      new_event->setting.name = g_strdup (new_event->setting.name);
      break;

    case GDK_BUTTON_PRESS:
    case GDK_BUTTON_RELEASE:
      if (event->button.axes) 
	new_event->button.axes = g_memdup (event->button.axes, 
					     sizeof (gdouble) * event->button.device->num_axes);
      break;

    case GDK_MOTION_NOTIFY:
      if (event->motion.axes) 
	new_event->motion.axes = g_memdup (event->motion.axes, 
					   sizeof (gdouble) * event->motion.device->num_axes);
      
      break;
      
    default:
      break;
    }

  if (gdk_event_is_allocated (event))
    _gdk_windowing_event_data_copy (event, new_event);
  
  return new_event;
}