Hit.cs: Remove FIXME by using binary search while searching properties.
[beagle.git] / chooser-fu / preload-symbols.c
blobb1ad6f3ec111e112601d225b020a06cbc9b6197d
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
4 /*
5 * preload_symbols.c
7 * Copyright (C) 2004 Novell, Inc.
9 */
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License as
14 * published by the Free Software Foundation; either version 2 of the
15 * License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 * USA.
28 #ifdef CONFIG_H
29 #include <config.h>
30 #endif
32 #include <dlfcn.h>
33 #include <gtk/gtk.h>
34 #include "gtkfilesystembeagle.h"
36 GtkFileSystem *
37 _gtk_file_system_create (const char *file_system_name)
39 g_print ("Using Beagle File Chooser Hack\n");
40 return gtk_file_system_beagle_new ();
43 GtkWidget *
44 _gtk_file_chooser_default_new (const char *file_system)
46 void *chooser_default = NULL;
47 GtkWidget *label;
48 GtkWidget *chooser;
50 if (chooser_default == NULL) {
51 void *gtk_handle = dlopen ("/opt/gnome/lib/libgtk-x11-2.0.so", RTLD_LAZY);
52 g_assert (gtk_handle != NULL);
53 chooser_default = dlsym (gtk_handle, "_gtk_file_chooser_default_new");
54 g_assert (chooser_default != NULL);
57 chooser = ((GtkWidget *(*)(const char *)) chooser_default) (file_system);
59 return chooser;