medit/tests/medit.c.in

53 lines
1.6 KiB
C

/*
* tests/medit.c.in
*
* Copyright (C) 2004-2005 by Yevgen Muntyan <muntyan@math.tamu.edu>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* See COPYING file that comes with this distribution.
*/
#line 14 "@srcdir@/medit.c.in"
#include "mooedit/mooeditor.h"
#include "mooedit/mooeditlangmgr.h"
#include "mooui/moouiobject.h"
int main (int argc, char **argv)
{
char *rcfile;
MooEditor *editor;
MooEditLangMgr *mgr;
MooEditWindow *win;
MooUIXML *xml;
gtk_init (&argc, &argv);
rcfile = g_build_filename (g_get_home_dir (), ".meditrc", NULL);
moo_prefs_load (rcfile);
editor = moo_editor_new ();
mgr = moo_editor_get_lang_mgr (editor);
moo_edit_lang_mgr_add_lang_files_dir (mgr, "/usr/share/gtksourceview-1.0/language-specs");
moo_edit_lang_mgr_add_lang_files_dir (mgr, "@MOO_EDIT_LANG_FILES_DIR@");
g_signal_connect (editor, "all-windows-closed", G_CALLBACK (gtk_main_quit), NULL);
win = moo_editor_new_window (editor);
xml = moo_ui_object_get_ui_xml (MOO_UI_OBJECT (win));
if (!moo_ui_xml_add_ui_from_file (xml, "@srcdir@/meditui.xml", NULL))
if (!moo_ui_xml_add_ui_from_file (xml, "meditui.xml", NULL))
g_error ("could not find medui.xml");
if (argc > 1) moo_edit_window_open (MOO_EDIT_WINDOW (win), argv[1], NULL);
gtk_main ();
moo_prefs_save (rcfile);
g_free (rcfile);
}