SF.net SVN: geany: [1194] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Mon Jan 15 18:12:32 UTC 2007


Revision: 1194
          http://svn.sourceforge.net/geany/?rev=1194&view=rev
Author:   eht16
Date:     2007-01-15 10:12:32 -0800 (Mon, 15 Jan 2007)

Log Message:
-----------
Started to implement project management (still unusable).
Added project.[c|h].

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/geany.glade
    trunk/po/POTFILES.in
    trunk/src/Makefile.am
    trunk/src/callbacks.c
    trunk/src/callbacks.h
    trunk/src/geany.h
    trunk/src/interface.c
    trunk/src/main.c
    trunk/src/makefile.win32

Added Paths:
-----------
    trunk/src/project.c
    trunk/src/project.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-01-15 16:13:36 UTC (rev 1193)
+++ trunk/ChangeLog	2007-01-15 18:12:32 UTC (rev 1194)
@@ -4,6 +4,11 @@
    Fixed changing directories when the path contains whitespace.
  * src/callbacks.c: When using Save As the returned filename needs to be
                     converted into UTF-8.
+ * geany.glade, po/POTFILES.in, src/callbacks.c, src/callbacks.h,
+   src/geany.h, src/interface.c, src/main.c, src/makefile.win32,
+   src/Makefile.am, src/project.c, src/project.h:
+   Started to implement project management (still unusable).
+   Added project.[c|h].
 
 
 2007-01-15  Nick Treleaven  <nick.treleaven at btinternet.com>

Modified: trunk/geany.glade
===================================================================
--- trunk/geany.glade	2007-01-15 16:13:36 UTC (rev 1193)
+++ trunk/geany.glade	2007-01-15 18:12:32 UTC (rev 1194)
@@ -57,7 +57,7 @@
 		      <property name="use_underline">True</property>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image1381">
+			<widget class="GtkImage" id="image1412">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-new</property>
 			  <property name="icon_size">1</property>
@@ -138,7 +138,7 @@
 		      <signal name="activate" handler="on_save_all1_activate" last_modification_time="Thu, 02 Jun 2005 14:15:30 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image1382">
+			<widget class="GtkImage" id="image1413">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-save</property>
 			  <property name="icon_size">1</property>
@@ -159,7 +159,7 @@
 		      <signal name="activate" handler="on_toolbutton23_clicked" last_modification_time="Mon, 24 Jul 2006 19:26:04 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image1383">
+			<widget class="GtkImage" id="image1414">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-revert-to-saved</property>
 			  <property name="icon_size">1</property>
@@ -179,7 +179,7 @@
 		      <property name="use_underline">True</property>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image1384">
+			<widget class="GtkImage" id="image1415">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-revert-to-saved</property>
 			  <property name="icon_size">1</property>
@@ -259,7 +259,7 @@
 		      <signal name="activate" handler="on_close_all1_activate" last_modification_time="Thu, 02 Jun 2005 14:15:30 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image1385">
+			<widget class="GtkImage" id="image1416">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-close</property>
 			  <property name="icon_size">1</property>
@@ -467,7 +467,7 @@
 			      <signal name="activate" handler="on_menu_increase_indent1_activate" last_modification_time="Tue, 01 Aug 2006 10:28:54 GMT"/>
 
 			      <child internal-child="image">
-				<widget class="GtkImage" id="image1386">
+				<widget class="GtkImage" id="image1417">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-indent</property>
 				  <property name="icon_size">1</property>
@@ -488,7 +488,7 @@
 			      <signal name="activate" handler="on_menu_decrease_indent1_activate" last_modification_time="Tue, 01 Aug 2006 10:28:54 GMT"/>
 
 			      <child internal-child="image">
-				<widget class="GtkImage" id="image1387">
+				<widget class="GtkImage" id="image1418">
 				  <property name="visible">True</property>
 				  <property name="stock">gtk-unindent</property>
 				  <property name="icon_size">1</property>
@@ -518,7 +518,7 @@
 		      <property name="use_underline">True</property>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image1388">
+			<widget class="GtkImage" id="image1419">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-add</property>
 			  <property name="icon_size">1</property>
@@ -550,7 +550,7 @@
 		      <property name="use_underline">True</property>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image1389">
+			<widget class="GtkImage" id="image1420">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-add</property>
 			  <property name="icon_size">1</property>
@@ -720,7 +720,7 @@
 		      <signal name="activate" handler="on_replace1_activate" last_modification_time="Sun, 23 Oct 2005 13:22:36 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image1390">
+			<widget class="GtkImage" id="image1421">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-find-and-replace</property>
 			  <property name="icon_size">1</property>
@@ -762,7 +762,7 @@
 		      <signal name="activate" handler="on_go_to_line1_activate" last_modification_time="Tue, 23 May 2006 17:10:49 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image1391">
+			<widget class="GtkImage" id="image1422">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-jump-to</property>
 			  <property name="icon_size">1</property>
@@ -797,7 +797,7 @@
 		      <signal name="activate" handler="on_change_font1_activate" last_modification_time="Fri, 22 Apr 2005 18:58:45 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image1392">
+			<widget class="GtkImage" id="image1423">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-select-font</property>
 			  <property name="icon_size">1</property>
