Debian Codegraph @

gdk/directfb/gdkwindowid.c

raw
1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
18 */
19
20 /*
21 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GTK+ Team.
23 */
24
25 /*
26 * GTK+ DirectFB backend
27 * Copyright (C) 2001-2002 convergence integrated media GmbH
28 * Copyright (C) 2002-2004 convergence GmbH
29 * Written by Denis Oliver Kropp <[email protected]> and
30 * Sven Neumann <[email protected]>
31 */
32
33 #include "config.h"
34
35 #include "gdkdirectfb.h"
36 #include "gdkprivate-directfb.h"
37
38
39 static GHashTable *window_id_ht = NULL;
40
41
42 void
43 gdk_directfb_window_id_table_insert (DFBWindowID dfb_id,
44 GdkWindow *window)
45 {
46 if (!window_id_ht)
47 window_id_ht = g_hash_table_new (g_direct_hash, g_direct_equal);
48
49 g_hash_table_insert (window_id_ht, GUINT_TO_POINTER (dfb_id), window);
50 }
51
52 void
53 gdk_directfb_window_id_table_remove (DFBWindowID dfb_id)
54 {
55 if (window_id_ht)
56 g_hash_table_remove (window_id_ht, GUINT_TO_POINTER (dfb_id));
57 }
58
59 GdkWindow *
60 gdk_directfb_window_id_table_lookup (DFBWindowID dfb_id)
61 {
62 GdkWindow *window = NULL;
63
64 if (window_id_ht)
65 window = (GdkWindow *) g_hash_table_lookup (window_id_ht,
66 GUINT_TO_POINTER (dfb_id));
67
68 return window;
69 }