All pastes #958595 Raw Edit

Mine

public text v1 · immutable
#958595 ·published 2008-03-26 20:37 UTC
rendered paste body
/*
 *      main.c
 *      
 *      Copyright 2008 warren <wardubmc@gmail.com>
 *      
 *      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.
 *      
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *      
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */

#include <stdlib.h>

#include <gtk/gtk.h>
#include <glib/gi18n.h>

/* Set first wizard */
int CurrentWizard = 1;

#include "functions.h"

int main(int argc, char **argv)
{
	/* Load gtk */
	gtk_init(&argc, &argv);
	
	/* Get temp directory */
	const gchar *TmpDirectory = g_get_tmp_dir();
	
	/* Create main window */
	GtkWidget *pMainWindow;
	pMainWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_window_set_default_size(GTK_WINDOW(pMainWindow), 0, 0);
	gtk_window_set_title(GTK_WINDOW(pMainWindow), "ET Open Config Generator");
	gtk_window_set_resizable(GTK_WINDOW(pMainWindow), FALSE);

	/* Set default icon to all windows */
	gtk_window_set_default_icon_from_file("./icons/etocg.png", NULL);

	/* Create vertical box */
	GtkWidget *pVerticalBox;
	pVerticalBox = gtk_vbox_new(FALSE, 0);
	gtk_container_add(GTK_CONTAINER(pMainWindow), pVerticalBox);

	/* Create horizontal box */
	GtkWidget *pHorizontalBox;
	pHorizontalBox = gtk_hbox_new(FALSE, 0);
	gtk_box_pack_start_defaults(GTK_BOX(pVerticalBox), pHorizontalBox);

	/* Create banner */
	GtkWidget *pBannerImage;
	pBannerImage = gtk_image_new_from_file("./images/banner.png");
	gtk_box_pack_start_defaults(GTK_BOX(pHorizontalBox), pBannerImage);

	/* Create horizontal box */
	GtkWidget *pHorizontalBox2;
	pHorizontalBox2 = gtk_hbox_new(FALSE, 0);
	gtk_box_pack_start(GTK_BOX(pVerticalBox), pHorizontalBox2, 1, 1, 0);

	/* Create horizontal box */
	GtkWidget *pHorizontalBox3;
	pHorizontalBox3 = gtk_hbox_new(FALSE, 0);
	gtk_box_pack_start(GTK_BOX(pVerticalBox), pHorizontalBox3, 0, 0, 0);

	/* Create progress bar */
	GtkWidget *pProgressProgressBar;
	pProgressProgressBar = gtk_progress_bar_new();
	gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(pProgressProgressBar), GTK_PROGRESS_LEFT_TO_RIGHT);
	gtk_box_pack_start(GTK_BOX(pHorizontalBox3), pProgressProgressBar, TRUE, TRUE, 0);
	
	/* Create horizontal box */
	GtkWidget *pHorizontalBox4;
	pHorizontalBox4 = gtk_hbox_new(FALSE, 0);
	gtk_box_pack_start(GTK_BOX(pVerticalBox), pHorizontalBox4, 0, 0, 0);

	/* Create buttons */
	GtkWidget *pAboutButton; GtkWidget *pNextButton; GtkWidget *pSaveAsButton; GtkWidget *pQuitButton;
	pSaveAsButton = gtk_button_new_from_stock(GTK_STOCK_SAVE_AS);
	gtk_box_pack_start_defaults(GTK_BOX(pHorizontalBox4), pSaveAsButton);	
	pNextButton = gtk_button_new_from_stock(GTK_STOCK_GO_FORWARD);
	gtk_box_pack_start_defaults(GTK_BOX(pHorizontalBox4), pNextButton);
	pAboutButton = gtk_button_new_from_stock(GTK_STOCK_ABOUT);	
	gtk_box_pack_start_defaults(GTK_BOX(pHorizontalBox4), pAboutButton);
	pQuitButton = gtk_button_new_from_stock(GTK_STOCK_QUIT);
	gtk_box_pack_start_defaults(GTK_BOX(pHorizontalBox4), pQuitButton);		

	/* Spacings */
	gtk_box_set_spacing(GTK_BOX(pHorizontalBox), 10);
	gtk_box_set_spacing(GTK_BOX(pHorizontalBox2), 10);
	gtk_box_set_spacing(GTK_BOX(pHorizontalBox3), 10);
	gtk_box_set_spacing(GTK_BOX(pHorizontalBox4), 10);
	gtk_box_set_spacing(GTK_BOX(pVerticalBox), 10);

	/* Wizards */
	#include "wizard01.c"
	#include "wizard02a.c"
	
	/* Default values */
	#include "values.c"
		
	/* Signals */
	#include "signals.c"
	
	/* Show main window */
	gtk_widget_show_all(pMainWindow);	
	
	/* Main */
	gtk_main();
	return EXIT_SUCCESS;
}