@@ -1122,6 +1122,62 @@
 	  </child>
 
 	  <child>
+	    <widget class="GtkMenuItem" id="menu_project1">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">_Project</property>
+	      <property name="use_underline">True</property>
+	      <signal name="activate" handler="on_menu_project1_activate" last_modification_time="Mon, 15 Jan 2007 18:01:10 GMT"/>
+
+	      <child>
+		<widget class="GtkMenu" id="menu_project1_menu">
+
+		  <child>
+		    <widget class="GtkImageMenuItem" id="project_new1">
+		      <property name="visible">True</property>
+		      <property name="label">gtk-new</property>
+		      <property name="use_stock">True</property>
+		      <signal name="activate" handler="on_project_new1_activate" last_modification_time="Mon, 15 Jan 2007 17:34:17 GMT"/>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkImageMenuItem" id="project_open1">
+		      <property name="visible">True</property>
+		      <property name="label">gtk-open</property>
+		      <property name="use_stock">True</property>
+		      <signal name="activate" handler="on_project_open1_activate" last_modification_time="Mon, 15 Jan 2007 17:34:17 GMT"/>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkImageMenuItem" id="project_close1">
+		      <property name="visible">True</property>
+		      <property name="label">gtk-close</property>
+		      <property name="use_stock">True</property>
+		      <signal name="activate" handler="on_project_close1_activate" last_modification_time="Mon, 15 Jan 2007 17:34:17 GMT"/>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkSeparatorMenuItem" id="separator34">
+		      <property name="visible">True</property>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkImageMenuItem" id="project_properties1">
+		      <property name="visible">True</property>
+		      <property name="label">gtk-properties</property>
+		      <property name="use_stock">True</property>
+		      <signal name="activate" handler="on_project_properties1_activate" last_modification_time="Mon, 15 Jan 2007 17:34:17 GMT"/>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
+	    </widget>
+	  </child>
+
+	  <child>
 	    <widget class="GtkMenuItem" id="menu_build1">
 	      <property name="visible">True</property>
 	      <property name="label" translatable="yes">_Build</property>
@@ -1147,7 +1203,7 @@
 		      <signal name="activate" handler="on_show_color_chooser1_activate" last_modification_time="Wed, 22 Jun 2005 18:10:21 GMT"/>
 
 		      <child internal-child="image">
-			<widget class="GtkImage" id="image1393">
+			<widget class="GtkImage" id="image1424">
 			  <property name="visible">True</property>
 			  <property name="stock">gtk-select-color</property>
 			  <property name="icon_size">1</property>

Modified: trunk/po/POTFILES.in
===================================================================
--- trunk/po/POTFILES.in	2007-01-15 16:13:36 UTC (rev 1193)
+++ trunk/po/POTFILES.in	2007-01-15 18:12:32 UTC (rev 1194)
@@ -17,6 +17,7 @@
 src/msgwindow.c
 src/notebook.c
 src/prefs.c
+src/project.c
 src/sci_cb.c
 src/sciwrappers.c
 src/search.c

Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am	2007-01-15 16:13:36 UTC (rev 1193)
+++ trunk/src/Makefile.am	2007-01-15 18:12:32 UTC (rev 1194)
@@ -7,35 +7,35 @@
 bin_PROGRAMS = geany
 
 SRCS = \
-	main.c main.h geany.h \
-	symbols.c symbols.h \
-	search.c search.h \
-	notebook.c notebook.h \
-	keybindings.c keybindings.h \
-	templates.c templates.h \
-	treeviews.c treeviews.h \
 	about.c about.h \
+	build.c build.h \
+	callbacks.c callbacks.h \
+	dialogs.c dialogs.h \
+	document.c document.h \
 	encodings.c encodings.h \
+	filetypes.c filetypes.h \
+	highlighting.c highlighting.h \
+	interface.c interface.h \
+	keybindings.c keybindings.h \
 	keyfile.c keyfile.h \
+	main.c main.h geany.h \
+	msgwindow.c msgwindow.h \
+	notebook.c notebook.h \
 	prefs.c prefs.h \
-	dialogs.c dialogs.h \
-	msgwindow.c msgwindow.h \
-	build.c build.h \
-	filetypes.c filetypes.h \
-	highlighting.c highlighting.h \
+	project.c project.h \
 	sci_cb.c sci_cb.h \
 	sciwrappers.c sciwrappers.h \
-	document.c document.h \
+	search.c search.h \
 	socket.c socket.h \
+	support.c support.h \
+	symbols.c symbols.h \
+	templates.c templates.h \
 	tools.c tools.h \
-	utils.c utils.h \
+	treeviews.c treeviews.h \
 	ui_utils.c ui_utils.h \
-	support.c support.h \
-	interface.c interface.h \
-	callbacks.c callbacks.h
+	utils.c utils.h
 
 
-
 if MINGW
 # build Geany for Windows
 WINDRES = /usr/local/cross-tools/bin/i386-mingw32msvc-windres

Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c	2007-01-15 16:13:36 UTC (rev 1193)
+++ trunk/src/callbacks.c	2007-01-15 18:12:32 UTC (rev 1194)
@@ -53,6 +53,7 @@
 #include "main.h"
 #include "symbols.h"
 #include "tools.h"
