Commit f61ef1a4 authored by Naba Kumar's avatar Naba Kumar

Added three more convert EOL chars submenu items in transform. Reformatted

	* src/mainmenu_callbacks.c. main_menu_def.h, main_menubar.c,
	  main_menubar.h, control.c:
	  Added three more convert EOL chars submenu items in transform.
	  Reformatted some some.

	* data/anjuta.properties:
	  Reformatted a line.

	* src/aneditor.h, aneditor.c:
	  Added three commands (with definitions) for EOL conversions.
parent 8d144661
2002-01-25 Naba Kumar <kh_naba@users.sourceforge.net>
* scripts/*: Added files which I forgot previously.
* src/aneditor.h: Lined up commands definition for better look.
* src/mainmenu_callbacks.c. main_menu_def.h, main_menubar.c,
main_menubar.h, control.c:
Added three more convert EOL chars submenu items in transform.
Reformatted some some.
* data/anjuta.properties:
Reformatted a line.
* src/aneditor.h, aneditor.c:
Added three commands (with definitions) for EOL conversions.
2002-01-25 Naba Kumar <kh_naba@users.sourceforge.net>
* src/an_symbol_view.c: Added MAX_STRING_LENGTH
......
......@@ -304,7 +304,7 @@ messages.color.messages2=#000000
messages.tag.position=bottom
##################################################
# Folding #
# Folding #
##################################################
fold.comment=1
......
......@@ -54,6 +54,8 @@
#include "tm_tagmanager.h"
#define DEBUG
#define ANE_MARKER_BOOKMARK 0
#define MAX_PATH 260
#define MAXIMUM(x, y) ((x>y)?x:y)
......@@ -1306,7 +1308,20 @@ long AnEditor::Command(int cmdID, long wParam, long lParam) {
break;
case ANE_EOL_CONVERT:
SendEditor(SCI_CONVERTEOLS, SendEditor(SCI_GETEOLMODE));
switch (wParam) {
case ANE_EOL_CRLF:
SendEditor(SCI_CONVERTEOLS, SC_EOL_CRLF);
break;
case ANE_EOL_LF:
SendEditor(SCI_CONVERTEOLS, SC_EOL_LF);
break;
case ANE_EOL_CR:
SendEditor(SCI_CONVERTEOLS, SC_EOL_CR);
break;
default:
SendEditor(SCI_CONVERTEOLS, SendEditor(SCI_GETEOLMODE));
break;
}
break;
case ANE_WORDPARTLEFT:
......
......@@ -95,7 +95,6 @@ extern "C" {
#define ANE_GETLENGTH ANE_COMMAND_BASE+59
#define ANE_GET_LINENO ANE_COMMAND_BASE+60
typedef guint AnEditorID;
typedef struct _FindParameters FindParameters;
......
......@@ -287,13 +287,18 @@ update_main_menubar ()
gtk_widget_set_sensitive (em->copy, F);
gtk_widget_set_sensitive (em->paste, F);
gtk_widget_set_sensitive (em->clear, F);
gtk_widget_set_sensitive (em->uppercase, F);
gtk_widget_set_sensitive (em->lowercase, F);
gtk_widget_set_sensitive (em->convert, F);
gtk_widget_set_sensitive (em->convert_crlf, F);
gtk_widget_set_sensitive (em->convert_lf, F);
gtk_widget_set_sensitive (em->convert_cr, F);
gtk_widget_set_sensitive (em->convert_auto, F);
gtk_widget_set_sensitive (em->insert_c_gpl, F);
gtk_widget_set_sensitive (em->insert_cpp_gpl, F);
gtk_widget_set_sensitive (em->insert_py_gpl, F);
gtk_widget_set_sensitive (em->insert_username, F);
gtk_widget_set_sensitive (em->insert_py_gpl, F);
gtk_widget_set_sensitive (em->insert_username, F);
gtk_widget_set_sensitive (em->insert_datetime, F);
gtk_widget_set_sensitive (em->insert_header_template, F);
gtk_widget_set_sensitive (em->select_all, F);
......
......@@ -70,8 +70,12 @@ create_main_menubar (GtkWidget * ap, MainMenuBar * mb)
mb->edit.uppercase = transform1_submenu_uiinfo[0].widget;
mb->edit.lowercase = transform1_submenu_uiinfo[1].widget;
mb->edit.convert = transform1_submenu_uiinfo[2].widget;
for (i = 0; i < 3; i++)
mb->edit.convert_crlf = transform1_submenu_uiinfo[3].widget;
mb->edit.convert_lf = transform1_submenu_uiinfo[4].widget;
mb->edit.convert_cr = transform1_submenu_uiinfo[5].widget;
mb->edit.convert_auto = transform1_submenu_uiinfo[6].widget;
for (i = 0; i < NUM_TRANSFORM_SUBMENUS; i++)
{
gtk_widget_ref (transform1_submenu_uiinfo[i].widget);
gtk_accel_group_attach(GNOME_APP(ap)->accel_group, GTK_OBJECT(transform1_submenu_uiinfo[i].widget));
......@@ -79,9 +83,9 @@ create_main_menubar (GtkWidget * ap, MainMenuBar * mb)
mb->edit.insert_c_gpl = inserttext1_submenu_uiinfo[0].widget;
mb->edit.insert_cpp_gpl = inserttext1_submenu_uiinfo[1].widget;
mb->edit.insert_py_gpl = inserttext1_submenu_uiinfo[2].widget;
mb->edit.insert_username = inserttext1_submenu_uiinfo[3].widget;
mb->edit.insert_datetime = inserttext1_submenu_uiinfo[4].widget;
mb->edit.insert_py_gpl = inserttext1_submenu_uiinfo[2].widget;
mb->edit.insert_username = inserttext1_submenu_uiinfo[3].widget;
mb->edit.insert_datetime = inserttext1_submenu_uiinfo[4].widget;
mb->edit.insert_header_template = inserttext1_submenu_uiinfo[5].widget;
for (i = 0; i < 6; i++)
{
......@@ -154,7 +158,7 @@ create_main_menubar (GtkWidget * ap, MainMenuBar * mb)
mb->view.dump_window = view1_menu_uiinfo[17].widget;
mb->view.console = view1_menu_uiinfo[19].widget;
mb->view.show_hide_locals = view1_menu_uiinfo[20].widget;
for (i = 0; i < NVIEWMENUS ; i++)
for (i = 0; i < NUM_VIEW_MENUS ; i++)
{
gtk_widget_ref (view1_menu_uiinfo[i].widget);
gtk_accel_group_attach(GNOME_APP(ap)->accel_group, GTK_OBJECT(view1_menu_uiinfo[i].widget));
......@@ -378,44 +382,67 @@ void
main_menu_unref ()
{
gint i;
for (i = 0; i < 23; i++)
gtk_widget_unref (file1_menu_uiinfo[i].widget);
for (i = 0; i < NUM_TRANSFORM_SUBMENUS ; i++)
gtk_widget_unref (transform1_submenu_uiinfo[i].widget);
for (i = 0; i < 3; i++)
gtk_widget_unref (select1_submenu_uiinfo[i].widget);
for (i = 0; i < 6; i++)
gtk_widget_unref (goto1_submenu_uiinfo[i].widget);
for (i = 0; i < 6; i++)
gtk_widget_unref (inserttext1_submenu_uiinfo[i].widget);
for (i = 0; i < NUM_EDIT_MENUS ; i++)
gtk_widget_unref (edit1_menu_uiinfo[i].widget);
for (i = 0; i < 11; i++)
gtk_widget_unref (toolbar1_submenu_uiinfo[i].widget);
for (i = 0; i < 6; i++)
gtk_widget_unref (editor1_submenu_uiinfo[i].widget);
for (i = 0; i < NVIEWMENUS; i++)
for (i = 0; i < NUM_VIEW_MENUS; i++)
gtk_widget_unref (view1_menu_uiinfo[i].widget);
for (i = 0; i < 17; i++)
gtk_widget_unref (project1_menu_uiinfo[i].widget);
for (i = 0; i < 13; i++)
gtk_widget_unref (format1_menu_uiinfo[i].widget);
for (i = 0; i < 18; i++)
gtk_widget_unref (build1_menu_uiinfo[i].widget);
for (i = 0; i < 8; i++)
gtk_widget_unref (bookmark1_menu_uiinfo[i].widget);
for (i = 0; i < 5; i++)
gtk_widget_unref (execution1_submenu_uiinfo[i].widget);
for (i = 0; i < 6; i++)
gtk_widget_unref (breakpoints1_submenu_uiinfo[i].widget);
for (i = 0; i < 8; i++)
gtk_widget_unref (info1_submenu_uiinfo[i].widget);
for (i = 0; i < 22; i++)
gtk_widget_unref (debug1_menu_uiinfo[i].widget);
for (i = 0; i < 9; i++)
gtk_widget_unref (utilities1_menu_uiinfo[i].widget);
for (i = 0; i < 2; i++)
gtk_widget_unref (windows1_menu_uiinfo[i].widget);
for (i = 0; i < 6; i++)
gtk_widget_unref (settings1_menu_uiinfo[i].widget);
for (i = 1; i < 18; i++)
gtk_widget_unref (help1_menu_uiinfo[i].widget);
}
......
......@@ -63,15 +63,20 @@ struct _EditSubMenu
GtkWidget *copy;
GtkWidget *paste;
GtkWidget *clear;
GtkWidget *uppercase;
GtkWidget *lowercase;
GtkWidget *convert;
GtkWidget *insert_c_gpl;
GtkWidget *insert_cpp_gpl;
GtkWidget *convert_crlf;
GtkWidget *convert_lf;
GtkWidget *convert_cr;
GtkWidget *convert_auto;
GtkWidget *insert_c_gpl;
GtkWidget *insert_cpp_gpl;
GtkWidget *insert_py_gpl;
GtkWidget *insert_username;
GtkWidget *insert_datetime;
GtkWidget *insert_header_template;
GtkWidget *insert_datetime;
GtkWidget *insert_header_template;
GtkWidget *select_all;
GtkWidget *select_brace;
......
......@@ -144,25 +144,53 @@ static GnomeUIInfo file1_menu_uiinfo[] = {
GNOMEUIINFO_END
};
static GnomeUIInfo transform1_submenu_uiinfo[] = {
# define NUM_TRANSFORM_SUBMENUS (7)
static GnomeUIInfo transform1_submenu_uiinfo[NUM_TRANSFORM_SUBMENUS+1] = {
{
/* 0 */
GNOME_APP_UI_ITEM, N_("_Make Selection Uppercase"),
N_("Make the selected text uppercase"),
on_transform_upper1_activate, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, 0, NULL},
{
/* 1 */
GNOME_APP_UI_ITEM, N_("Make Selection Lowercase"),
N_("Make the selected text lowercase"),
on_transform_lower1_activate, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, 0, NULL},
/* 2 */
GNOMEUIINFO_SEPARATOR,
{
/* 3 */
GNOME_APP_UI_ITEM, N_("Convert EOL chars to CRLF"),
N_("Convert End Of Line characters to DOS EOL (CRLF)"),
on_transform_eolchars1_activate, GUINT_TO_POINTER (ANE_EOL_CRLF), NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, 0, NULL},
{
/* 4 */
GNOME_APP_UI_ITEM, N_("Convert EOL chars to LF"),
N_("Convert End Of Line characters to UNIX EOL (line feed: LF)"),
on_transform_eolchars1_activate, NULL, NULL,
N_("Convert End Of Line characters to UNIX EOL (LF)"),
on_transform_eolchars1_activate, GUINT_TO_POINTER (ANE_EOL_LF), NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, 0, NULL},
{
/* 5 */
GNOME_APP_UI_ITEM, N_("Convert EOL chars to CR"),
N_("Convert End Of Line characters to MacOS EOL (CR)"),
on_transform_eolchars1_activate, GUINT_TO_POINTER (ANE_EOL_CR), NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, 0, NULL},
{
/* 6 */
GNOME_APP_UI_ITEM, N_("Convert EOL chars to majority EOL"),
N_("Convert End Of Line characters to mojority of the EOL found in the file"),
on_transform_eolchars1_activate, GUINT_TO_POINTER (0), NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, 0, NULL},
/* 7 */
GNOMEUIINFO_END
};
......@@ -271,7 +299,6 @@ static GnomeUIInfo goto1_submenu_uiinfo[] = {
#define NUM_EDIT_MENUS (24)
static GnomeUIInfo edit1_menu_uiinfo[NUM_EDIT_MENUS+1] = {
{/*0*/
GNOME_APP_UI_ITEM, N_("U_ndo"),
......@@ -410,7 +437,7 @@ static GnomeUIInfo edit1_menu_uiinfo[NUM_EDIT_MENUS+1] = {
on_save_build_messages_activate, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, 0, NULL},
/*24*/
GNOMEUIINFO_END
};
......@@ -569,8 +596,8 @@ static GnomeUIInfo zoom_text1_submenu_uiinfo[] = {
GNOMEUIINFO_END
};
#define NVIEWMENUS (21)
static GnomeUIInfo view1_menu_uiinfo[NVIEWMENUS+1] = {
#define NUM_VIEW_MENUS (21)
static GnomeUIInfo view1_menu_uiinfo[NUM_VIEW_MENUS+1] = {
{/*0*/
GNOME_APP_UI_ITEM, N_("_Messages"),
N_("Show/Hide the Message window"),
......
......@@ -402,13 +402,14 @@ void
on_transform_eolchars1_activate (GtkMenuItem * menuitem, gpointer user_data)
{
TextEditor *te;
glong mode = (glong)user_data;
te = anjuta_get_current_text_editor ();
if (te == NULL)
return;
aneditor_command (te->editor_id, ANE_EOL_CONVERT, 0, 0);
aneditor_command (te->editor_id, ANE_EOL_CONVERT, mode, 0);
}
void
on_insert_c_gpl_notice(GtkMenuItem * menuitem, gpointer user_data)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment