Example #1
0
int main(int argc, char *argv[])
{
#ifdef DEBUG
	gtk_init(&argc, &argv);
	gtk_gl_init(&argc, &argv);
#else
	gtk_init(NULL, NULL);
	gtk_gl_init(NULL, NULL);
#endif

	setup_splash();
	splash("Starting up...");

	// Init logfile
	FILE* f = fopen("slade.log", "wt");
	fclose(f);

	load_main_config();

	init_console();
	setup_icons();

	log_message("Init textures...\n");
	init_textures();

	log_message("Loading colour configurations...\n");
	load_colour_configs();
	string ccfg = col_config;
	set_colour_config(ccfg);

	log_message("Setup editor window...\n");
	setup_editor_window();
	log_message("Setup wad manager window...\n");

	splash_hide();

	setup_main_window();
	log_message("Init OK.\n");

	open_main_window();

	// Setup gl font
	//font_list = glGenLists(256);
	//PangoFontDescription *font_desc = pango_font_description_from_string("Monospace 10");
	//gdk_gl_font_use_pango_font(font_desc, 0, 255, font_list);

	gtk_main();
	
	save_main_config();

	return 0;
}
Example #2
0
static void
um_user_panel_init (UmUserPanel *self)
{
        UmUserPanelPrivate *d;
        GError *error;
        volatile GType type G_GNUC_UNUSED;
        const gchar *filename;
        GtkWidget *button;
        GtkStyleContext *context;

        d = self->priv = UM_USER_PANEL_PRIVATE (self);

        /* register types that the builder might need */
        type = cc_strength_bar_get_type ();
        type = um_editable_button_get_type ();
        type = cc_editable_entry_get_type ();
        type = um_editable_combo_get_type ();

        gtk_widget_set_size_request (GTK_WIDGET (self), -1, 350);

        d->builder = gtk_builder_new ();
        d->um = um_user_manager_ref_default ();

        filename = UIDIR "/user-accounts-dialog.ui";
        if (!g_file_test (filename, G_FILE_TEST_EXISTS)) {
                filename = "data/user-accounts-dialog.ui";
        }
        error = NULL;
        if (!gtk_builder_add_from_file (d->builder, filename, &error)) {
                g_error ("%s", error->message);
                g_error_free (error);
                return;
        }

        setup_main_window (d);
        d->account_dialog = um_account_dialog_new ();
        d->password_dialog = um_password_dialog_new ();
        button = get_widget (d, "user-icon-button");
        d->photo_dialog = um_photo_dialog_new (button);
        d->main_box = get_widget (d, "accounts-vbox");
        gtk_widget_reparent (d->main_box, GTK_WIDGET (self));

        context = gtk_widget_get_style_context (get_widget (d, "list-scrolledwindow"));
        gtk_style_context_set_junction_sides (context, GTK_JUNCTION_BOTTOM);
        context = gtk_widget_get_style_context (get_widget (d, "add-remove-toolbar"));
        gtk_style_context_set_junction_sides (context, GTK_JUNCTION_TOP);
}
Example #3
0
int main(int argc, char *argv[])
{
	gtk_init(&argc, &argv);
	setup_splash();
	splash("Starting up...");
	//gtk_gl_init(&argc, &argv);

	// Init logfile
	FILE* f = fopen("slade.log", "wt");
	fclose(f);

	load_main_config();

	init_console();
	setup_icons();
	init_textures();

	load_colour_configs();
	string ccfg = col_config;
	set_colour_config(ccfg);

	setup_editor_window();
	setup_main_window();
	open_main_window();

	// Setup gl font
	//font_list = glGenLists(256);
	//PangoFontDescription *font_desc = pango_font_description_from_string("Monospace 10");
	//gdk_gl_font_use_pango_font(font_desc, 0, 255, font_list);

	splash_hide();

	gtk_main();
	
	save_main_config();

	return 0;
}
Example #4
0
static void setup_app(void) {
  setup_main_window();
}
Example #5
0
bool os_initialize( application_t* app )
{
    //
    // We only need to set the resource path on Windows. There are no
    // system events to install handlers for, etc. We say that the
    // resource path is the folder with the executable inside.
    //

    LPWSTR *szArglist;
    int nArgs;

    szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
    if( NULL == szArglist )
      throw std::runtime_error("CommandLineToArgvW failed");


    std::string directory_string;

    if (!hackery::LPCWSTR_to_string(szArglist[0], directory_string))
        throw std::runtime_error("Path character conversion failed.");

    std::string file1;

    if (nArgs >= 2 && !hackery::LPCWSTR_to_string(szArglist[1], file1))
        throw std::runtime_error("Path character conversion failed.");

    std::string file2;

    if (nArgs >= 3 && !hackery::LPCWSTR_to_string(szArglist[2], file2))
        throw std::runtime_error("Path character conversion failed.");

    clip_quotes(directory_string);

    //
    // Now we need to get a directory from the command line name.
    //
    boost::filesystem::path directory( directory_string, boost::filesystem::native );

    //
    // Tell the application...
    //
    app->set_resource_directory( directory.branch_path() );

    setup_main_window( app );

    if (!file1.empty())
    {
        clip_quotes(file1);
        open_document(app, file1);
    }

    if (!file2.empty())
    {
        clip_quotes(file2);
        open_document(app, file2);
    }

    LocalFree(szArglist);

    return true;
}