+#include "project.h"
 
 #ifdef HAVE_VTE
 # include "vte.h"
@@ -2077,3 +2078,53 @@
 
 
 
+
+void
+on_project_new1_activate               (GtkMenuItem     *menuitem,
+                                        gpointer         user_data)
+{
+	project_new();
+}
+
+
+void
+on_project_open1_activate              (GtkMenuItem     *menuitem,
+                                        gpointer         user_data)
+{
+	project_open();
+}
+
+
+void
+on_project_close1_activate             (GtkMenuItem     *menuitem,
+                                        gpointer         user_data)
+{
+	project_close();
+}
+
+
+void
+on_project_properties1_activate        (GtkMenuItem     *menuitem,
+                                        gpointer         user_data)
+{
+	project_properties();
+}
+
+
+void
+on_menu_project1_activate              (GtkMenuItem     *menuitem,
+                                        gpointer         user_data)
+{
+	static GtkWidget *item_close= NULL;
+	static GtkWidget *item_properties= NULL;
+
+	if (item_close == NULL)
+	{
+		item_close = lookup_widget(app->window, "project_close1");
+		item_properties = lookup_widget(app->window, "project_properties1");
+	}
+
+	gtk_widget_set_sensitive(item_close, (app->project != NULL));
+	gtk_widget_set_sensitive(item_properties, (app->project != NULL));
+}
+

Modified: trunk/src/callbacks.h
===================================================================
--- trunk/src/callbacks.h	2007-01-15 16:13:36 UTC (rev 1193)
+++ trunk/src/callbacks.h	2007-01-15 18:12:32 UTC (rev 1194)
@@ -571,3 +571,23 @@
 void
 on_comments_bsd_activate               (GtkMenuItem     *menuitem,
                                         gpointer         user_data);
+
+void
+on_project_new1_activate               (GtkMenuItem     *menuitem,
+                                        gpointer         user_data);
+
+void
+on_project_open1_activate              (GtkMenuItem     *menuitem,
+                                        gpointer         user_data);
+
+void
+on_project_close1_activate             (GtkMenuItem     *menuitem,
+                                        gpointer         user_data);
+
+void
+on_project_properties1_activate        (GtkMenuItem     *menuitem,
+                                        gpointer         user_data);
+
+void
+on_menu_project1_activate              (GtkMenuItem     *menuitem,
+                                        gpointer         user_data);

Modified: trunk/src/geany.h
===================================================================
--- trunk/src/geany.h	2007-01-15 16:13:36 UTC (rev 1193)
+++ trunk/src/geany.h	2007-01-15 18:12:32 UTC (rev 1194)
@@ -69,6 +69,10 @@
 
 
 
+// simple forward declaration to avoid unnecessary inclusion of project.h
+typedef struct _GeanyProject GeanyProject;
+
+
 /* store some pointers and variables for frequently used widgets  */
 typedef struct MyApp
 {
@@ -184,6 +188,7 @@
 	GtkWidget			*default_tag_tree;
 	const TMWorkspace	*tm_workspace;
 	GQueue				*recent_queue;
+	GeanyProject		*project; // currently active project or NULL if none is open
 } MyApp;
 
 MyApp *app;

Modified: trunk/src/interface.c
===================================================================
--- trunk/src/interface.c	2007-01-15 16:13:36 UTC (rev 1193)
+++ trunk/src/interface.c	2007-01-15 18:12:32 UTC (rev 1194)
@@ -37,7 +37,7 @@
   GtkWidget *menuitem1_menu;
   GtkWidget *menu_new1;
   GtkWidget *menu_new_with_template1;
-  GtkWidget *image1381;
+  GtkWidget *image1412;
   GtkWidget *menu_new_with_template1_menu;
   GtkWidget *invisible2;
   GtkWidget *separator12;
@@ -47,11 +47,11 @@
   GtkWidget *menu_save1;
   GtkWidget *menu_save_as1;
   GtkWidget *menu_save_all1;
-  GtkWidget *image1382;
+  GtkWidget *image1413;
   GtkWidget *menu_reload1;
-  GtkWidget *image1383;
+  GtkWidget *image1414;
   GtkWidget *menu_reload_as1;
-  GtkWidget *image1384;
+  GtkWidget *image1415;
   GtkWidget *menu_reload_as1_menu;
   GtkWidget *invisible7;
   GtkWidget *separator21;
@@ -61,7 +61,7 @@
   GtkWidget *separator14;
   GtkWidget *menu_close1;
   GtkWidget *menu_close_all1;
-  GtkWidget *image1385;
+  GtkWidget *image1416;
   GtkWidget *menu_separatormenuitem1;
   GtkWidget *menu_quit1;
   GtkWidget *edit1;
@@ -87,16 +87,16 @@
   GtkWidget *menu_duplicate_line1;
   GtkWidget *separator29;
   GtkWidget *menu_increase_indent1;
-  GtkWidget *image1386;
+  GtkWidget *image1417;
   GtkWidget *menu_decrease_indent1;
-  GtkWidget *image1387;
+  GtkWidget *image1418;
   GtkWidget *separator18;
   GtkWidget *insert_include2;
