geany  1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

splitwindow.c
Go to the documentation of this file.
1/*
2 * splitwindow.c - this file is part of Geany, a fast and lightweight IDE
3 *
4 * Copyright 2008 The Geany contributors
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21/* Split Window plugin. */
22
23#ifdef HAVE_CONFIG_H
24# include "config.h"
25#endif
26
27#include "geanyplugin.h"
28#include "gtkcompat.h"
29#include <string.h>
30
31
33PLUGIN_SET_INFO(_("Split Window"), _("Splits the editor view into two windows."),
34 VERSION, _("The Geany developer team"))
35
36
39
40
41/* Keybinding(s) */
42enum
43{
48};
49
51{
56};
57
58static struct
59{
60 GtkWidget *main;
61 GtkWidget *horizontal;
62 GtkWidget *vertical;
63 GtkWidget *unsplit;
64}
66
67static enum State plugin_state;
68
69
70typedef struct EditWindow
71{
72 GeanyEditor *editor; /* original editor for split view */
73 ScintillaObject *sci; /* new editor widget */
74 GtkWidget *vbox;
75 GtkWidget *name_label;
76}
78
80
81
82static void on_unsplit(GtkMenuItem *menuitem, gpointer user_data);
83
84
85/* line numbers visibility */
86static void set_line_numbers(ScintillaObject * sci, gboolean set)
87{
88 if (set)
89 {
90 gchar tmp_str[15];
92 gint width;
93
94 g_snprintf(tmp_str, 15, "_%d", len);
97 scintilla_send_message(sci, SCI_SETMARGINSENSITIVEN, 0, FALSE); /* use default behaviour */
98 }
99 else
100 {
102 }
103}
104
105
106static void on_sci_notify(ScintillaObject *sci, gint param,
107 SCNotification *nt, gpointer data)
108{
109 gint line;
110
111 switch (nt->nmhdr.code)
112 {
113 /* adapted from editor.c: on_margin_click() */
114 case SCN_MARGINCLICK:
115 /* left click to marker margin toggles marker */
116 if (nt->margin == 1)
117 {
118 gboolean set;
119 gint marker = 1;
120
123 if (!set)
125 else
127 }
128 /* left click on the folding margin to toggle folding state of current line */
129 if (nt->margin == 2)
130 {
133 }
134 break;
135
136 default: break;
137 }
138}
139
140
141static void sync_to_current(ScintillaObject *sci, ScintillaObject *current)
142{
143 gpointer sdoc;
144 gint pos;
145
146 /* set the new sci widget to view the existing Scintilla document */
147 sdoc = (gpointer) scintilla_send_message(current, SCI_GETDOCPOINTER, 0, 0);
149
151 pos = sci_get_current_position(current);
153
154 /* override some defaults */
155 set_line_numbers(sci, geany->editor_prefs->show_linenumber_margin);
156 /* marker margin */
159 if (!geany->editor_prefs->folding)
161}
162
163
164static void set_editor(EditWindow *editwin, GeanyEditor *editor)
165{
166 editwin->editor = editor;
167
168 /* first destroy any widget, otherwise its signals will have an
169 * invalid document as user_data */
170 if (editwin->sci != NULL)
171 gtk_widget_destroy(GTK_WIDGET(editwin->sci));
172
173 editwin->sci = editor_create_widget(editor);
174 gtk_widget_show(GTK_WIDGET(editwin->sci));
175 gtk_box_pack_start(GTK_BOX(editwin->vbox), GTK_WIDGET(editwin->sci), TRUE, TRUE, 0);
176
177 sync_to_current(editwin->sci, editor->sci);
178
179 scintilla_send_message(editwin->sci, SCI_USEPOPUP, 1, 0);
180 /* for margin events */
181 g_signal_connect(editwin->sci, "sci-notify",
182 G_CALLBACK(on_sci_notify), NULL);
183
184 gtk_label_set_text(GTK_LABEL(editwin->name_label), DOC_FILENAME(editor->document));
185}
186
187
188static void set_state(enum State id)
189{
190 gtk_widget_set_sensitive(menu_items.horizontal,
192 gtk_widget_set_sensitive(menu_items.vertical,
194 gtk_widget_set_sensitive(menu_items.unsplit,
195 id != STATE_UNSPLIT);
196
197 plugin_state = id;
198}
199
200
201/* Create a GtkToolButton with stock icon, label and tooltip.
202 * @param label can be NULL to use stock label text. @a label can contain underscores,
203 * which will be removed.
204 * @param tooltip can be NULL to use label text (useful for GTK_TOOLBAR_ICONS). */
205static GtkWidget *ui_tool_button_new(const gchar *stock_id, const gchar *label, const gchar *tooltip)
206{
207 GtkToolItem *item;
208 gchar *dupl = NULL;
209
210 if (stock_id && !label)
211 {
212 label = ui_lookup_stock_label(stock_id);
213 }
214 dupl = utils_str_remove_chars(g_strdup(label), "_");
215 label = dupl;
216
217 item = gtk_tool_button_new(NULL, label);
218 if (stock_id)
219 gtk_tool_button_set_stock_id(GTK_TOOL_BUTTON(item), stock_id);
220
221 if (!tooltip)
222 tooltip = label;
223 if (tooltip)
224 gtk_widget_set_tooltip_text(GTK_WIDGET(item), tooltip);
225
226 g_free(dupl);
227 return GTK_WIDGET(item);
228}
229
230
231static void on_refresh(void)
232{
234
235 g_return_if_fail(doc);
236 g_return_if_fail(edit_window.sci);
237
239}
240
241
242static void on_doc_menu_item_clicked(gpointer item, GeanyDocument *doc)
243{
244 if (doc->is_valid)
246}
247
248
249static void on_doc_show_menu(GtkMenuToolButton *button, GtkMenu *menu)
250{
251 /* clear the old menu items */
252 gtk_container_foreach(GTK_CONTAINER(menu), (GtkCallback) gtk_widget_destroy, NULL);
253
255 G_CALLBACK(on_doc_menu_item_clicked));
256}
257
258
259/* Blocks the ::show-menu signal if the menu's parent toggle button was inactive in the previous run.
260 * This is a hack to workaround https://bugzilla.gnome.org/show_bug.cgi?id=769287
261 * and should NOT be used for any other version than 3.15.9 to 3.21.4, although the code tries and
262 * not block a legitimate signal in case the GTK version in use has been patched */
263static void show_menu_gtk316_fix(GtkMenuToolButton *button, gpointer data)
264{
265 /* we assume only a single menu can popup at once, so reentrency isn't an issue.
266 * if it was, we could use custom data on the button, but it shouldn't be required */
267 static gboolean block_next = FALSE;
268
269 if (block_next)
270 {
271 g_signal_stop_emission_by_name(button, "show-menu");
272 block_next = FALSE;
273 }
274 else
275 {
276 GtkWidget *menu = gtk_menu_tool_button_get_menu(button);
277 GtkWidget *parent = gtk_menu_get_attach_widget(GTK_MENU(menu));
278
279 if (parent && GTK_IS_TOGGLE_BUTTON(parent) && ! gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(parent)))
280 block_next = TRUE;
281 }
282}
283
284
285static GtkWidget *create_toolbar(void)
286{
287 GtkWidget *toolbar, *item;
288 GtkToolItem *tool_item;
289
290 toolbar = gtk_toolbar_new();
291 gtk_toolbar_set_icon_size(GTK_TOOLBAR(toolbar), GTK_ICON_SIZE_MENU);
292 gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS);
293
294 tool_item = gtk_menu_tool_button_new(NULL, NULL);
295 gtk_tool_button_set_stock_id(GTK_TOOL_BUTTON(tool_item), GTK_STOCK_JUMP_TO);
296 item = (GtkWidget*)tool_item;
297 gtk_widget_set_tooltip_text(item, _("Show the current document"));
298 gtk_container_add(GTK_CONTAINER(toolbar), item);
299 g_signal_connect(item, "clicked", G_CALLBACK(on_refresh), NULL);
300
301 item = gtk_menu_new();
302 gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON(tool_item), item);
303 /* hack for https://bugzilla.gnome.org/show_bug.cgi?id=769287 */
304 if (! gtk_check_version(3, 15, 9) && gtk_check_version(3, 21, 4+1))
305 g_signal_connect(tool_item, "show-menu", G_CALLBACK(show_menu_gtk316_fix), NULL);
306 g_signal_connect(tool_item, "show-menu", G_CALLBACK(on_doc_show_menu), item);
307
308 tool_item = gtk_tool_item_new();
309 gtk_tool_item_set_expand(tool_item, TRUE);
310 gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(tool_item));
311
312 item = gtk_label_new(NULL);
313 gtk_label_set_ellipsize(GTK_LABEL(item), PANGO_ELLIPSIZE_START);
314 gtk_container_add(GTK_CONTAINER(tool_item), item);
315 edit_window.name_label = item;
316
317 item = ui_tool_button_new(GTK_STOCK_CLOSE, _("_Unsplit"), NULL);
318 gtk_container_add(GTK_CONTAINER(toolbar), item);
319 g_signal_connect(item, "clicked", G_CALLBACK(on_unsplit), NULL);
320
321 return toolbar;
322}
323
324
325static void split_view(gboolean horizontal)
326{
327 GtkWidget *notebook = geany_data->main_widgets->notebook;
328 GtkWidget *parent = gtk_widget_get_parent(notebook);
329 GtkWidget *pane, *toolbar, *box, *splitwin_notebook;
331 gint width = gtk_widget_get_allocated_width(notebook) / 2;
332 gint height = gtk_widget_get_allocated_height(notebook) / 2;
333
334 g_return_if_fail(doc);
335 g_return_if_fail(edit_window.editor == NULL);
336
338
339 g_object_ref(notebook);
340 gtk_container_remove(GTK_CONTAINER(parent), notebook);
341
342 pane = gtk_paned_new(horizontal ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL);
343 gtk_container_add(GTK_CONTAINER(parent), pane);
344
345 gtk_container_add(GTK_CONTAINER(pane), notebook);
346 g_object_unref(notebook);
347
348 box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
349 toolbar = create_toolbar();
350 gtk_box_pack_start(GTK_BOX(box), toolbar, FALSE, FALSE, 0);
351 edit_window.vbox = box;
352
353 /* used just to make the split window look the same as the main editor */
354 splitwin_notebook = gtk_notebook_new();
355 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(splitwin_notebook), FALSE);
356 gtk_notebook_append_page(GTK_NOTEBOOK(splitwin_notebook), box, NULL);
357 gtk_container_add(GTK_CONTAINER(pane), splitwin_notebook);
358
360
361 if (horizontal)
362 {
363 gtk_paned_set_position(GTK_PANED(pane), width);
364 }
365 else
366 {
367 gtk_paned_set_position(GTK_PANED(pane), height);
368 }
370}
371
372
373static void on_split_horizontally(GtkMenuItem *menuitem, gpointer user_data)
374{
375 split_view(TRUE);
376}
377
378
379static void on_split_vertically(GtkMenuItem *menuitem, gpointer user_data)
380{
381 split_view(FALSE);
382}
383
384
385static void on_unsplit(GtkMenuItem *menuitem, gpointer user_data)
386{
387 GtkWidget *notebook = geany_data->main_widgets->notebook;
388 GtkWidget *pane = gtk_widget_get_parent(notebook);
389 GtkWidget *parent = gtk_widget_get_parent(pane);
390
392
393 g_return_if_fail(edit_window.editor);
394
395 g_object_ref(notebook);
396 gtk_container_remove(GTK_CONTAINER(pane), notebook);
397
398 gtk_widget_destroy(pane);
401
402 gtk_container_add(GTK_CONTAINER(parent), notebook);
403 g_object_unref(notebook);
404}
405
406
407static void kb_activate(guint key_id)
408{
409 switch (key_id)
410 {
413 split_view(TRUE);
414 break;
417 split_view(FALSE);
418 break;
419 case KB_SPLIT_UNSPLIT:
422 break;
423 }
424}
425
426
428{
429 GtkWidget *item, *menu;
430 GeanyKeyGroup *key_group;
431
432 menu_items.main = item = gtk_menu_item_new_with_mnemonic(_("_Split Window"));
433 gtk_menu_shell_append(GTK_MENU_SHELL(geany_data->main_widgets->tools_menu), item);
435
436 menu = gtk_menu_new();
437 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_items.main), menu);
438
439 menu_items.horizontal = item =
440 gtk_menu_item_new_with_mnemonic(_("_Side by Side"));
441 g_signal_connect(item, "activate", G_CALLBACK(on_split_horizontally), NULL);
442 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
443
444 menu_items.vertical = item =
445 gtk_menu_item_new_with_mnemonic(_("_Top and Bottom"));
446 g_signal_connect(item, "activate", G_CALLBACK(on_split_vertically), NULL);
447 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
448
449 menu_items.unsplit = item =
450 gtk_menu_item_new_with_mnemonic(_("_Unsplit"));
451 g_signal_connect(item, "activate", G_CALLBACK(on_unsplit), NULL);
452 gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
453
455
457
458 /* setup keybindings */
459 key_group = plugin_set_key_group(geany_plugin, "split_window", KB_COUNT, NULL);
461 0, 0, "split_horizontal", _("Side by Side"), menu_items.horizontal);
463 0, 0, "split_vertical", _("Top and Bottom"), menu_items.vertical);
465 0, 0, "split_unsplit", _("_Unsplit"), menu_items.unsplit);
466}
467
468
469static gboolean do_select_current(gpointer data)
470{
471 GeanyDocument *doc;
472
473 /* guard out for the unlikely case we get called after another unsplitting */
475 return FALSE;
476
477 doc = document_get_current();
478 if (doc)
480 else
482
483 return FALSE;
484}
485
486
487static void on_document_close(GObject *obj, GeanyDocument *doc, gpointer user_data)
488{
489 if (doc->editor == edit_window.editor)
490 {
491 /* select current or unsplit in IDLE time, so the tab has changed */
493 }
494}
495
496
497static void on_document_save(GObject *obj, GeanyDocument *doc, gpointer user_data)
498{
499 /* update filename */
500 if (doc->editor == edit_window.editor)
501 gtk_label_set_text(GTK_LABEL(edit_window.name_label), DOC_FILENAME(doc));
502}
503
504
505static void on_document_filetype_set(GObject *obj, GeanyDocument *doc,
506 GeanyFiletype *filetype_old, gpointer user_data)
507{
508 /* update styles */
509 if (edit_window.editor == doc->editor)
511}
512
513
515{
516 { "document-close", (GCallback) &on_document_close, FALSE, NULL },
517 { "document-save", (GCallback) &on_document_save, FALSE, NULL },
518 { "document-filetype-set", (GCallback) &on_document_filetype_set, FALSE, NULL },
519 { NULL, NULL, FALSE, NULL }
520};
521
522
524{
527
528 gtk_widget_destroy(menu_items.main);
529}
sptr_t scintilla_send_message(ScintillaObject *sci, unsigned int iMessage, uptr_t wParam, sptr_t lParam)
intptr_t sptr_t
Definition: Scintilla.h:35
#define SCI_SETDOCPOINTER
Definition: Scintilla.h:694
#define SCI_GETDOCPOINTER
Definition: Scintilla.h:693
#define SCI_GETLINECOUNT
Definition: Scintilla.h:426
#define SCI_TOGGLEFOLD
Definition: Scintilla.h:508
#define SCI_SETMARGINSENSITIVEN
Definition: Scintilla.h:189
#define SCN_MARGINCLICK
Definition: Scintilla.h:1136
#define SCI_TEXTWIDTH
Definition: Scintilla.h:589
#define SCI_SETMARGINWIDTHN
Definition: Scintilla.h:185
#define SCI_USEPOPUP
Definition: Scintilla.h:716
#define SCI_GETMARGINWIDTHN
Definition: Scintilla.h:186
#define STYLE_LINENUMBER
Definition: Scintilla.h:198
const gchar * label
Definition: build.c:2676
GeanyDocument * document_get_current(void)
Finds the current document.
Definition: document.c:371
#define DOC_FILENAME(doc)
Returns the filename of the document passed or GEANY_STRING_UNTITLED (e.g.
Definition: document.h:170
ScintillaObject * editor_create_widget(GeanyEditor *editor)
Creates a new Scintilla GtkWidget based on the settings for editor.
Definition: editor.c:4984
ScintillaObject * sci
Definition: editor.c:88
gboolean set
Definition: editor.c:84
gint pos
Definition: editor.c:87
vString * line
Definition: geany_cobol.c:133
Single include for plugins.
void highlighting_set_styles(ScintillaObject *sci, GeanyFiletype *ft)
Sets up highlighting and other visual settings.
GeanyKeyBinding * keybindings_set_item(GeanyKeyGroup *group, gsize key_id, GeanyKeyCallback callback, guint key, GdkModifierType mod, const gchar *kf_name, const gchar *label, GtkWidget *menu_item)
<simplesect kind="geany:skip"></simplesect> Fills a GeanyKeyBinding struct item.
Definition: keybindings.c:171
#define GEANY_API_VERSION
The Application Programming Interface (API) version, incremented whenever any plugin data types are m...
Definition: plugindata.h:61
#define PLUGIN_SET_INFO(p_name, p_description, p_version, p_author)
Sets the plugin name and some other basic information about a plugin.
Definition: plugindata.h:117
#define PLUGIN_VERSION_CHECK(api_required)
Defines a function to check the plugin is safe to load.
Definition: plugindata.h:83
#define geany
Simple macro for geany_data that reduces typing.
Definition: plugindata.h:225
guint plugin_idle_add(GeanyPlugin *plugin, GSourceFunc function, gpointer data)
<simplesect kind="geany:skip"></simplesect> Adds a GLib main loop IDLE callback that will be removed ...
Definition: pluginutils.c:314
GeanyKeyGroup * plugin_set_key_group(GeanyPlugin *plugin, const gchar *section_name, gsize count, GeanyKeyGroupCallback callback)
<simplesect kind="geany:skip"></simplesect> Sets up or resizes a keybinding group for the plugin.
Definition: pluginutils.c:331
#define NULL
Definition: rbtree.h:150
void sci_set_marker_at_line(ScintillaObject *sci, gint line_number, gint marker)
Sets a line marker.
Definition: sciwrappers.c:388
gboolean sci_is_marker_set_at_line(ScintillaObject *sci, gint line, gint marker)
Checks if a line has a marker set.
Definition: sciwrappers.c:411
gint sci_get_current_position(ScintillaObject *sci)
Gets the cursor position.
Definition: sciwrappers.c:507
void sci_delete_marker_at_line(ScintillaObject *sci, gint line_number, gint marker)
Deletes a line marker.
Definition: sciwrappers.c:399
void sci_set_current_position(ScintillaObject *sci, gint position, gboolean scroll_to_caret)
Sets the cursor position.
Definition: sciwrappers.c:529
gint sci_get_line_from_position(ScintillaObject *sci, gint position)
Gets the line number from position.
Definition: sciwrappers.c:469
static void on_split_horizontally(GtkMenuItem *menuitem, gpointer user_data)
Definition: splitwindow.c:373
GtkWidget * vertical
Definition: splitwindow.c:62
static struct @39 menu_items
GtkWidget * unsplit
Definition: splitwindow.c:63
static void on_unsplit(GtkMenuItem *menuitem, gpointer user_data)
Definition: splitwindow.c:385
static void on_sci_notify(ScintillaObject *sci, gint param, SCNotification *nt, gpointer data)
Definition: splitwindow.c:106
static EditWindow edit_window
Definition: splitwindow.c:79
static void set_editor(EditWindow *editwin, GeanyEditor *editor)
Definition: splitwindow.c:164
static gboolean do_select_current(gpointer data)
Definition: splitwindow.c:469
static void on_document_filetype_set(GObject *obj, GeanyDocument *doc, GeanyFiletype *filetype_old, gpointer user_data)
Definition: splitwindow.c:505
State
Definition: splitwindow.c:51
@ STATE_UNSPLIT
Definition: splitwindow.c:54
@ STATE_SPLIT_VERTICAL
Definition: splitwindow.c:53
@ STATE_SPLIT_HORIZONTAL
Definition: splitwindow.c:52
@ STATE_COUNT
Definition: splitwindow.c:55
GeanyPlugin * geany_plugin
Definition: splitwindow.c:38
struct EditWindow EditWindow
void plugin_cleanup(void)
Called before unloading the plugin.
Definition: splitwindow.c:523
static void on_document_close(GObject *obj, GeanyDocument *doc, gpointer user_data)
Definition: splitwindow.c:487
PluginCallback plugin_callbacks[]
Definition: splitwindow.c:514
@ KB_SPLIT_VERTICAL
Definition: splitwindow.c:45
@ KB_SPLIT_HORIZONTAL
Definition: splitwindow.c:44
@ KB_SPLIT_UNSPLIT
Definition: splitwindow.c:46
@ KB_COUNT
Definition: splitwindow.c:47
static void on_doc_show_menu(GtkMenuToolButton *button, GtkMenu *menu)
Definition: splitwindow.c:249
static void split_view(gboolean horizontal)
Definition: splitwindow.c:325
static GtkWidget * create_toolbar(void)
Definition: splitwindow.c:285
GtkWidget * horizontal
Definition: splitwindow.c:61
static void set_line_numbers(ScintillaObject *sci, gboolean set)
Definition: splitwindow.c:86
static void on_document_save(GObject *obj, GeanyDocument *doc, gpointer user_data)
Definition: splitwindow.c:497
static void on_split_vertically(GtkMenuItem *menuitem, gpointer user_data)
Definition: splitwindow.c:379
static GtkWidget * ui_tool_button_new(const gchar *stock_id, const gchar *label, const gchar *tooltip)
Definition: splitwindow.c:205
void plugin_init(GeanyData *data)
Called after loading the plugin.
Definition: splitwindow.c:427
static void set_state(enum State id)
Definition: splitwindow.c:188
GeanyData * geany_data
Definition: splitwindow.c:37
static void kb_activate(guint key_id)
Definition: splitwindow.c:407
static void on_refresh(void)
Definition: splitwindow.c:231
static void sync_to_current(ScintillaObject *sci, ScintillaObject *current)
Definition: splitwindow.c:141
GtkWidget * main
Definition: splitwindow.c:60
static enum State plugin_state
Definition: splitwindow.c:67
static void show_menu_gtk316_fix(GtkMenuToolButton *button, gpointer data)
Definition: splitwindow.c:263
static void on_doc_menu_item_clicked(gpointer item, GeanyDocument *doc)
Definition: splitwindow.c:242
gtk_container_add(GTK_CONTAINER(dialog->vbox), check_button)
gtk_widget_show_all(dialog)
GtkWidget * vbox
Definition: splitwindow.c:74
ScintillaObject * sci
Definition: splitwindow.c:73
GeanyEditor * editor
Definition: splitwindow.c:72
GtkWidget * name_label
Definition: splitwindow.c:75
This contains pointers to global variables owned by Geany for plugins to use.
Definition: plugindata.h:167
struct GeanyMainWidgets * main_widgets
Important widgets in the main window.
Definition: plugindata.h:169
Structure for representing an open tab with all its properties.
Definition: document.h:81
GeanyFiletype * file_type
The filetype for this document, it's only a reference to one of the elements of the global filetypes ...
Definition: document.h:101
gboolean is_valid
Flag used to check if this document is valid when iterating GeanyData::documents_array.
Definition: document.h:83
GeanyEditor * editor
The editor associated with the document.
Definition: document.h:98
Editor-owned fields for each document.
Definition: editor.h:150
ScintillaObject * sci
The Scintilla editor GtkWidget.
Definition: editor.h:152
struct GeanyDocument * document
The document associated with the editor.
Definition: editor.h:151
Represents a filetype.
Definition: filetypes.h:144
GtkWidget * notebook
Document notebook.
Definition: ui_utils.h:83
GtkWidget * tools_menu
Most plugins add menu items to the Tools menu.
Definition: ui_utils.h:85
Basic information for the plugin and identification.
Definition: plugindata.h:233
Callback array entry type used with the plugin_callbacks symbol.
Definition: plugindata.h:148
Sci_Position position
Definition: Scintilla.h:1230
Sci_NotifyHeader nmhdr
Definition: Scintilla.h:1229
unsigned int code
Definition: Scintilla.h:1225
#define _(String)
Definition: support.h:42
const gchar * ui_lookup_stock_label(const gchar *stock_id)
Finds the label text associated with stock_id.
Definition: ui_utils.c:3114
void ui_add_document_sensitive(GtkWidget *widget)
Adds a widget to the list of widgets that should be set sensitive/insensitive when some documents are...
Definition: ui_utils.c:976
void ui_menu_add_document_items(GtkMenu *menu, GeanyDocument *active, GCallback callback)
<simplesect kind="geany:skip"></simplesect> Adds a list of document items to menu.
Definition: ui_utils.c:2929
gchar * utils_str_remove_chars(gchar *string, const gchar *chars)
Removes characters from a string, in place.
Definition: utils.c:1847