File: main.c

package info (click to toggle)
diasce 1.0.5-1.1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,964 kB
  • ctags: 1,732
  • sloc: ansic: 26,805; sh: 2,999; makefile: 399; yacc: 318
file content (108 lines) | stat: -rw-r--r-- 2,934 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/*
 * DiaSCE is a code editor for C and C++.
 * Copyright (C) 2000  Ander Lozano P�rez
 *
 * 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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Ander Lozano P�rez
 * c/Juan de Gardeazabal 4, 1� D
 * 48004 Bilbao
 * Vizcaya
 * Spain
 *
 * ander1@wanadoo.es
 */

/*
 * Initial main.c file generated by Glade. Edit as required.
 * Glade will not overwrite this file.
 */

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif
#include <gnome.h>

#include "interface.h"
#include "support.h"
#include "main.h"

int
main (int argc, char *argv[],char *envp[])
{
	gint estado;

	estado=0;
	pro_forzando_librerias=FALSE;
	bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR);
	textdomain (PACKAGE);

	gnome_init ("diasce", VERSION, argc, argv);
	
	signal(SIGCHLD,(void *)gen_hijo_muerto);

	ventana_inicio=create_autodetect_ventana();
	gtk_widget_show(ventana_inicio);
	gtk_idle_add(david_init,&estado);

	gtk_main ();
	return 0;
}

gboolean david_init(gpointer estado)
{
	GtkWidget *scrolledwindow;

	if ((*(guint*)estado)==0) {
		autoconfiguracion=0;
		pro_inicializar();
		edit_inicializar();
		edit_inicializar_coloreado();
		buscar_inicializar();
	}
	
	pref_abrir((*(guint*)estado));

	if ((*(guint*)estado)==ULTIMA_FASE_AUTODETECCION) {
		david_ventana = create_david_ventana ();

		g_set_printerr_handler((GPrintFunc) gen_mensajes_stderr);
		g_set_print_handler((GPrintFunc) gen_mensajes_stdout);

		pix_inicializar();
		cefv_inicializar();

		edit_editor=GTK_EXTEXT(lookup_widget(david_ventana,"editor_texto"));
		edit_funciones=GTK_EXTEXT(lookup_widget(david_ventana,"funciones_texto"));
		gtk_editable_set_editable(GTK_EDITABLE(edit_editor),FALSE);
		gtk_editable_set_editable(GTK_EDITABLE(edit_funciones),FALSE);
		scrolledwindow=lookup_widget(david_ventana,"scrolledwindow5");
		edit_editor->vadj=GTK_VSCROLLBAR(GTK_SCROLLED_WINDOW(scrolledwindow)->vscrollbar)->scrollbar.range.adjustment;
		edit_editor->hadj=GTK_HSCROLLBAR(GTK_SCROLLED_WINDOW(scrolledwindow)->hscrollbar)->scrollbar.range.adjustment;
		pref_aplicar();
		gen_anular_funciones();
          /*A�adimos a los menus los ultimos proyectos abiertos*/
          gen_ultimos_proyectos();

		gen_localizar_automake();

		gtk_widget_show (david_ventana);
		
		return FALSE;
	}
	
	(*(guint*)estado)++;
	return TRUE;
}