-  GtkWidget *image1388;
+  GtkWidget *image1419;
   GtkWidget *insert_include2_menu;
   GtkWidget *invisible4;
   GtkWidget *add_comments1;
-  GtkWidget *image1389;
+  GtkWidget *image1420;
   GtkWidget *add_comments1_menu;
   GtkWidget *menu_add_changelog_entry1;
   GtkWidget *insert_file_header1;
@@ -116,16 +116,16 @@
   GtkWidget *find_previous1;
   GtkWidget *find_in_files1;
   GtkWidget *replace1;
-  GtkWidget *image1390;
+  GtkWidget *image1421;
   GtkWidget *separator33;
   GtkWidget *next_message1;
   GtkWidget *separator32;
   GtkWidget *go_to_line1;
-  GtkWidget *image1391;
+  GtkWidget *image1422;
   GtkWidget *menuitem3;
   GtkWidget *menuitem3_menu;
   GtkWidget *menu_change_font1;
-  GtkWidget *image1392;
+  GtkWidget *image1423;
   GtkWidget *menu_separator4;
   GtkWidget *menu_fullscreen1;
   GtkWidget *menu_show_messages_window1;
@@ -163,11 +163,18 @@
   GtkWidget *menu_unfold_all1;
   GtkWidget *separator23;
   GtkWidget *menu_remove_indicators1;
+  GtkWidget *menu_project1;
+  GtkWidget *menu_project1_menu;
+  GtkWidget *project_new1;
+  GtkWidget *project_open1;
+  GtkWidget *project_close1;
+  GtkWidget *separator34;
+  GtkWidget *project_properties1;
   GtkWidget *menu_build1;
   GtkWidget *tools1;
   GtkWidget *tools1_menu;
   GtkWidget *menu_choose_color1;
-  GtkWidget *image1393;
+  GtkWidget *image1424;
   GtkWidget *menu_count_words1;
   GtkWidget *menu_insert_special_chars1;
   GtkWidget *menu_item5;
@@ -268,9 +275,9 @@
   gtk_widget_show (menu_new_with_template1);
   gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_new_with_template1);
 
-  image1381 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU);
-  gtk_widget_show (image1381);
-  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_new_with_template1), image1381);
+  image1412 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU);
+  gtk_widget_show (image1412);
+  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_new_with_template1), image1412);
 
   menu_new_with_template1_menu = gtk_menu_new ();
   gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_new_with_template1), menu_new_with_template1_menu);
@@ -309,25 +316,25 @@
   gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_save_all1);
   gtk_tooltips_set_tip (tooltips, menu_save_all1, _("Saves all open files"), NULL);
 
-  image1382 = gtk_image_new_from_stock ("gtk-save", GTK_ICON_SIZE_MENU);
-  gtk_widget_show (image1382);
-  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_save_all1), image1382);
+  image1413 = gtk_image_new_from_stock ("gtk-save", GTK_ICON_SIZE_MENU);
+  gtk_widget_show (image1413);
+  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_save_all1), image1413);
 
   menu_reload1 = gtk_image_menu_item_new_with_mnemonic (_("_Reload"));
   gtk_widget_show (menu_reload1);
   gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_reload1);
 
-  image1383 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU);
-  gtk_widget_show (image1383);
-  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload1), image1383);
+  image1414 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU);
+  gtk_widget_show (image1414);
+  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload1), image1414);
 
   menu_reload_as1 = gtk_image_menu_item_new_with_mnemonic (_("R_eload As"));
   gtk_widget_show (menu_reload_as1);
   gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_reload_as1);
 
-  image1384 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU);
-  gtk_widget_show (image1384);
-  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload_as1), image1384);
+  image1415 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU);
+  gtk_widget_show (image1415);
+  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload_as1), image1415);
 
   menu_reload_as1_menu = gtk_menu_new ();
   gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_reload_as1), menu_reload_as1_menu);
@@ -368,9 +375,9 @@
   gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_close_all1);
   gtk_tooltips_set_tip (tooltips, menu_close_all1, _("Closes all open files"), NULL);
 
-  image1385 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU);
-  gtk_widget_show (image1385);
-  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_close_all1), image1385);
+  image1416 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU);
+  gtk_widget_show (image1416);
+  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_close_all1), image1416);
 
   menu_separatormenuitem1 = gtk_separator_menu_item_new ();
   gtk_widget_show (menu_separatormenuitem1);
@@ -478,17 +485,17 @@
   gtk_widget_show (menu_increase_indent1);
   gtk_container_add (GTK_CONTAINER (menu_format1_menu), menu_increase_indent1);
 
-  image1386 = gtk_image_new_from_stock ("gtk-indent", GTK_ICON_SIZE_MENU);
-  gtk_widget_show (image1386);
-  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_increase_indent1), image1386);
+  image1417 = gtk_image_new_from_stock ("gtk-indent", GTK_ICON_SIZE_MENU);
+  gtk_widget_show (image1417);
+  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_increase_indent1), image1417);
 
   menu_decrease_indent1 = gtk_image_menu_item_new_with_mnemonic (_("_Decrease Indent"));
   gtk_widget_show (menu_decrease_indent1);
   gtk_container_add (GTK_CONTAINER (menu_format1_menu), menu_decrease_indent1);
 
