Commit 389444c3 authored by Evan Lawrence's avatar Evan Lawrence Committed by gedit

src/commands.c: Fixed some more stuff with the titlebar.. Removed the Line

1998-12-07  Evan Lawrence <evan@worldpath.net>

	* src/gE_files.c:
	  src/commands.c: Fixed some more stuff with the titlebar..
	* src/gE_document.c: Removed the Line indicator label, since it
	  doesn't display the correct line number.
	* src/gE_about.c: Fixed the gnome version.
	* src/gE_plugin.h:
	  src/gE_plugin_api.c: Mostly caught up to Chris's additions to
	  the plugins api - set_selected_text, get_selected_text,
	  get_point, etc... This means that Test Selection works now :)
	* README: Did some editting on it - changed the stuff that was
	  innaccurate or didn't make sense..
parent c560aa1f
1998-12-07 Evan Lawrence <evan@worldpath.net>
* src/gE_files.c:
src/commands.c: Fixed some more stuff with the titlebar..
* src/gE_document.c: Removed the Line indicator label, since it
doesn't display the correct line number.
* src/gE_about.c: Fixed the gnome version.
* src/gE_plugin.h:
src/gE_plugin_api.c: Mostly caught up to Chris's additions to
the plugins api - set_selected_text, get_selected_text,
get_point, etc... This means that Test Selection works now :)
* README: Did some editting on it - changed the stuff that was
innaccurate or didn't make sense..
1998-12-05 Alex Roberts <bse@dial.pipex.com>
* src/commands.c: Tried to remove the weird code that makes the gEdit
......
......@@ -2,8 +2,8 @@ gEdit 0.4.8
Alex Roberts and Evan Lawrence, 1998
Thank you for your interest in gEdit, a text editor for X using
the GTK+ library. It is being developed by Alex Roberts, Evan Lawrence
and Chris Lahey (among others).
the GTK+ and, optionally, GNOME libraries. It is being developed
by Alex Roberts, Evan Lawrence and Chris Lahey (among others).
This version is quite a neat text editor, it contains the following
features:
......@@ -13,7 +13,7 @@ features:
* A complete preferences interface;
* Dynamically loading fonts (no more need to restart for font changes);
* Splitscreen Mode;
* Print feature;
* Printing support;
* Plugins!
It is quite stable at the moment, but there are certainly still bugs in it -
......@@ -28,20 +28,15 @@ the: "plugins/plugin_howto" file...
Please see the file INSTALL for instructions on installation.
This version uses features only available in GTK+*1.1, and so
requires at least that version, it will work with Gtk+ 1.0.x but won't
have all the features present. I recommend getting the
latest release from www.gtk.org, if it's available, or the latest development
version from Gnome CVS..
It's still buggy, so don't bug us if it destroys your system! If it _does_,
please tell us, so that it won't happen again!
This version inclueds features only available in GTK+-1.1 - it will
work with Gtk+ 1.0.x but won't have all the features present. I
recommend getting the latest release from http://www.gtk.org, if it's
available, or the latest development version from the Gnome CVS tree..
If you are interested in gEdit, either using it, or developing it, please
join the gEdit mailing list:
Send an Email to wlashell@cland.net, with a Subject of GEDIT MAIL LIST
To send a message to the list, send mail to gedit*list@lyrical.cland.net
To send a message to the list, send mail to gedit-list@lyrical.cland.net
L8r
......
......@@ -405,18 +405,18 @@ auto_indent_cb(GtkWidget *text, GdkEventKey *event, gE_window *window)
static void
line_pos_cb(GtkWidget *w, gE_data *data)
{
static char line [32];
/*static char line [32];*/
static char col [32];
GtkWidget *text = data->temp2;
int x;
/*x = GTK_TEXT(text)->current_line->data;*/
sprintf (line,"%d", GTK_TEXT(text)->cursor_pos_y/13);
/*sprintf (line,"%d", GTK_TEXT(text)->cursor_pos_y/13);*/
/*sprintf(line,"%d", x);*/
sprintf (col, "%d", GTK_TEXT(text)->cursor_pos_x/7);
gtk_label_set (GTK_LABEL(data->window->line_label), line);
/*gtk_label_set (GTK_LABEL(data->window->line_label), line);*/
gtk_label_set (GTK_LABEL(data->window->col_label), col);
}
......@@ -636,6 +636,7 @@ void
close_doc_execute(gE_document *opt_doc, gpointer cbdata)
{
int num, numdoc;
gchar *title;
GtkNotebook *nb;
gE_window *w;
gE_document *doc;
......@@ -697,6 +698,15 @@ close_doc_execute(gE_document *opt_doc, gpointer cbdata)
flw_append_entry(w, doc,
g_list_length(nb->children) - 1, NULL);
}
/* Set the title of the window to Current Document - GEDIT_ID */
title = g_malloc0(strlen(GEDIT_ID) +
strlen(GTK_LABEL(gE_document_current(w)->tab_label)->label) + 4);
sprintf(title, "%s - %s",
GTK_LABEL(gE_document_current(w)->tab_label)->label,
GEDIT_ID);
gtk_window_set_title(GTK_WINDOW(w->window), title);
g_free(title);
} /* close_doc_execute */
......
......@@ -146,14 +146,14 @@ gE_about_box(GtkWidget *w, gpointer cbdata)
void gE_about_box(GtkWidget *w, gpointer cbdata)
{
GtkWidget *about;
gchar *authors[] = {
const gchar *authors[] = {
"Alex Roberts",
"Evan Lawrence",
"http://gedit.pn.org",
NULL
};
about = gnome_about_new (GEDIT_ID, NULL,
about = gnome_about_new ("gEdit", "0.4.8",
"(C) 1998 Alex Roberts and Evan Lawrence",
authors,
_("gEdit is a small and lightweight text editor for GNOME/Gtk+"),
......
......@@ -161,19 +161,8 @@ gE_window_new(void)
gtk_misc_set_alignment(GTK_MISC(w->statusbar), 0.0, 0.5);
/* line and column indicators */
tmp = gtk_button_new_with_label("Line");
gtk_signal_connect(GTK_OBJECT(tmp), "clicked",
GTK_SIGNAL_FUNC(goto_line_cb), w);
GTK_WIDGET_UNSET_FLAGS(tmp, GTK_CAN_FOCUS);
gtk_box_pack_start(GTK_BOX(box2), tmp, FALSE, FALSE, 1);
gtk_widget_show(tmp);
w->line_label = gtk_label_new("1");
gtk_box_pack_start(GTK_BOX(box2), w->line_label, FALSE, FALSE, 1);
gtk_widget_set_usize(w->line_label, 40, 0);
gtk_widget_show(w->line_label);
tmp = gtk_label_new("Column");
tmp = gtk_label_new("Column:");
gtk_box_pack_start(GTK_BOX(box2), tmp, FALSE, FALSE, 1);
gtk_widget_show(tmp);
......@@ -182,6 +171,13 @@ gE_window_new(void)
gtk_widget_set_usize(w->col_label, 40, 0);
gtk_widget_show(w->col_label);
tmp = gtk_button_new_with_label("Line");
gtk_signal_connect(GTK_OBJECT(tmp), "clicked",
GTK_SIGNAL_FUNC(goto_line_cb), w);
GTK_WIDGET_UNSET_FLAGS(tmp, GTK_CAN_FOCUS);
gtk_box_pack_start(GTK_BOX(box2), tmp, FALSE, FALSE, 0);
gtk_widget_show(tmp);
w->statusbox = box2;
/* finish up */
......
......@@ -198,7 +198,7 @@ gE_file_open(gE_window *w, gE_document *doc, gchar *fname)
title = g_malloc(strlen(GEDIT_ID) +
strlen(GTK_LABEL(doc->tab_label)->label) + 4);
sprintf(title, "%s - %s",
GEDIT_ID, GTK_LABEL (doc->tab_label)->label);
GTK_LABEL (doc->tab_label)->label, GEDIT_ID);
gtk_window_set_title(GTK_WINDOW (w->window), title);
g_free (title);
......@@ -274,7 +274,7 @@ gE_file_save(gE_window *window, gE_document *doc, gchar *fname)
title = g_malloc0(strlen(GEDIT_ID) +
strlen(GTK_LABEL(doc->tab_label)->label) + 4);
sprintf(title, "%s - %s",
GEDIT_ID, GTK_LABEL (doc->tab_label)->label);
GTK_LABEL (doc->tab_label)->label, GEDIT_ID);
gtk_window_set_title (GTK_WINDOW (window->window), title);
g_free (title);
......
......@@ -100,14 +100,21 @@ extern gboolean gE_Plugin_Load(gE_Plugin_Object *, gint);
* Please do not use other functions than the ones declared here.
*/
extern int gE_plugin_document_create(gint, gchar *);
extern void gE_plugin_text_append(gint, gchar *, gint);
extern void gE_plugin_text_insert(gint, gchar *, gint, gint);
extern char *gE_plugin_text_get(gint);
extern gchar *gE_plugin_text_get_selected_text (gint);
extern void gE_plugin_text_set_selected_text (gint, gchar *);
extern int gE_plugin_document_create(gint, gchar *);
extern void gE_plugin_document_show(gint);
extern int gE_plugin_document_current(gint);
extern char *gE_plugin_document_filename(gint);
extern int gE_plugin_document_open(gint, gchar *);
extern gboolean gE_plugin_document_close(gint);
extern gint gE_plugin_document_get_position (gint);
extern selection_range gE_plugin_document_get_selection (gint);
extern void gE_plugin_set_auto_indent(gint, gint);
extern void gE_plugin_set_status_bar(gint, gint);
extern void gE_plugin_set_word_wrap(gint, gint);
......@@ -123,7 +130,6 @@ extern void gE_plugin_set_split_screen(gint, gint);
extern void gE_plugin_set_scroll_ball(gint, gint);
#endif
extern char *gE_plugin_text_get(gint);
extern gboolean gE_plugin_program_quit(void);
extern GtkText *gE_plugin_get_widget(gint);
extern int gE_plugin_create_widget(gint, gchar *,
......
......@@ -81,10 +81,10 @@ start_plugin(GtkWidget * widget, gE_data * data)
callbacks.document.open = NULL;
callbacks.document.close = NULL;
#endif
callbacks.text.get_selected_text = NULL;
callbacks.text.set_selected_text = NULL;
callbacks.document.get_position = NULL;
callbacks.document.get_selection = NULL;
callbacks.text.get_selected_text = gE_plugin_text_get_selected_text;
callbacks.text.set_selected_text = gE_plugin_text_set_selected_text;
callbacks.document.get_position = gE_plugin_document_get_position;
callbacks.document.get_selection = gE_plugin_document_get_selection;
#ifdef WITH_GMODULE_PLUGINS
if (info->type == PLUGIN_GMODULE) {
......@@ -149,12 +149,9 @@ add_plugins_to_window(plugin_info * info, gE_window * window)
/* --- Direct interface to the plugins API --- */
int
gE_plugin_document_create(gint context, gchar * title)
{
return *(int *) g_hash_table_lookup(doc_pointer_to_int, gE_document_new((gE_window *) g_hash_table_lookup(win_int_to_pointer, &context)));
}
/* Text related functions */
void
gE_plugin_text_insert(gint docid, gchar * buffer, gint length, gint position)
{
......@@ -183,6 +180,57 @@ gE_plugin_text_append(gint docid, gchar * buffer, gint length)
document->changed = 1;
}
char *
gE_plugin_text_get(gint docid)
{
gE_document *document = (gE_document *) g_hash_table_lookup(doc_int_to_pointer, &docid);
return gtk_editable_get_chars(GTK_EDITABLE(document->text), 0, -1);
}
gchar *
gE_plugin_text_get_selected_text (gint docid)
{
gE_document *document = (gE_document *) g_hash_table_lookup (doc_int_to_pointer, &docid);
return gtk_editable_get_chars (GTK_EDITABLE (document->text),
GTK_EDITABLE (document->text)->selection_start_pos,
GTK_EDITABLE (document->text)->selection_end_pos);
}
void
gE_plugin_text_set_selected_text (gint docid, gchar *text)
{
GtkEditable *editable;
selection_range selection;
gE_document *document = (gE_document *) g_hash_table_lookup (doc_int_to_pointer, &docid);
g_return_if_fail (document != NULL);
editable = GTK_EDITABLE (document->text);
if (editable->selection_start_pos <= editable->selection_end_pos)
{
selection.start = editable->selection_start_pos;
selection.end = editable->selection_end_pos;
}
else
{
selection.start = editable->selection_end_pos;
selection.end = editable->selection_start_pos;
}
gtk_editable_delete_selection (editable);
selection.end = selection.start;
gtk_editable_insert_text (editable, text, strlen (text),&selection.end);
gtk_editable_select_region (editable, selection.start, selection.end);
}
/* Document related functions */
int
gE_plugin_document_create(gint context, gchar * title)
{
return *(int *) g_hash_table_lookup(doc_pointer_to_int, gE_document_new((gE_window *) g_hash_table_lookup(win_int_to_pointer, &context)));
}
void
gE_plugin_document_show(gint docid)
{
......@@ -241,6 +289,39 @@ gE_plugin_document_close(gint docid)
return flag;
}
gint
gE_plugin_document_get_position (gint docid)
{
gE_document *document = (gE_document *) g_hash_table_lookup (doc_int_to_pointer, &docid);
g_return_val_if_fail (document != NULL, 0);
return GTK_EDITABLE(document->text)->current_pos;
}
selection_range
gE_plugin_document_get_selection (gint docid)
{
GtkEditable *editable;
selection_range selection;
gE_document *document = (gE_document *) g_hash_table_lookup (doc_int_to_pointer, &docid);
selection.start = 0;
selection.end = 0;
g_return_val_if_fail (document != NULL, selection);
editable = GTK_EDITABLE (document->text);
if (editable->selection_start_pos <= editable->selection_end_pos)
{
selection.start = editable->selection_start_pos;
selection.end = editable->selection_end_pos;
}
else
{
selection.start = editable->selection_end_pos;
selection.end = editable->selection_start_pos;
}
return selection;
}
/* Misc UI related functions */
void
gE_plugin_set_auto_indent(gint docid, gint auto_indent)
{
......@@ -304,13 +385,7 @@ gE_plugin_set_scroll_ball(gint docid, gint scroll_ball)
#endif
char *
gE_plugin_text_get(gint docid)
{
gE_document *document = (gE_document *) g_hash_table_lookup(doc_int_to_pointer, &docid);
return gtk_editable_get_chars(GTK_EDITABLE(document->text), 0, -1);
}
/* Program Related functions */
gboolean
gE_plugin_program_quit()
......
......@@ -405,18 +405,18 @@ auto_indent_cb(GtkWidget *text, GdkEventKey *event, gE_window *window)
static void
line_pos_cb(GtkWidget *w, gE_data *data)
{
static char line [32];
/*static char line [32];*/
static char col [32];
GtkWidget *text = data->temp2;
int x;
/*x = GTK_TEXT(text)->current_line->data;*/
sprintf (line,"%d", GTK_TEXT(text)->cursor_pos_y/13);
/*sprintf (line,"%d", GTK_TEXT(text)->cursor_pos_y/13);*/
/*sprintf(line,"%d", x);*/
sprintf (col, "%d", GTK_TEXT(text)->cursor_pos_x/7);
gtk_label_set (GTK_LABEL(data->window->line_label), line);
/*gtk_label_set (GTK_LABEL(data->window->line_label), line);*/
gtk_label_set (GTK_LABEL(data->window->col_label), col);
}
......@@ -636,6 +636,7 @@ void
close_doc_execute(gE_document *opt_doc, gpointer cbdata)
{
int num, numdoc;
gchar *title;
GtkNotebook *nb;
gE_window *w;
gE_document *doc;
......@@ -697,6 +698,15 @@ close_doc_execute(gE_document *opt_doc, gpointer cbdata)
flw_append_entry(w, doc,
g_list_length(nb->children) - 1, NULL);
}
/* Set the title of the window to Current Document - GEDIT_ID */
title = g_malloc0(strlen(GEDIT_ID) +
strlen(GTK_LABEL(gE_document_current(w)->tab_label)->label) + 4);
sprintf(title, "%s - %s",
GTK_LABEL(gE_document_current(w)->tab_label)->label,
GEDIT_ID);
gtk_window_set_title(GTK_WINDOW(w->window), title);
g_free(title);
} /* close_doc_execute */
......
......@@ -146,14 +146,14 @@ gE_about_box(GtkWidget *w, gpointer cbdata)
void gE_about_box(GtkWidget *w, gpointer cbdata)
{
GtkWidget *about;
gchar *authors[] = {
const gchar *authors[] = {
"Alex Roberts",
"Evan Lawrence",
"http://gedit.pn.org",
NULL
};
about = gnome_about_new (GEDIT_ID, NULL,
about = gnome_about_new ("gEdit", "0.4.8",
"(C) 1998 Alex Roberts and Evan Lawrence",
authors,
_("gEdit is a small and lightweight text editor for GNOME/Gtk+"),
......
......@@ -161,19 +161,8 @@ gE_window_new(void)
gtk_misc_set_alignment(GTK_MISC(w->statusbar), 0.0, 0.5);
/* line and column indicators */
tmp = gtk_button_new_with_label("Line");
gtk_signal_connect(GTK_OBJECT(tmp), "clicked",
GTK_SIGNAL_FUNC(goto_line_cb), w);
GTK_WIDGET_UNSET_FLAGS(tmp, GTK_CAN_FOCUS);
gtk_box_pack_start(GTK_BOX(box2), tmp, FALSE, FALSE, 1);
gtk_widget_show(tmp);
w->line_label = gtk_label_new("1");
gtk_box_pack_start(GTK_BOX(box2), w->line_label, FALSE, FALSE, 1);
gtk_widget_set_usize(w->line_label, 40, 0);
gtk_widget_show(w->line_label);
tmp = gtk_label_new("Column");
tmp = gtk_label_new("Column:");
gtk_box_pack_start(GTK_BOX(box2), tmp, FALSE, FALSE, 1);
gtk_widget_show(tmp);
......@@ -182,6 +171,13 @@ gE_window_new(void)
gtk_widget_set_usize(w->col_label, 40, 0);
gtk_widget_show(w->col_label);
tmp = gtk_button_new_with_label("Line");
gtk_signal_connect(GTK_OBJECT(tmp), "clicked",
GTK_SIGNAL_FUNC(goto_line_cb), w);
GTK_WIDGET_UNSET_FLAGS(tmp, GTK_CAN_FOCUS);
gtk_box_pack_start(GTK_BOX(box2), tmp, FALSE, FALSE, 0);
gtk_widget_show(tmp);
w->statusbox = box2;
/* finish up */
......
......@@ -198,7 +198,7 @@ gE_file_open(gE_window *w, gE_document *doc, gchar *fname)
title = g_malloc(strlen(GEDIT_ID) +
strlen(GTK_LABEL(doc->tab_label)->label) + 4);
sprintf(title, "%s - %s",
GEDIT_ID, GTK_LABEL (doc->tab_label)->label);
GTK_LABEL (doc->tab_label)->label, GEDIT_ID);
gtk_window_set_title(GTK_WINDOW (w->window), title);
g_free (title);
......@@ -274,7 +274,7 @@ gE_file_save(gE_window *window, gE_document *doc, gchar *fname)
title = g_malloc0(strlen(GEDIT_ID) +
strlen(GTK_LABEL(doc->tab_label)->label) + 4);
sprintf(title, "%s - %s",
GEDIT_ID, GTK_LABEL (doc->tab_label)->label);
GTK_LABEL (doc->tab_label)->label, GEDIT_ID);
gtk_window_set_title (GTK_WINDOW (window->window), title);
g_free (title);
......
......@@ -100,14 +100,21 @@ extern gboolean gE_Plugin_Load(gE_Plugin_Object *, gint);
* Please do not use other functions than the ones declared here.
*/
extern int gE_plugin_document_create(gint, gchar *);
extern void gE_plugin_text_append(gint, gchar *, gint);
extern void gE_plugin_text_insert(gint, gchar *, gint, gint);
extern char *gE_plugin_text_get(gint);
extern gchar *gE_plugin_text_get_selected_text (gint);
extern void gE_plugin_text_set_selected_text (gint, gchar *);
extern int gE_plugin_document_create(gint, gchar *);
extern void gE_plugin_document_show(gint);
extern int gE_plugin_document_current(gint);
extern char *gE_plugin_document_filename(gint);
extern int gE_plugin_document_open(gint, gchar *);
extern gboolean gE_plugin_document_close(gint);
extern gint gE_plugin_document_get_position (gint);
extern selection_range gE_plugin_document_get_selection (gint);
extern void gE_plugin_set_auto_indent(gint, gint);
extern void gE_plugin_set_status_bar(gint, gint);
extern void gE_plugin_set_word_wrap(gint, gint);
......@@ -123,7 +130,6 @@ extern void gE_plugin_set_split_screen(gint, gint);
extern void gE_plugin_set_scroll_ball(gint, gint);
#endif
extern char *gE_plugin_text_get(gint);
extern gboolean gE_plugin_program_quit(void);
extern GtkText *gE_plugin_get_widget(gint);
extern int gE_plugin_create_widget(gint, gchar *,
......
......@@ -81,10 +81,10 @@ start_plugin(GtkWidget * widget, gE_data * data)
callbacks.document.open = NULL;
callbacks.document.close = NULL;
#endif
callbacks.text.get_selected_text = NULL;
callbacks.text.set_selected_text = NULL;
callbacks.document.get_position = NULL;
callbacks.document.get_selection = NULL;
callbacks.text.get_selected_text = gE_plugin_text_get_selected_text;
callbacks.text.set_selected_text = gE_plugin_text_set_selected_text;
callbacks.document.get_position = gE_plugin_document_get_position;
callbacks.document.get_selection = gE_plugin_document_get_selection;
#ifdef WITH_GMODULE_PLUGINS
if (info->type == PLUGIN_GMODULE) {
......@@ -149,12 +149,9 @@ add_plugins_to_window(plugin_info * info, gE_window * window)
/* --- Direct interface to the plugins API --- */
int
gE_plugin_document_create(gint context, gchar * title)
{
return *(int *) g_hash_table_lookup(doc_pointer_to_int, gE_document_new((gE_window *) g_hash_table_lookup(win_int_to_pointer, &context)));
}
/* Text related functions */
void
gE_plugin_text_insert(gint docid, gchar * buffer, gint length, gint position)
{
......@@ -183,6 +180,57 @@ gE_plugin_text_append(gint docid, gchar * buffer, gint length)
document->changed = 1;
}
char *
gE_plugin_text_get(gint docid)
{
gE_document *document = (gE_document *) g_hash_table_lookup(doc_int_to_pointer, &docid);
return gtk_editable_get_chars(GTK_EDITABLE(document->text), 0, -1);
}
gchar *
gE_plugin_text_get_selected_text (gint docid)
{
gE_document *document = (gE_document *) g_hash_table_lookup (doc_int_to_pointer, &docid);
return gtk_editable_get_chars (GTK_EDITABLE (document->text),
GTK_EDITABLE (document->text)->selection_start_pos,
GTK_EDITABLE (document->text)->selection_end_pos);
}
void
gE_plugin_text_set_selected_text (gint docid, gchar *text)
{
GtkEditable *editable;
selection_range selection;
gE_document *document = (gE_document *) g_hash_table_lookup (doc_int_to_pointer, &docid);
g_return_if_fail (document != NULL);
editable = GTK_EDITABLE (document->text);
if (editable->selection_start_pos <= editable->selection_end_pos)
{
selection.start = editable->selection_start_pos;
selection.end = editable->selection_end_pos;
}
else
{
selection.start = editable->selection_end_pos;
selection.end = editable->selection_start_pos;
}
gtk_editable_delete_selection (editable);
selection.end = selection.start;
gtk_editable_insert_text (editable, text, strlen (text),&selection.end);
gtk_editable_select_region (editable, selection.start, selection.end);
}
/* Document related functions */
int
gE_plugin_document_create(gint context, gchar * title)
{
return *(int *) g_hash_table_lookup(doc_pointer_to_int, gE_document_new((gE_window *) g_hash_table_lookup(win_int_to_pointer, &context)));
}
void
gE_plugin_document_show(gint docid)
{
......@@ -241,6 +289,39 @@ gE_plugin_document_close(gint docid)
return flag;
}
gint
gE_plugin_document_get_position (gint docid)
{
gE_document *document = (gE_document *) g_hash_table_lookup (doc_int_to_pointer, &docid);
g_return_val_if_fail (document != NULL, 0);
return GTK_EDITABLE(document->text)->current_pos;
}
selection_range
gE_plugin_document_get_selection (gint docid)
{
GtkEditable *editable;
selection_range selection;
gE_document *document = (gE_document *) g_hash_table_lookup (doc_int_to_pointer, &docid);
selection.start = 0;
selection.end = 0;
g_return_val_if_fail (document != NULL, selection);
editable = GTK_EDITABLE (document->text);
if (editable->selection_start_pos <= editable->selection_end_pos)
{
selection.start = editable->selection_start_pos;
selection.end = editable->selection_end_pos;
}
else
{
selection.start = editable->selection_end_pos;
selection.end = editable->selection_start_pos;
}
return selection;
}
/* Misc UI related functions */
void
gE_plugin_set_auto_indent(gint docid, gint auto_indent)
{
......@@ -304,13 +385,7 @@ gE_plugin_set_scroll_ball(gint docid, gint scroll_ball)
#endif
char *
gE_plugin_text_get(gint docid)
{
gE_document *document = (gE_document *) g_hash_table_lookup(doc_int_to_pointer, &docid);
return gtk_editable_get_chars(GTK_EDITABLE(document->text), 0, -1);
}
/* Program Related functions */
gboolean
gE_plugin_program_quit()
......
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