1 /*
2  * Copyright 2005-2012 Edscott Wilson Garcia
3  * license: GPL v.3
4  */
5 
6 #define __RFM_FGR_C__
7 #include  "config.h"
8 
9 
10 
11 #include <sys/types.h>
12 #include <sys/stat.h>
13 #include <fcntl.h>
14 
15 #include <glob.h>
16 #include <limits.h>
17 #include <memory.h>
18 #include <signal.h>
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include <string.h>
22 #include <unistd.h>
23 #include <dirent.h>
24 
25 #include <gtk/gtk.h>
26 #include <gdk/gdkx.h>
27 #include <gmodule.h>
28 #include <X11/Xlib.h>
29 #include <X11/Xatom.h>
30 
31 #include "rodent.h"
32 
33 #ifdef ICONVIEW_BINARY
34 # include "gridview_lib.h"
35 #endif
36 #ifdef DESKVIEW_BINARY
37 # include "deskview_lib.h"
38 #endif
39 
40 #define FORCE_CORE
41 #ifdef FORCE_CORE
42 # include <sys/time.h>
43 # include <sys/resource.h>
44 #endif
45 
46 #include "find-module.h"
47 #include "find-module_gui.h"
48 int
main(int argc,char * argv[])49 main (int argc, char *argv[]) {
50 #if GTK_MAJOR_VERSION==2
51     if (rfm_gtk_version() != 2)
52 #else
53     if (rfm_gtk_version() != 3)
54 #endif
55 	g_error("Critical error. Librfm is compiled for gtk+%d.0 You need to reconfigure and compile to match gtk versions.\n", rfm_gtk_version());
56 
57 
58      if(!g_module_supported ()) {
59         g_error ("g_module_supported() != TRUE\n");
60         exit (1);
61     }
62      /***************************************************/
63     {
64         gchar *dir = g_strconcat ("rfm", G_DIR_SEPARATOR_S, "plugins", NULL);
65         rfm_set_plugin_dir(LIBDIR, dir);
66         g_free(dir);
67     }
68     /* start loading required dynamic libraries here... */
69 #ifdef ENABLE_NLS
70     /* this binds rfm domain: */
71     bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
72 
73     bindtextdomain ("librfm", PACKAGE_LOCALE_DIR);
74     bindtextdomain ("rodent", PACKAGE_LOCALE_DIR);
75 # ifdef HAVE_BIND_TEXTDOMAIN_CODESET
76     bind_textdomain_codeset ("librfm", "UTF-8");
77     bind_textdomain_codeset ("rodent", "UTF-8");
78 # endif
79 # ifdef HAVE_BIND_TEXTDOMAIN_CODESET
80     TRACE ("binding %s, at %s", GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
81     bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
82 # endif
83 #endif
84     /* g_thread_supported is geeky. returns true if g_threads are already
85      * initialized, not whether they are supported on the current platform! */
86     if(!g_thread_supported ())
87         rfm_thread_init (NULL);
88     rfm_init();
89     rodent_init();
90 
91     TRACE ("call to setlocale");
92     setlocale (LC_ALL, "");
93     TRACE ("call to gtk_init");
94     gtk_init (&argc, &argv);
95 
96     do_find_standalone(argv[1]);
97     //rfm_natural(RFM_MODULE_DIR, "fgr", argv[1], "do_find_standalone");
98 
99 
100     //gtk_main ();
101     return 0;
102 }
103