-  image1387 = gtk_image_new_from_stock ("gtk-unindent", GTK_ICON_SIZE_MENU);
-  gtk_widget_show (image1387);
-  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_decrease_indent1), image1387);
+  image1418 = gtk_image_new_from_stock ("gtk-unindent", GTK_ICON_SIZE_MENU);
+  gtk_widget_show (image1418);
+  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_decrease_indent1), image1418);
 
   separator18 = gtk_separator_menu_item_new ();
   gtk_widget_show (separator18);
@@ -499,9 +506,9 @@
   gtk_widget_show (insert_include2);
   gtk_container_add (GTK_CONTAINER (edit1_menu), insert_include2);
 
-  image1388 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
-  gtk_widget_show (image1388);
-  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include2), image1388);
+  image1419 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
+  gtk_widget_show (image1419);
+  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include2), image1419);
 
   insert_include2_menu = gtk_menu_new ();
   gtk_menu_item_set_submenu (GTK_MENU_ITEM (insert_include2), insert_include2_menu);
@@ -513,9 +520,9 @@
   gtk_widget_show (add_comments1);
   gtk_container_add (GTK_CONTAINER (edit1_menu), add_comments1);
 
-  image1389 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
-  gtk_widget_show (image1389);
-  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_comments1), image1389);
+  image1420 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU);
+  gtk_widget_show (image1420);
+  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_comments1), image1420);
 
   add_comments1_menu = gtk_menu_new ();
   gtk_menu_item_set_submenu (GTK_MENU_ITEM (add_comments1), add_comments1_menu);
@@ -596,9 +603,9 @@
   gtk_widget_show (replace1);
   gtk_container_add (GTK_CONTAINER (search1_menu), replace1);
 
-  image1390 = gtk_image_new_from_stock ("gtk-find-and-replace", GTK_ICON_SIZE_MENU);
-  gtk_widget_show (image1390);
-  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (replace1), image1390);
+  image1421 = gtk_image_new_from_stock ("gtk-find-and-replace", GTK_ICON_SIZE_MENU);
+  gtk_widget_show (image1421);
+  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (replace1), image1421);
 
   separator33 = gtk_separator_menu_item_new ();
   gtk_widget_show (separator33);
@@ -618,9 +625,9 @@
   gtk_widget_show (go_to_line1);
   gtk_container_add (GTK_CONTAINER (search1_menu), go_to_line1);
 
-  image1391 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU);
-  gtk_widget_show (image1391);
-  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (go_to_line1), image1391);
+  image1422 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU);
+  gtk_widget_show (image1422);
+  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (go_to_line1), image1422);
 
   menuitem3 = gtk_menu_item_new_with_mnemonic (_("_View"));
   gtk_widget_show (menuitem3);
@@ -634,9 +641,9 @@
   gtk_container_add (GTK_CONTAINER (menuitem3_menu), menu_change_font1);
   gtk_tooltips_set_tip (tooltips, menu_change_font1, _("Change the default font"), NULL);
 
-  image1392 = gtk_image_new_from_stock ("gtk-select-font", GTK_ICON_SIZE_MENU);
-  gtk_widget_show (image1392);
-  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_change_font1), image1392);
+  image1423 = gtk_image_new_from_stock ("gtk-select-font", GTK_ICON_SIZE_MENU);
+  gtk_widget_show (image1423);
+  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_change_font1), image1423);
 
   menu_separator4 = gtk_separator_menu_item_new ();
   gtk_widget_show (menu_separator4);
@@ -805,6 +812,34 @@
   gtk_container_add (GTK_CONTAINER (menu_item4_menu), menu_remove_indicators1);
   gtk_tooltips_set_tip (tooltips, menu_remove_indicators1, _("Removes all error indicators in the current document."), NULL);
 
+  menu_project1 = gtk_menu_item_new_with_mnemonic (_("_Project"));
+  gtk_widget_show (menu_project1);
+  gtk_container_add (GTK_CONTAINER (menubar1), menu_project1);
+
+  menu_project1_menu = gtk_menu_new ();
+  gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_project1), menu_project1_menu);
+
+  project_new1 = gtk_image_menu_item_new_from_stock ("gtk-new", accel_group);
+  gtk_widget_show (project_new1);
+  gtk_container_add (GTK_CONTAINER (menu_project1_menu), project_new1);
+
+  project_open1 = gtk_image_menu_item_new_from_stock ("gtk-open", accel_group);
+  gtk_widget_show (project_open1);
+  gtk_container_add (GTK_CONTAINER (menu_project1_menu), project_open1);
+
+  project_close1 = gtk_image_menu_item_new_from_stock ("gtk-close", accel_group);
+  gtk_widget_show (project_close1);
+  gtk_container_add (GTK_CONTAINER (menu_project1_menu), project_close1);
+
+  separator34 = gtk_separator_menu_item_new ();
+  gtk_widget_show (separator34);
+  gtk_container_add (GTK_CONTAINER (menu_project1_menu), separator34);
+  gtk_widget_set_sensitive (separator34, FALSE);
+
+  project_properties1 = gtk_image_menu_item_new_from_stock ("gtk-properties", accel_group);
+  gtk_widget_show (project_properties1);
+  gtk_container_add (GTK_CONTAINER (menu_project1_menu), project_properties1);
+
   menu_build1 = gtk_menu_item_new_with_mnemonic (_("_Build"));
   gtk_widget_show (menu_build1);
   gtk_container_add (GTK_CONTAINER (menubar1), menu_build1);
