Revision: 1161 http://svn.sourceforge.net/geany/?rev=1161&view=rev Author: eht16 Date: 2007-01-06 07:38:44 -0800 (Sat, 06 Jan 2007)
Log Message: ----------- Added template for BSD licence.
Modified Paths: -------------- trunk/ChangeLog trunk/doc/geany.docbook trunk/geany.glade trunk/src/callbacks.c trunk/src/callbacks.h trunk/src/interface.c trunk/src/templates.c trunk/src/templates.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-01-06 15:03:53 UTC (rev 1160) +++ trunk/ChangeLog 2007-01-06 15:38:44 UTC (rev 1161) @@ -8,6 +8,9 @@ "#" as comment char. The comment characters for fileheader and GPL templates are now added dynamically according to the current filetype. + * geany.glade, doc/geany.docbook, src/callbacks.c, src/callbacks.h, + src/interface.c, src/templates.c, src/templates.h: + Added template for BSD licence.
2007-01-06 Nick Treleaven nick.treleaven@btinternet.com
Modified: trunk/doc/geany.docbook =================================================================== --- trunk/doc/geany.docbook 2007-01-06 15:03:53 UTC (rev 1160) +++ trunk/doc/geany.docbook 2007-01-06 15:38:44 UTC (rev 1161) @@ -1778,11 +1778,11 @@ </literal></literallayout> </para> </section> - <section> + <section id="templates"> <title>Templates</title> <para> <application>Geany</application> supports several templates for file headers, - multiline comments (frame comments), function descriptions, a typical ChangeLog entry + function descriptions, a typical ChangeLog entry and a short GPL notice. To use these templates, just open the Edit menu or open the popup menu by right-clicking in the editor widget, and choose "Insert Comments" and insert templates as you want. @@ -1843,51 +1843,60 @@ <row> <entry>developer</entry> <entry>The name of the developer.</entry> - <entry>filetypes, file header, function description, ChangeLog entry</entry> + <entry>filetypes, file header, function description, ChangeLog entry, + bsd, gpl</entry> </row> <row> <entry>initial</entry> <entry>The developer's initials, e.g. "ET" for Enrico Tröger or "JFD" for John Foobar Doe.</entry> - <entry>filetypes, file header, function description, ChangeLog entry</entry> + <entry>filetypes, file header, function description, ChangeLog entry, + bsd, gpl</entry> </row> <row> <entry>mail</entry> <entry>The email address of the developer.</entry> - <entry>file header, function description, ChangeLog entry</entry> + <entry>file header, function description, ChangeLog entry, + bsd, gpl</entry> </row> <row> <entry>company</entry> <entry>The company the developer is working for.</entry> - <entry>filetypes, file header, function description, ChangeLog entry</entry> + <entry>filetypes, file header, function description, ChangeLog entry, + bsd, gpl</entry> </row> <row> <entry>year</entry> <entry>The current year in the format: YYYY</entry> - <entry>filetypes, file header, function description, ChangeLog entry</entry> + <entry>filetypes, file header, function description, ChangeLog entry, + bsd, gpl</entry> </row> <row> <entry>version</entry> <entry>The initial version of a new file.</entry> - <entry>filetypes, file header, function description, ChangeLog entry</entry> + <entry>filetypes, file header, function description, ChangeLog entry, + bsd, gpl</entry> </row> <row> <entry>date</entry> <entry>The current date in the format: YYYY-MM-DD</entry> - <entry>filetypes, file header, function description, ChangeLog entry</entry> + <entry>filetypes, file header, function description, ChangeLog entry, + bsd, gpl</entry> </row> <row> <entry>untitled</entry> <entry>The string "untitled" (this will be translated to your locale), used in filetype templates</entry> - <entry>filetypes, file header, function description, ChangeLog entry</entry> + <entry>filetypes, file header, function description, ChangeLog entry, + bsd, gpl</entry> </row> <row> <entry>geanyversion</entry> <entry>The actual <application>Geany</application> version, e.g. "Geany &appversion;" </entry> - <entry>filetypes, file header, function description, ChangeLog entry</entry> + <entry>filetypes, file header, function description, ChangeLog entry, + bsd, gpl</entry> </row> <row> <entry>datetime</entry> @@ -1905,6 +1914,11 @@ <entry>file header</entry> </row> <row> + <entry>bsd</entry> + <entry>This wildcard inserts a short BSD licence notice.</entry> + <entry>file header</entry> + </row> + <row> <entry>functionname</entry> <entry>The function name of the function at the cursor position. This wildcard will only be replaced in the function
Modified: trunk/geany.glade =================================================================== --- trunk/geany.glade 2007-01-06 15:03:53 UTC (rev 1160) +++ trunk/geany.glade 2007-01-06 15:38:44 UTC (rev 1161) @@ -57,7 +57,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image1331"> + <widget class="GtkImage" id="image1362"> <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="image1332"> + <widget class="GtkImage" id="image1363"> <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="image1333"> + <widget class="GtkImage" id="image1364"> <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="image1334"> + <widget class="GtkImage" id="image1365"> <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="image1335"> + <widget class="GtkImage" id="image1366"> <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="image1336"> + <widget class="GtkImage" id="image1367"> <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="image1337"> + <widget class="GtkImage" id="image1368"> <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="image1338"> + <widget class="GtkImage" id="image1369"> <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="image1339"> + <widget class="GtkImage" id="image1370"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -613,6 +613,16 @@ <signal name="activate" handler="on_menu_comments_gpl_activate" last_modification_time="Sun, 17 Dec 2006 19:01:32 GMT"/> </widget> </child> + + <child> + <widget class="GtkMenuItem" id="insert_bsd_license_notice2"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Inserts a BSD llicence notice (should be done at the beginning of the file)</property> + <property name="label" translatable="yes">Insert BSD license Notice</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_menu_comments_bsd_activate" last_modification_time="Fri, 05 Jan 2007 13:29:27 GMT"/> + </widget> + </child> </widget> </child> </widget> @@ -710,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="image1340"> + <widget class="GtkImage" id="image1371"> <property name="visible">True</property> <property name="stock">gtk-find-and-replace</property> <property name="icon_size">1</property> @@ -752,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="image1341"> + <widget class="GtkImage" id="image1372"> <property name="visible">True</property> <property name="stock">gtk-jump-to</property> <property name="icon_size">1</property> @@ -787,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="image1342"> + <widget class="GtkImage" id="image1373"> <property name="visible">True</property> <property name="stock">gtk-select-font</property> <property name="icon_size">1</property> @@ -1137,7 +1147,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="image1343"> + <widget class="GtkImage" id="image1374"> <property name="visible">True</property> <property name="stock">gtk-select-color</property> <property name="icon_size">1</property> @@ -2405,7 +2415,7 @@ <signal name="activate" handler="on_menu_increase_indent1_activate" last_modification_time="Tue, 01 Aug 2006 10:31:38 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1289"> + <widget class="GtkImage" id="image1375"> <property name="visible">True</property> <property name="stock">gtk-indent</property> <property name="icon_size">1</property> @@ -2426,7 +2436,7 @@ <signal name="activate" handler="on_menu_decrease_indent1_activate" last_modification_time="Tue, 01 Aug 2006 10:31:38 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1290"> + <widget class="GtkImage" id="image1376"> <property name="visible">True</property> <property name="stock">gtk-unindent</property> <property name="icon_size">1</property> @@ -2456,7 +2466,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image1291"> + <widget class="GtkImage" id="image1377"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -2488,7 +2498,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image1292"> + <widget class="GtkImage" id="image1378"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -2551,6 +2561,16 @@ <signal name="activate" handler="on_comments_gpl_activate" last_modification_time="Sun, 02 Oct 2005 17:37:31 GMT"/> </widget> </child> + + <child> + <widget class="GtkMenuItem" id="insert_bsd_license_notice1"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Inserts a BSD llicence notice (should be done at the beginning of the file)</property> + <property name="label" translatable="yes">Insert BSD license Notice</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_comments_bsd_activate" last_modification_time="Fri, 05 Jan 2007 13:32:16 GMT"/> + </widget> + </child> </widget> </child> </widget> @@ -2590,7 +2610,7 @@ <signal name="activate" handler="on_find_usage1_activate" last_modification_time="Fri, 27 May 2005 21:55:12 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1293"> + <widget class="GtkImage" id="image1379"> <property name="visible">True</property> <property name="stock">gtk-find</property> <property name="icon_size">1</property> @@ -2636,7 +2656,7 @@ <signal name="activate" handler="on_go_to_line_activate" last_modification_time="Sat, 16 Jul 2005 11:20:32 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1294"> + <widget class="GtkImage" id="image1380"> <property name="visible">True</property> <property name="stock">gtk-jump-to</property> <property name="icon_size">1</property>
Modified: trunk/src/callbacks.c =================================================================== --- trunk/src/callbacks.c 2007-01-06 15:03:53 UTC (rev 1160) +++ trunk/src/callbacks.c 2007-01-06 15:38:44 UTC (rev 1161) @@ -1493,7 +1493,7 @@ gint idx = document_get_cur_idx(); gchar *text;
- text = templates_get_template_licence(FILETYPE_ID(doc_list[idx].file_type)); + text = templates_get_template_licence(FILETYPE_ID(doc_list[idx].file_type), GEANY_TEMPLATE_GPL);
verify_click_pos(idx); // make sure that the click_pos is valid
@@ -1506,7 +1506,7 @@ on_comments_bsd_activate (GtkMenuItem *menuitem, gpointer user_data) { -/* + gint idx = document_get_cur_idx(); gchar *text;
@@ -1516,7 +1516,7 @@
sci_insert_text(doc_list[idx].sci, editor_info.click_pos, text); g_free(text); -*/ + }
Modified: trunk/src/callbacks.h =================================================================== --- trunk/src/callbacks.h 2007-01-06 15:03:53 UTC (rev 1160) +++ trunk/src/callbacks.h 2007-01-06 15:38:44 UTC (rev 1161) @@ -1,7 +1,8 @@ /* * callbacks.h - this file is part of Geany, a fast and lightweight IDE * - * Copyright 2006 Enrico Troeger enrico.troeger@uvena.de + * Copyright 2005-2007 Enrico Troeger enrico.troeger@uvena.de + * Copyright 2006-2007 Nick Treleaven nick.treleaven@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 @@ -562,3 +563,11 @@ void on_menu_insert_date_activate (GtkMenuItem *menuitem, gpointer user_data); + +void +on_menu_comments_bsd_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_comments_bsd_activate (GtkMenuItem *menuitem, + gpointer user_data);
Modified: trunk/src/interface.c =================================================================== --- trunk/src/interface.c 2007-01-06 15:03:53 UTC (rev 1160) +++ trunk/src/interface.c 2007-01-06 15:38:44 UTC (rev 1161) @@ -37,7 +37,7 @@ GtkWidget *menuitem1_menu; GtkWidget *menu_new1; GtkWidget *menu_new_with_template1; - GtkWidget *image1331; + GtkWidget *image1362; 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 *image1332; + GtkWidget *image1363; GtkWidget *menu_reload1; - GtkWidget *image1333; + GtkWidget *image1364; GtkWidget *menu_reload_as1; - GtkWidget *image1334; + GtkWidget *image1365; GtkWidget *menu_reload_as1_menu; GtkWidget *invisible7; GtkWidget *separator21; @@ -61,7 +61,7 @@ GtkWidget *separator14; GtkWidget *menu_close1; GtkWidget *menu_close_all1; - GtkWidget *image1335; + GtkWidget *image1366; GtkWidget *menu_separatormenuitem1; GtkWidget *menu_quit1; GtkWidget *edit1; @@ -87,22 +87,23 @@ GtkWidget *menu_duplicate_line1; GtkWidget *separator29; GtkWidget *menu_increase_indent1; - GtkWidget *image1336; + GtkWidget *image1367; GtkWidget *menu_decrease_indent1; - GtkWidget *image1337; + GtkWidget *image1368; GtkWidget *separator18; GtkWidget *insert_include2; - GtkWidget *image1338; + GtkWidget *image1369; GtkWidget *insert_include2_menu; GtkWidget *invisible4; GtkWidget *add_comments1; - GtkWidget *image1339; + GtkWidget *image1370; GtkWidget *add_comments1_menu; GtkWidget *menu_add_changelog_entry1; GtkWidget *insert_file_header1; GtkWidget *insert_function_description2; GtkWidget *insert_multiline_comment2; GtkWidget *insert_gpl_notice2; + GtkWidget *insert_bsd_license_notice2; GtkWidget *insert_date1; GtkWidget *insert_date1_menu; GtkWidget *invisible8; @@ -115,16 +116,16 @@ GtkWidget *find_previous1; GtkWidget *find_in_files1; GtkWidget *replace1; - GtkWidget *image1340; + GtkWidget *image1371; GtkWidget *separator33; GtkWidget *next_message1; GtkWidget *separator32; GtkWidget *go_to_line1; - GtkWidget *image1341; + GtkWidget *image1372; GtkWidget *menuitem3; GtkWidget *menuitem3_menu; GtkWidget *menu_change_font1; - GtkWidget *image1342; + GtkWidget *image1373; GtkWidget *menu_separator4; GtkWidget *menu_fullscreen1; GtkWidget *menu_show_messages_window1; @@ -166,7 +167,7 @@ GtkWidget *tools1; GtkWidget *tools1_menu; GtkWidget *menu_choose_color1; - GtkWidget *image1343; + GtkWidget *image1374; GtkWidget *menu_count_words1; GtkWidget *menu_insert_special_chars1; GtkWidget *menu_item5; @@ -267,9 +268,9 @@ gtk_widget_show (menu_new_with_template1); gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_new_with_template1);
- image1331 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1331); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_new_with_template1), image1331); + image1362 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1362); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_new_with_template1), image1362);
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); @@ -308,25 +309,25 @@ gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_save_all1); gtk_tooltips_set_tip (tooltips, menu_save_all1, _("Saves all open files"), NULL);
- image1332 = gtk_image_new_from_stock ("gtk-save", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1332); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_save_all1), image1332); + image1363 = gtk_image_new_from_stock ("gtk-save", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1363); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_save_all1), image1363);
menu_reload1 = gtk_image_menu_item_new_with_mnemonic (_("_Reload")); gtk_widget_show (menu_reload1); gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_reload1);
- image1333 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1333); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload1), image1333); + image1364 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1364); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload1), image1364);
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);
- image1334 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1334); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload_as1), image1334); + image1365 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1365); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload_as1), image1365);
menu_reload_as1_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_reload_as1), menu_reload_as1_menu); @@ -367,9 +368,9 @@ gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_close_all1); gtk_tooltips_set_tip (tooltips, menu_close_all1, _("Closes all open files"), NULL);
- image1335 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1335); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_close_all1), image1335); + image1366 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1366); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_close_all1), image1366);
menu_separatormenuitem1 = gtk_separator_menu_item_new (); gtk_widget_show (menu_separatormenuitem1); @@ -477,17 +478,17 @@ gtk_widget_show (menu_increase_indent1); gtk_container_add (GTK_CONTAINER (menu_format1_menu), menu_increase_indent1);
- image1336 = gtk_image_new_from_stock ("gtk-indent", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1336); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_increase_indent1), image1336); + image1367 = gtk_image_new_from_stock ("gtk-indent", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1367); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_increase_indent1), image1367);
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);
- image1337 = gtk_image_new_from_stock ("gtk-unindent", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1337); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_decrease_indent1), image1337); + image1368 = gtk_image_new_from_stock ("gtk-unindent", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1368); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_decrease_indent1), image1368);
separator18 = gtk_separator_menu_item_new (); gtk_widget_show (separator18); @@ -498,9 +499,9 @@ gtk_widget_show (insert_include2); gtk_container_add (GTK_CONTAINER (edit1_menu), insert_include2);
- image1338 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1338); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include2), image1338); + image1369 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1369); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include2), image1369);
insert_include2_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (insert_include2), insert_include2_menu); @@ -512,9 +513,9 @@ gtk_widget_show (add_comments1); gtk_container_add (GTK_CONTAINER (edit1_menu), add_comments1);
- image1339 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1339); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_comments1), image1339); + image1370 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1370); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_comments1), image1370);
add_comments1_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (add_comments1), add_comments1_menu); @@ -544,6 +545,11 @@ gtk_container_add (GTK_CONTAINER (add_comments1_menu), insert_gpl_notice2); gtk_tooltips_set_tip (tooltips, insert_gpl_notice2, _("Inserts a GPL notice (should be done at the beginning of the file)"), NULL);
+ insert_bsd_license_notice2 = gtk_menu_item_new_with_mnemonic (_("Insert BSD license Notice")); + gtk_widget_show (insert_bsd_license_notice2); + gtk_container_add (GTK_CONTAINER (add_comments1_menu), insert_bsd_license_notice2); + gtk_tooltips_set_tip (tooltips, insert_bsd_license_notice2, _("Inserts a BSD llicence notice (should be done at the beginning of the file)"), NULL); + insert_date1 = gtk_menu_item_new_with_mnemonic (_("Insert Dat_e")); gtk_widget_show (insert_date1); gtk_container_add (GTK_CONTAINER (edit1_menu), insert_date1); @@ -590,9 +596,9 @@ gtk_widget_show (replace1); gtk_container_add (GTK_CONTAINER (search1_menu), replace1);
- image1340 = gtk_image_new_from_stock ("gtk-find-and-replace", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1340); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (replace1), image1340); + image1371 = gtk_image_new_from_stock ("gtk-find-and-replace", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1371); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (replace1), image1371);
separator33 = gtk_separator_menu_item_new (); gtk_widget_show (separator33); @@ -612,9 +618,9 @@ gtk_widget_show (go_to_line1); gtk_container_add (GTK_CONTAINER (search1_menu), go_to_line1);
- image1341 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1341); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (go_to_line1), image1341); + image1372 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1372); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (go_to_line1), image1372);
menuitem3 = gtk_menu_item_new_with_mnemonic (_("_View")); gtk_widget_show (menuitem3); @@ -628,9 +634,9 @@ gtk_container_add (GTK_CONTAINER (menuitem3_menu), menu_change_font1); gtk_tooltips_set_tip (tooltips, menu_change_font1, _("Change the default font"), NULL);
- image1342 = gtk_image_new_from_stock ("gtk-select-font", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1342); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_change_font1), image1342); + image1373 = gtk_image_new_from_stock ("gtk-select-font", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1373); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_change_font1), image1373);
menu_separator4 = gtk_separator_menu_item_new (); gtk_widget_show (menu_separator4); @@ -815,9 +821,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);
- image1343 = gtk_image_new_from_stock ("gtk-select-color", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1343); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_choose_color1), image1343); + image1374 = gtk_image_new_from_stock ("gtk-select-color", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1374); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_choose_color1), image1374);
menu_count_words1 = gtk_menu_item_new_with_mnemonic (_("_Word Count")); gtk_widget_show (menu_count_words1); @@ -1225,6 +1231,9 @@ g_signal_connect ((gpointer) insert_gpl_notice2, "activate", G_CALLBACK (on_menu_comments_gpl_activate), NULL); + g_signal_connect ((gpointer) insert_bsd_license_notice2, "activate", + G_CALLBACK (on_menu_comments_bsd_activate), + NULL); g_signal_connect ((gpointer) preferences1, "activate", G_CALLBACK (on_preferences1_activate), NULL); @@ -1412,7 +1421,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, image1331, "image1331"); + GLADE_HOOKUP_OBJECT (window1, image1362, "image1362"); 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"); @@ -1422,11 +1431,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, image1332, "image1332"); + GLADE_HOOKUP_OBJECT (window1, image1363, "image1363"); GLADE_HOOKUP_OBJECT (window1, menu_reload1, "menu_reload1"); - GLADE_HOOKUP_OBJECT (window1, image1333, "image1333"); + GLADE_HOOKUP_OBJECT (window1, image1364, "image1364"); GLADE_HOOKUP_OBJECT (window1, menu_reload_as1, "menu_reload_as1"); - GLADE_HOOKUP_OBJECT (window1, image1334, "image1334"); + GLADE_HOOKUP_OBJECT (window1, image1365, "image1365"); GLADE_HOOKUP_OBJECT (window1, menu_reload_as1_menu, "menu_reload_as1_menu"); GLADE_HOOKUP_OBJECT (window1, invisible7, "invisible7"); GLADE_HOOKUP_OBJECT (window1, separator21, "separator21"); @@ -1436,7 +1445,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, image1335, "image1335"); + GLADE_HOOKUP_OBJECT (window1, image1366, "image1366"); GLADE_HOOKUP_OBJECT (window1, menu_separatormenuitem1, "menu_separatormenuitem1"); GLADE_HOOKUP_OBJECT (window1, menu_quit1, "menu_quit1"); GLADE_HOOKUP_OBJECT (window1, edit1, "edit1"); @@ -1462,22 +1471,23 @@ 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, image1336, "image1336"); + GLADE_HOOKUP_OBJECT (window1, image1367, "image1367"); GLADE_HOOKUP_OBJECT (window1, menu_decrease_indent1, "menu_decrease_indent1"); - GLADE_HOOKUP_OBJECT (window1, image1337, "image1337"); + GLADE_HOOKUP_OBJECT (window1, image1368, "image1368"); GLADE_HOOKUP_OBJECT (window1, separator18, "separator18"); GLADE_HOOKUP_OBJECT (window1, insert_include2, "insert_include2"); - GLADE_HOOKUP_OBJECT (window1, image1338, "image1338"); + GLADE_HOOKUP_OBJECT (window1, image1369, "image1369"); 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, image1339, "image1339"); + GLADE_HOOKUP_OBJECT (window1, image1370, "image1370"); 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"); GLADE_HOOKUP_OBJECT (window1, insert_function_description2, "insert_function_description2"); GLADE_HOOKUP_OBJECT (window1, insert_multiline_comment2, "insert_multiline_comment2"); GLADE_HOOKUP_OBJECT (window1, insert_gpl_notice2, "insert_gpl_notice2"); + GLADE_HOOKUP_OBJECT (window1, insert_bsd_license_notice2, "insert_bsd_license_notice2"); GLADE_HOOKUP_OBJECT (window1, insert_date1, "insert_date1"); GLADE_HOOKUP_OBJECT (window1, insert_date1_menu, "insert_date1_menu"); GLADE_HOOKUP_OBJECT (window1, invisible8, "invisible8"); @@ -1490,16 +1500,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, image1340, "image1340"); + GLADE_HOOKUP_OBJECT (window1, image1371, "image1371"); 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, image1341, "image1341"); + GLADE_HOOKUP_OBJECT (window1, image1372, "image1372"); 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, image1342, "image1342"); + GLADE_HOOKUP_OBJECT (window1, image1373, "image1373"); 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"); @@ -1540,7 +1550,7 @@ 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, image1343, "image1343"); + GLADE_HOOKUP_OBJECT (window1, image1374, "image1374"); 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"); @@ -1740,33 +1750,34 @@ GtkWidget *menu_duplicate_line2; GtkWidget *separator31; GtkWidget *menu_increase_indent2; - GtkWidget *image1289; + GtkWidget *image1375; GtkWidget *menu_decrease_indent2; - GtkWidget *image1290; + GtkWidget *image1376; GtkWidget *separator17; GtkWidget *insert_include1; - GtkWidget *image1291; + GtkWidget *image1377; GtkWidget *insert_include1_menu; GtkWidget *invisible3; GtkWidget *comments; - GtkWidget *image1292; + GtkWidget *image1378; GtkWidget *comments_menu; GtkWidget *add_changelog_entry2; GtkWidget *insert_file_header2; GtkWidget *insert_function_description1; GtkWidget *insert_multiline_comment1; GtkWidget *insert_gpl_notice1; + GtkWidget *insert_bsd_license_notice1; GtkWidget *insert_date2; GtkWidget *insert_date2_menu; GtkWidget *invisible10; GtkWidget *separator7; GtkWidget *find_usage1; - GtkWidget *image1293; + GtkWidget *image1379; GtkWidget *goto_tag_definition1; GtkWidget *goto_tag_declaration1; GtkWidget *separator15; GtkWidget *go_to_line; - GtkWidget *image1294; + GtkWidget *image1380; GtkAccelGroup *accel_group; GtkTooltips *tooltips;
@@ -1881,17 +1892,17 @@ gtk_widget_show (menu_increase_indent2); gtk_container_add (GTK_CONTAINER (menu_format2_menu), menu_increase_indent2);
- image1289 = gtk_image_new_from_stock ("gtk-indent", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1289); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_increase_indent2), image1289); + image1375 = gtk_image_new_from_stock ("gtk-indent", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1375); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_increase_indent2), image1375);
menu_decrease_indent2 = gtk_image_menu_item_new_with_mnemonic (_("_Decrease Indent")); gtk_widget_show (menu_decrease_indent2); gtk_container_add (GTK_CONTAINER (menu_format2_menu), menu_decrease_indent2);
- image1290 = gtk_image_new_from_stock ("gtk-unindent", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1290); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_decrease_indent2), image1290); + image1376 = gtk_image_new_from_stock ("gtk-unindent", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1376); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_decrease_indent2), image1376);
separator17 = gtk_separator_menu_item_new (); gtk_widget_show (separator17); @@ -1902,9 +1913,9 @@ gtk_widget_show (insert_include1); gtk_container_add (GTK_CONTAINER (edit_menu1), insert_include1);
- image1291 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1291); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include1), image1291); + image1377 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1377); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include1), image1377);
insert_include1_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (insert_include1), insert_include1_menu); @@ -1916,9 +1927,9 @@ gtk_widget_show (comments); gtk_container_add (GTK_CONTAINER (edit_menu1), comments);
- image1292 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1292); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (comments), image1292); + image1378 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1378); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (comments), image1378);
comments_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (comments), comments_menu); @@ -1948,6 +1959,11 @@ gtk_container_add (GTK_CONTAINER (comments_menu), insert_gpl_notice1); gtk_tooltips_set_tip (tooltips, insert_gpl_notice1, _("Inserts a GPL notice (should be done at the beginning of the file)"), NULL);
+ insert_bsd_license_notice1 = gtk_menu_item_new_with_mnemonic (_("Insert BSD license Notice")); + gtk_widget_show (insert_bsd_license_notice1); + gtk_container_add (GTK_CONTAINER (comments_menu), insert_bsd_license_notice1); + gtk_tooltips_set_tip (tooltips, insert_bsd_license_notice1, _("Inserts a BSD llicence notice (should be done at the beginning of the file)"), NULL); + insert_date2 = gtk_menu_item_new_with_mnemonic (_("Insert Dat_e")); gtk_widget_show (insert_date2); gtk_container_add (GTK_CONTAINER (edit_menu1), insert_date2); @@ -1967,9 +1983,9 @@ gtk_widget_show (find_usage1); gtk_container_add (GTK_CONTAINER (edit_menu1), find_usage1);
- image1293 = gtk_image_new_from_stock ("gtk-find", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1293); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (find_usage1), image1293); + image1379 = gtk_image_new_from_stock ("gtk-find", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1379); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (find_usage1), image1379);
goto_tag_definition1 = gtk_menu_item_new_with_mnemonic (_("Go to Tag Definition")); gtk_widget_show (goto_tag_definition1); @@ -1989,9 +2005,9 @@ gtk_container_add (GTK_CONTAINER (edit_menu1), go_to_line); gtk_tooltips_set_tip (tooltips, go_to_line, _("Goto to the entered line"), NULL);
- image1294 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1294); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (go_to_line), image1294); + image1380 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1380); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (go_to_line), image1380);
g_signal_connect ((gpointer) undo1, "activate", G_CALLBACK (on_undo1_activate), @@ -2062,6 +2078,9 @@ g_signal_connect ((gpointer) insert_gpl_notice1, "activate", G_CALLBACK (on_comments_gpl_activate), NULL); + g_signal_connect ((gpointer) insert_bsd_license_notice1, "activate", + G_CALLBACK (on_comments_bsd_activate), + NULL); g_signal_connect ((gpointer) find_usage1, "activate", G_CALLBACK (on_find_usage1_activate), NULL); @@ -2102,33 +2121,34 @@ GLADE_HOOKUP_OBJECT (edit_menu1, menu_duplicate_line2, "menu_duplicate_line2"); GLADE_HOOKUP_OBJECT (edit_menu1, separator31, "separator31"); GLADE_HOOKUP_OBJECT (edit_menu1, menu_increase_indent2, "menu_increase_indent2"); - GLADE_HOOKUP_OBJECT (edit_menu1, image1289, "image1289"); + GLADE_HOOKUP_OBJECT (edit_menu1, image1375, "image1375"); GLADE_HOOKUP_OBJECT (edit_menu1, menu_decrease_indent2, "menu_decrease_indent2"); - GLADE_HOOKUP_OBJECT (edit_menu1, image1290, "image1290"); + GLADE_HOOKUP_OBJECT (edit_menu1, image1376, "image1376"); GLADE_HOOKUP_OBJECT (edit_menu1, separator17, "separator17"); GLADE_HOOKUP_OBJECT (edit_menu1, insert_include1, "insert_include1"); - GLADE_HOOKUP_OBJECT (edit_menu1, image1291, "image1291"); + GLADE_HOOKUP_OBJECT (edit_menu1, image1377, "image1377"); GLADE_HOOKUP_OBJECT (edit_menu1, insert_include1_menu, "insert_include1_menu"); GLADE_HOOKUP_OBJECT (edit_menu1, invisible3, "invisible3"); GLADE_HOOKUP_OBJECT (edit_menu1, comments, "comments"); - GLADE_HOOKUP_OBJECT (edit_menu1, image1292, "image1292"); + GLADE_HOOKUP_OBJECT (edit_menu1, image1378, "image1378"); GLADE_HOOKUP_OBJECT (edit_menu1, comments_menu, "comments_menu"); GLADE_HOOKUP_OBJECT (edit_menu1, add_changelog_entry2, "add_changelog_entry2"); GLADE_HOOKUP_OBJECT (edit_menu1, insert_file_header2, "insert_file_header2"); GLADE_HOOKUP_OBJECT (edit_menu1, insert_function_description1, "insert_function_description1"); GLADE_HOOKUP_OBJECT (edit_menu1, insert_multiline_comment1, "insert_multiline_comment1"); GLADE_HOOKUP_OBJECT (edit_menu1, insert_gpl_notice1, "insert_gpl_notice1"); + GLADE_HOOKUP_OBJECT (edit_menu1, insert_bsd_license_notice1, "insert_bsd_license_notice1"); GLADE_HOOKUP_OBJECT (edit_menu1, insert_date2, "insert_date2"); GLADE_HOOKUP_OBJECT (edit_menu1, insert_date2_menu, "insert_date2_menu"); GLADE_HOOKUP_OBJECT (edit_menu1, invisible10, "invisible10"); GLADE_HOOKUP_OBJECT (edit_menu1, separator7, "separator7"); GLADE_HOOKUP_OBJECT (edit_menu1, find_usage1, "find_usage1"); - GLADE_HOOKUP_OBJECT (edit_menu1, image1293, "image1293"); + GLADE_HOOKUP_OBJECT (edit_menu1, image1379, "image1379"); GLADE_HOOKUP_OBJECT (edit_menu1, goto_tag_definition1, "goto_tag_definition1"); GLADE_HOOKUP_OBJECT (edit_menu1, goto_tag_declaration1, "goto_tag_declaration1"); GLADE_HOOKUP_OBJECT (edit_menu1, separator15, "separator15"); GLADE_HOOKUP_OBJECT (edit_menu1, go_to_line, "go_to_line"); - GLADE_HOOKUP_OBJECT (edit_menu1, image1294, "image1294"); + GLADE_HOOKUP_OBJECT (edit_menu1, image1380, "image1380"); GLADE_HOOKUP_OBJECT_NO_REF (edit_menu1, tooltips, "tooltips");
gtk_menu_set_accel_group (GTK_MENU (edit_menu1), accel_group);
Modified: trunk/src/templates.c =================================================================== --- trunk/src/templates.c 2007-01-06 15:03:53 UTC (rev 1160) +++ trunk/src/templates.c 2007-01-06 15:38:44 UTC (rev 1161) @@ -49,6 +49,34 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n\ ";
+static const gchar templates_bsd_notice[] = "\ +Redistribution and use in source and binary forms, with or without\n\ +modification, are permitted provided that the following conditions are\n\ +met:\n\ +\n\ +* Redistributions of source code must retain the above copyright\n\ + notice, this list of conditions and the following disclaimer.\n\ +* Redistributions in binary form must reproduce the above\n\ + copyright notice, this list of conditions and the following disclaimer\n\ + in the documentation and/or other materials provided with the\n\ + distribution.\n\ +* Neither the name of the {company} nor the names of its\n\ + contributors may be used to endorse or promote products derived from\n\ + this software without specific prior written permission.\n\ +\n\ +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\ +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n\ +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n\ +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n\ +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n\ +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n\ +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n\ +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n\ +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n\ +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n\ +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\ +"; + static const gchar templates_function_description[] = "\ \n\ name: {functionname}\n\ @@ -189,6 +217,7 @@ { gchar *template_filename_fileheader = TEMPLATES_GET_FILENAME("template.fileheader"); gchar *template_filename_gpl = TEMPLATES_GET_FILENAME("template.gpl"); + gchar *template_filename_bsd = TEMPLATES_GET_FILENAME("template.bsd"); gchar *template_filename_function = TEMPLATES_GET_FILENAME("template.function"); gchar *template_filename_changelog = TEMPLATES_GET_FILENAME("template.changelog"); gchar *template_filename_filetype_none = TEMPLATES_GET_FILENAME("template.filetype.none"); @@ -210,6 +239,7 @@ // create the template files in the configuration directory, if they don't exist TEMPLATES_CREATE_FILE(template_filename_fileheader, templates_fileheader); TEMPLATES_CREATE_FILE(template_filename_gpl, templates_gpl_notice); + TEMPLATES_CREATE_FILE(template_filename_bsd, templates_bsd_notice); TEMPLATES_CREATE_FILE(template_filename_function, templates_function_description); TEMPLATES_CREATE_FILE(template_filename_changelog, templates_changelog); TEMPLATES_CREATE_FILE(template_filename_filetype_none, templates_filetype_none); @@ -227,8 +257,11 @@ templates[GEANY_TEMPLATE_FILEHEADER] = templates_replace_all(templates[GEANY_TEMPLATE_FILEHEADER], year, date);
TEMPLATES_READ_FILE(template_filename_gpl, &templates[GEANY_TEMPLATE_GPL]); - //templates[GEANY_TEMPLATE_GPL] = templates_replace_all(templates[GEANY_TEMPLATE_GPL], year, date); + templates[GEANY_TEMPLATE_GPL] = templates_replace_all(templates[GEANY_TEMPLATE_GPL], year, date);
+ TEMPLATES_READ_FILE(template_filename_bsd, &templates[GEANY_TEMPLATE_BSD]); + templates[GEANY_TEMPLATE_BSD] = templates_replace_all(templates[GEANY_TEMPLATE_BSD], year, date); + TEMPLATES_READ_FILE(template_filename_function, &templates[GEANY_TEMPLATE_FUNCTION]); templates[GEANY_TEMPLATE_FUNCTION] = templates_replace_all(templates[GEANY_TEMPLATE_FUNCTION], year, date);
@@ -268,6 +301,7 @@ g_free(year); g_free(template_filename_fileheader); g_free(template_filename_gpl); + g_free(template_filename_bsd); g_free(template_filename_function); g_free(template_filename_changelog); g_free(template_filename_filetype_none); @@ -414,12 +448,12 @@ }
-gchar *templates_get_template_licence(gint filetype_idx) +gchar *templates_get_template_licence(gint filetype_idx, gint licence_type) { - //if (licence_type != GEANY_TEMPLATE_GPL) - //return NULL; + if (licence_type != GEANY_TEMPLATE_GPL && licence_type != GEANY_TEMPLATE_BSD) + return NULL;
- return make_comment_block(templates[GEANY_TEMPLATE_GPL], filetype_idx, 8); + return make_comment_block(templates[licence_type], filetype_idx, 8); }
@@ -444,6 +478,8 @@
template = utils_str_replace(template, "{gpl}", templates[GEANY_TEMPLATE_GPL]);
+ template = utils_str_replace(template, "{bsd}", templates[GEANY_TEMPLATE_BSD]); + template = utils_str_replace(template, "{datetime}", date);
result = make_comment_block(template, FILETYPE_ID(ft), 8);
Modified: trunk/src/templates.h =================================================================== --- trunk/src/templates.h 2007-01-06 15:03:53 UTC (rev 1160) +++ trunk/src/templates.h 2007-01-06 15:38:44 UTC (rev 1161) @@ -38,7 +38,7 @@
gchar *templates_get_template_function(gint filetype_idx, const gchar *func_name);
-gchar *templates_get_template_licence(gint filetype_idx); +gchar *templates_get_template_licence(gint filetype_idx, gint licence_type);
void templates_free_templates(void);
@@ -46,6 +46,7 @@ enum { GEANY_TEMPLATE_GPL = 0, + GEANY_TEMPLATE_BSD, GEANY_TEMPLATE_FILEHEADER, GEANY_TEMPLATE_CHANGELOG, GEANY_TEMPLATE_FUNCTION,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.