Exemplo n.º 1
0
void
gdk_wayland_selection_ensure_offer (GdkDisplay           *display,
                                    struct wl_data_offer *wl_offer)
{
  GdkWaylandSelection *selection = gdk_wayland_display_get_selection (display);
  DataOfferData *info;

  info = g_hash_table_lookup (selection->offers, wl_offer);

  if (!info)
    {
      info = data_offer_data_new (wl_offer);
      g_hash_table_insert (selection->offers, wl_offer, info);
      wl_data_offer_add_listener (wl_offer,
                                  &data_offer_listener,
                                  selection);
    }
}
Exemplo n.º 2
0
void
gdk_wayland_selection_ensure_primary_offer (GdkDisplay                         *display,
                                            struct gtk_primary_selection_offer *gtk_offer)
{
  GdkWaylandSelection *selection = gdk_wayland_display_get_selection (display);
  DataOfferData *info;

  info = g_hash_table_lookup (selection->offers, gtk_offer);

  if (!info)
    {
      info = data_offer_data_new (gtk_offer,
                                  (GDestroyNotify) gtk_primary_selection_offer_destroy);
      g_hash_table_insert (selection->offers, gtk_offer, info);
      gtk_primary_selection_offer_add_listener (gtk_offer,
                                                &primary_offer_listener,
                                                selection);
    }
}