@@ -821,9 +856,9 @@
   gtk_container_add (GTK_CONTAINER (tools1_menu), menu_choose_color1);
   gtk_tooltips_set_tip (tooltips, menu_choose_color1, _("Open a color chooser dialog, to interactively pick colors from a palette."), NULL);
 
-  image1393 = gtk_image_new_from_stock ("gtk-select-color", GTK_ICON_SIZE_MENU);
-  gtk_widget_show (image1393);
-  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_choose_color1), image1393);
+  image1424 = gtk_image_new_from_stock ("gtk-select-color", GTK_ICON_SIZE_MENU);
+  gtk_widget_show (image1424);
+  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_choose_color1), image1424);
 
   menu_count_words1 = gtk_menu_item_new_with_mnemonic (_("_Word Count"));
   gtk_widget_show (menu_count_words1);
@@ -1321,6 +1356,21 @@
   g_signal_connect ((gpointer) menu_remove_indicators1, "activate",
                     G_CALLBACK (on_menu_remove_indicators1_activate),
                     NULL);
+  g_signal_connect ((gpointer) menu_project1, "activate",
+                    G_CALLBACK (on_menu_project1_activate),
+                    NULL);
+  g_signal_connect ((gpointer) project_new1, "activate",
+                    G_CALLBACK (on_project_new1_activate),
+                    NULL);
+  g_signal_connect ((gpointer) project_open1, "activate",
+                    G_CALLBACK (on_project_open1_activate),
+                    NULL);
+  g_signal_connect ((gpointer) project_close1, "activate",
+                    G_CALLBACK (on_project_close1_activate),
+                    NULL);
+  g_signal_connect ((gpointer) project_properties1, "activate",
+                    G_CALLBACK (on_project_properties1_activate),
+                    NULL);
   g_signal_connect ((gpointer) menu_choose_color1, "activate",
                     G_CALLBACK (on_show_color_chooser1_activate),
                     NULL);
@@ -1421,7 +1471,7 @@
   GLADE_HOOKUP_OBJECT (window1, menuitem1_menu, "menuitem1_menu");
   GLADE_HOOKUP_OBJECT (window1, menu_new1, "menu_new1");
   GLADE_HOOKUP_OBJECT (window1, menu_new_with_template1, "menu_new_with_template1");
-  GLADE_HOOKUP_OBJECT (window1, image1381, "image1381");
+  GLADE_HOOKUP_OBJECT (window1, image1412, "image1412");
   GLADE_HOOKUP_OBJECT (window1, menu_new_with_template1_menu, "menu_new_with_template1_menu");
   GLADE_HOOKUP_OBJECT (window1, invisible2, "invisible2");
   GLADE_HOOKUP_OBJECT (window1, separator12, "separator12");
@@ -1431,11 +1481,11 @@
   GLADE_HOOKUP_OBJECT (window1, menu_save1, "menu_save1");
   GLADE_HOOKUP_OBJECT (window1, menu_save_as1, "menu_save_as1");
   GLADE_HOOKUP_OBJECT (window1, menu_save_all1, "menu_save_all1");
-  GLADE_HOOKUP_OBJECT (window1, image1382, "image1382");
+  GLADE_HOOKUP_OBJECT (window1, image1413, "image1413");
   GLADE_HOOKUP_OBJECT (window1, menu_reload1, "menu_reload1");
-  GLADE_HOOKUP_OBJECT (window1, image1383, "image1383");
+  GLADE_HOOKUP_OBJECT (window1, image1414, "image1414");
   GLADE_HOOKUP_OBJECT (window1, menu_reload_as1, "menu_reload_as1");
-  GLADE_HOOKUP_OBJECT (window1, image1384, "image1384");
+  GLADE_HOOKUP_OBJECT (window1, image1415, "image1415");
   GLADE_HOOKUP_OBJECT (window1, menu_reload_as1_menu, "menu_reload_as1_menu");
   GLADE_HOOKUP_OBJECT (window1, invisible7, "invisible7");
   GLADE_HOOKUP_OBJECT (window1, separator21, "separator21");
@@ -1445,7 +1495,7 @@
   GLADE_HOOKUP_OBJECT (window1, separator14, "separator14");
   GLADE_HOOKUP_OBJECT (window1, menu_close1, "menu_close1");
   GLADE_HOOKUP_OBJECT (window1, menu_close_all1, "menu_close_all1");
-  GLADE_HOOKUP_OBJECT (window1, image1385, "image1385");
+  GLADE_HOOKUP_OBJECT (window1, image1416, "image1416");
   GLADE_HOOKUP_OBJECT (window1, menu_separatormenuitem1, "menu_separatormenuitem1");
   GLADE_HOOKUP_OBJECT (window1, menu_quit1, "menu_quit1");
   GLADE_HOOKUP_OBJECT (window1, edit1, "edit1");
@@ -1471,16 +1521,16 @@
   GLADE_HOOKUP_OBJECT (window1, menu_duplicate_line1, "menu_duplicate_line1");
   GLADE_HOOKUP_OBJECT (window1, separator29, "separator29");
   GLADE_HOOKUP_OBJECT (window1, menu_increase_indent1, "menu_increase_indent1");
-  GLADE_HOOKUP_OBJECT (window1, image1386, "image1386");
+  GLADE_HOOKUP_OBJECT (window1, image1417, "image1417");
   GLADE_HOOKUP_OBJECT (window1, menu_decrease_indent1, "menu_decrease_indent1");
-  GLADE_HOOKUP_OBJECT (window1, image1387, "image1387");
+  GLADE_HOOKUP_OBJECT (window1, image1418, "image1418");
   GLADE_HOOKUP_OBJECT (window1, separator18, "separator18");
   GLADE_HOOKUP_OBJECT (window1, insert_include2, "insert_include2");
-  GLADE_HOOKUP_OBJECT (window1, image1388, "image1388");
+  GLADE_HOOKUP_OBJECT (window1, image1419, "image1419");
   GLADE_HOOKUP_OBJECT (window1, insert_include2_menu, "insert_include2_menu");
   GLADE_HOOKUP_OBJECT (window1, invisible4, "invisible4");
   GLADE_HOOKUP_OBJECT (window1, add_comments1, "add_comments1");
-  GLADE_HOOKUP_OBJECT (window1, image1389, "image1389");
+  GLADE_HOOKUP_OBJECT (window1, image1420, "image1420");
   GLADE_HOOKUP_OBJECT (window1, add_comments1_menu, "add_comments1_menu");
   GLADE_HOOKUP_OBJECT (window1, menu_add_changelog_entry1, "menu_add_changelog_entry1");
   GLADE_HOOKUP_OBJECT (window1, insert_file_header1, "insert_file_header1");
@@ -1500,16 +1550,16 @@
   GLADE_HOOKUP_OBJECT (window1, find_previous1, "find_previous1");
   GLADE_HOOKUP_OBJECT (window1, find_in_files1, "find_in_files1");
   GLADE_HOOKUP_OBJECT (window1, replace1, "replace1");
-  GLADE_HOOKUP_OBJECT (window1, image1390, "image1390");
+  GLADE_HOOKUP_OBJECT (window1, image1421, "image1421");
   GLADE_HOOKUP_OBJECT (window1, separator33, "separator33");
   GLADE_HOOKUP_OBJECT (window1, next_message1, "next_message1");
   GLADE_HOOKUP_OBJECT (window1, separator32, "separator32");
   GLADE_HOOKUP_OBJECT (window1, go_to_line1, "go_to_line1");
-  GLADE_HOOKUP_OBJECT (window1, image1391, "image1391");
+  GLADE_HOOKUP_OBJECT (window1, image1422, "image1422");
   GLADE_HOOKUP_OBJECT (window1, menuitem3, "menuitem3");
   GLADE_HOOKUP_OBJECT (window1, menuitem3_menu, "menuitem3_menu");
   GLADE_HOOKUP_OBJECT (window1, menu_change_font1, "menu_change_font1");
-  GLADE_HOOKUP_OBJECT (window1, image1392, "image1392");
+  GLADE_HOOKUP_OBJECT (window1, image1423, "image1423");
   GLADE_HOOKUP_OBJECT (window1, menu_separator4, "menu_separator4");
   GLADE_HOOKUP_OBJECT (window1, menu_fullscreen1, "menu_fullscreen1");
   GLADE_HOOKUP_OBJECT (window1, menu_show_messages_window1, "menu_show_messages_window1");
@@ -1546,11 +1596,18 @@
   GLADE_HOOKUP_OBJECT (window1, menu_unfold_all1, "menu_unfold_all1");
   GLADE_HOOKUP_OBJECT (window1, separator23, "separator23");
   GLADE_HOOKUP_OBJECT (window1, menu_remove_indicators1, "menu_remove_indicators1");
+  GLADE_HOOKUP_OBJECT (window1, menu_project1, "menu_project1");
+  GLADE_HOOKUP_OBJECT (window1, menu_project1_menu, "menu_project1_menu");
+  GLADE_HOOKUP_OBJECT (window1, project_new1, "project_new1");
+  GLADE_HOOKUP_OBJECT (window1, project_open1, "project_open1");
+  GLADE_HOOKUP_OBJECT (window1, project_close1, "project_close1");
+  GLADE_HOOKUP_OBJECT (window1, separator34, "separator34");
+  GLADE_HOOKUP_OBJECT (window1, project_properties1, "project_properties1");
   GLADE_HOOKUP_OBJECT (window1, menu_build1, "menu_build1");
   GLADE_HOOKUP_OBJECT (window1, tools1, "tools1");
   GLADE_HOOKUP_OBJECT (window1, tools1_menu, "tools1_menu");
   GLADE_HOOKUP_OBJECT (window1, menu_choose_color1, "menu_choose_color1");
-  GLADE_HOOKUP_OBJECT (window1, image1393, "image1393");
+  GLADE_HOOKUP_OBJECT (window1, image1424, "image1424");
   GLADE_HOOKUP_OBJECT (window1, menu_count_words1, "menu_count_words1");
   GLADE_HOOKUP_OBJECT (window1, menu_insert_special_chars1, "menu_insert_special_chars1");
   GLADE_HOOKUP_OBJECT (window1, menu_item5, "menu_item5");

Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c	2007-01-15 16:13:36 UTC (rev 1193)
+++ trunk/src/main.c	2007-01-15 18:12:32 UTC (rev 1194)
@@ -228,6 +228,7 @@
 {
 	// inits
 	app->window				= NULL;
+	app->project			= NULL;
 	app->open_fontsel		= NULL;
 	app->open_colorsel		= NULL;
 	app->open_filesel		= NULL;
@@ -695,6 +696,7 @@
 	build_finalize();
 	document_finalize();
 	symbols_finalize();
+	if (app->project != NULL) project_close();
 
 	tm_workspace_free(TM_WORK_OBJECT(app->tm_workspace));
 	g_free(app->configdir);

Modified: trunk/src/makefile.win32
===================================================================
--- trunk/src/makefile.win32	2007-01-15 16:13:36 UTC (rev 1193)
+++ trunk/src/makefile.win32	2007-01-15 18:12:32 UTC (rev 1194)
@@ -47,7 +47,7 @@
 OBJS = treeviews.o templates.o encodings.o about.o prefs.o win32.o build.o msgwindow.o dialogs.o \
 	filetypes.o interface.o main.o support.o callbacks.o utils.o ui_utils.o socket.o \
 	highlighting.o sci_cb.o document.o sciwrappers.o keyfile.o keybindings.o search.o notebook.o \
-	symbols.o tools.o
+	symbols.o tools.o project.o
 
 .c.o:
 	$(CC) $(CCFLAGS) -c $<

Added: trunk/src/project.c
===================================================================
--- trunk/src/project.c	                        (rev 0)
+++ trunk/src/project.c	2007-01-15 18:12:32 UTC (rev 1194)
@@ -0,0 +1,93 @@
+/*
+ *      project.c - this file is part of Geany, a fast and lightweight IDE
+ *
+ *      Copyright 2007 Enrico Tröger <enrico.troeger at uvena.de>
+ *      Copyright 2007 Nick Treleaven <nick.treleaven at btinternet.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.
+ *
+ * $Id$
+ */
+
+#include "geany.h"
+#include "project.h"
+#include "dialogs.h"
+#include "support.h"
+
+static gboolean close_open_project();
+
+
+void project_new()
+{
+	if (! close_open_project()) return;
+
+	// simply create an empty project and show the properties dialog
+	app->project = g_new0(GeanyProject, 1);
+	project_properties();
+}
+
+
+void project_open()
+{
+	if (! close_open_project()) return;
+
+
+}
+
+
+void project_close()
+{
+	/// TODO should we handle open files in any way here?
+
+	g_return_if_fail(app->project != NULL);
+
+	g_free(app->project->name);
+	g_free(app->project->description);
+	g_free(app->project->file_name);
+	g_free(app->project->base_path);
+	g_free(app->project->executable);
+
+	g_free(app->project);
+	app->project = NULL;
+}
+
+
+void project_properties()
+{
+	g_return_if_fail(app->project != NULL);
+}
+
+
+/* checks whether there is an already open project and asks the user if he want to close it or
+ * abort the current action. Returns FALSE when the current action(the caller) should be cancelled
+ * and TRUE if we can go ahead */
+static gboolean close_open_project()
+{
+	if (app->project != NULL)
+	{
+		gchar *msg =
+			_("There is already an open project \"%s\". Do you want to close it before proceed?");
+
+		if (dialogs_show_question(msg, app->project->name))
+		{
+			project_close();
+			return TRUE;
+		}
+		else
+			return FALSE;
+	}
+	else
+		return TRUE;
+}


Property changes on: trunk/src/project.c
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision

Added: trunk/src/project.h
===================================================================
--- trunk/src/project.h	                        (rev 0)
+++ trunk/src/project.h	2007-01-15 18:12:32 UTC (rev 1194)
@@ -0,0 +1,54 @@
+/*
+ *      project.h - this file is part of Geany, a fast and lightweight IDE
+ *
+ *      Copyright 2007 Enrico Tröger <enrico.troeger at uvena.de>
+ *      Copyright 2007 Nick Treleaven <nick.treleaven at btinternet.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.
+ *
+ * $Id$
+ */
+
+
+#ifndef GEANY_PROJECT_H
+#define GEANY_PROJECT_H 1
+
+
+/* structure for representing a project. */
+struct _GeanyProject
+{
+	gchar *name; 			// the name of the project
+	gchar *description; 	// short description of the project
+
+	gchar *file_name; 		// where the project file is stored
+
+	gchar *base_path;		// base path of the project directory
+	gchar *executable; 		// name of the project executable
+	// ...					// fields for build process(run arguments and so on) should be added
+
+
+};
+
+
+void project_new();
+
+void project_open();
+
+void project_close();
+
+void project_properties();
+
+
+#endif


Property changes on: trunk/src/project.h
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list