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 File Reference
#include "geanyplugin.h"
#include "gtkcompat.h"
#include <string.h>
Include dependency graph for splitwindow.c:

Go to the source code of this file.

Classes

struct  EditWindow
 

Typedefs

typedef struct EditWindow EditWindow
 

Enumerations

enum  { KB_SPLIT_HORIZONTAL , KB_SPLIT_VERTICAL , KB_SPLIT_UNSPLIT , KB_COUNT }
 
enum  State { STATE_SPLIT_HORIZONTAL , STATE_SPLIT_VERTICAL , STATE_UNSPLIT , STATE_COUNT }
 

Functions

gint plugin_version_check (gint abi_ver)
 Use the PLUGIN_VERSION_CHECK() macro instead. More...
 
void plugin_set_info (PluginInfo *info)
 Use the PLUGIN_SET_INFO() macro to define it. More...
 
static void on_unsplit (GtkMenuItem *menuitem, gpointer user_data)
 
static void set_line_numbers (ScintillaObject *sci, gboolean set)
 
static void on_sci_notify (ScintillaObject *sci, gint param, SCNotification *nt, gpointer data)
 
static void sync_to_current (ScintillaObject *sci, ScintillaObject *current)
 
static void set_editor (EditWindow *editwin, GeanyEditor *editor)
 
static void set_state (enum State id)
 
static GtkWidget * ui_tool_button_new (const gchar *stock_id, const gchar *label, const gchar *tooltip)
 
static void on_refresh (void)
 
static void on_doc_menu_item_clicked (gpointer item, GeanyDocument *doc)
 
static void on_doc_show_menu (GtkMenuToolButton *button, GtkMenu *menu)
 
static void show_menu_gtk316_fix (GtkMenuToolButton *button, gpointer data)
 
static GtkWidget * create_toolbar (void)
 
static void split_view (gboolean horizontal)
 
static void on_split_horizontally (GtkMenuItem *menuitem, gpointer user_data)
 
static void on_split_vertically (GtkMenuItem *menuitem, gpointer user_data)
 
static void kb_activate (guint key_id)
 
void plugin_init (GeanyData *data)
 Called after loading the plugin. More...
 
static gboolean do_select_current (gpointer data)
 
static void on_document_close (GObject *obj, GeanyDocument *doc, gpointer user_data)
 
static void on_document_save (GObject *obj, GeanyDocument *doc, gpointer user_data)
 
static void on_document_filetype_set (GObject *obj, GeanyDocument *doc, GeanyFiletype *filetype_old, gpointer user_data)
 
void plugin_cleanup (void)
 Called before unloading the plugin. More...
 

Variables

GeanyDatageany_data
 
GeanyPlugingeany_plugin
 
struct {
   GtkWidget *   main
 
   GtkWidget *   horizontal
 
   GtkWidget *   vertical
 
   GtkWidget *   unsplit
 
menu_items
 
static enum State plugin_state
 
static EditWindow edit_window = {NULL, NULL, NULL, NULL}
 
PluginCallback plugin_callbacks []
 

Typedef Documentation

◆ EditWindow

typedef struct EditWindow EditWindow

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
KB_SPLIT_HORIZONTAL 
KB_SPLIT_VERTICAL 
KB_SPLIT_UNSPLIT 
KB_COUNT 

Definition at line 42 of file splitwindow.c.

◆ State

enum State
Enumerator
STATE_SPLIT_HORIZONTAL 
STATE_SPLIT_VERTICAL 
STATE_UNSPLIT 
STATE_COUNT 

Definition at line 50 of file splitwindow.c.

Function Documentation

◆ create_toolbar()

static GtkWidget * create_toolbar ( void  )
static

◆ do_select_current()

static gboolean do_select_current ( gpointer  data)
static

◆ kb_activate()

static void kb_activate ( guint  key_id)
static

◆ on_doc_menu_item_clicked()

static void on_doc_menu_item_clicked ( gpointer  item,
GeanyDocument doc 
)
static

Definition at line 242 of file splitwindow.c.

References edit_window, GeanyDocument::editor, GeanyDocument::is_valid, and set_editor().

Referenced by on_doc_show_menu().

◆ on_doc_show_menu()

static void on_doc_show_menu ( GtkMenuToolButton *  button,
GtkMenu *  menu 
)
static

◆ on_document_close()

static void on_document_close ( GObject *  obj,
GeanyDocument doc,
gpointer  user_data 
)
static

◆ on_document_filetype_set()

static void on_document_filetype_set ( GObject *  obj,
GeanyDocument doc,
GeanyFiletype filetype_old,
gpointer  user_data 
)
static

◆ on_document_save()

static void on_document_save ( GObject *  obj,
GeanyDocument doc,
gpointer  user_data 
)
static

◆ on_refresh()

static void on_refresh ( void  )
static

◆ on_sci_notify()

◆ on_split_horizontally()

static void on_split_horizontally ( GtkMenuItem *  menuitem,
gpointer  user_data 
)
static

Definition at line 373 of file splitwindow.c.

References split_view().

Referenced by plugin_init().

◆ on_split_vertically()

static void on_split_vertically ( GtkMenuItem *  menuitem,
gpointer  user_data 
)
static

Definition at line 379 of file splitwindow.c.

References split_view().

Referenced by plugin_init().

◆ on_unsplit()

static void on_unsplit ( GtkMenuItem *  menuitem,
gpointer  user_data 
)
static

◆ plugin_cleanup()

void plugin_cleanup ( )

Called before unloading the plugin.

Required for normal plugins - it should undo everything done in plugin_init() - e.g. destroy menu items, free memory.

Definition at line 523 of file splitwindow.c.

References main_menu_item, menu_items, NULL, on_unsplit(), plugin_state, and STATE_UNSPLIT.

◆ plugin_init()

void plugin_init ( GeanyData data)

Called after loading the plugin.

Parameters
dataThe same as geany_data.

< Simple macro for geany_data that reduces typing.

< Simple macro for geany_data that reduces typing.

< Simple macro for geany_data that reduces typing.

< Simple macro for geany_data that reduces typing.

< Simple macro for geany_data that reduces typing.

Definition at line 427 of file splitwindow.c.

References _, geany, geany_data, geany_plugin, gtk_container_add(), gtk_widget_show_all(), kb_activate(), KB_COUNT, KB_SPLIT_HORIZONTAL, KB_SPLIT_UNSPLIT, KB_SPLIT_VERTICAL, keybindings_set_item(), main_menu_item, GeanyData::main_widgets, menu_items, NULL, on_menu_create_html_activate(), on_menu_create_latex_activate(), on_split_horizontally(), on_split_vertically(), on_unsplit(), plugin_set_key_group(), set_state(), STATE_UNSPLIT, GeanyMainWidgets::tools_menu, and ui_add_document_sensitive().

◆ plugin_set_info()

void plugin_set_info ( PluginInfo info)

Use the PLUGIN_SET_INFO() macro to define it.

Required by Geany. This function is called before the plugin is initialized, so Geany can read the plugin's name.

Parameters
infoThe data struct which should be initialized by this function.

Definition at line 34 of file splitwindow.c.

◆ plugin_version_check()

gint plugin_version_check ( gint  abi)

Use the PLUGIN_VERSION_CHECK() macro instead.

Required by Geany.

Parameters
abiABI version Geany was compiled with
Returns
The API version the plugin was compiled with, or -1 if the plugin is incompatible.

Definition at line 32 of file splitwindow.c.

◆ set_editor()

◆ set_line_numbers()

static void set_line_numbers ( ScintillaObject *  sci,
gboolean  set 
)
static

◆ set_state()

static void set_state ( enum State  id)
static

◆ show_menu_gtk316_fix()

static void show_menu_gtk316_fix ( GtkMenuToolButton *  button,
gpointer  data 
)
static

Definition at line 263 of file splitwindow.c.

Referenced by create_toolbar().

◆ split_view()

◆ sync_to_current()

static void sync_to_current ( ScintillaObject *  sci,
ScintillaObject *  current 
)
static

◆ ui_tool_button_new()

static GtkWidget * ui_tool_button_new ( const gchar *  stock_id,
const gchar *  label,
const gchar *  tooltip 
)
static

Definition at line 205 of file splitwindow.c.

References label, NULL, ui_lookup_stock_label(), and utils_str_remove_chars().

Referenced by create_toolbar().

Variable Documentation

◆ edit_window

◆ geany_data

GeanyData* geany_data

Definition at line 37 of file splitwindow.c.

Referenced by on_unsplit(), plugin_init(), and split_view().

◆ geany_plugin

GeanyPlugin* geany_plugin

Definition at line 38 of file splitwindow.c.

Referenced by on_document_close(), and plugin_init().

◆ horizontal

GtkWidget* horizontal

Definition at line 61 of file splitwindow.c.

Referenced by split_view().

◆ main

GtkWidget* main

Definition at line 60 of file splitwindow.c.

◆ 

struct { ... } menu_items

◆ plugin_callbacks

PluginCallback plugin_callbacks[]
Initial value:
=
{
{ "document-close", (GCallback) &on_document_close, FALSE, NULL },
{ "document-save", (GCallback) &on_document_save, FALSE, NULL },
{ "document-filetype-set", (GCallback) &on_document_filetype_set, FALSE, NULL },
{ NULL, NULL, FALSE, NULL }
}
#define NULL
Definition: rbtree.h:150
static void on_document_filetype_set(GObject *obj, GeanyDocument *doc, GeanyFiletype *filetype_old, gpointer user_data)
Definition: splitwindow.c:505
static void on_document_close(GObject *obj, GeanyDocument *doc, gpointer user_data)
Definition: splitwindow.c:487
static void on_document_save(GObject *obj, GeanyDocument *doc, gpointer user_data)
Definition: splitwindow.c:497

Definition at line 514 of file splitwindow.c.

◆ plugin_state

enum State plugin_state
static

Definition at line 67 of file splitwindow.c.

Referenced by do_select_current(), kb_activate(), plugin_cleanup(), and set_state().

◆ unsplit

GtkWidget* unsplit

Definition at line 63 of file splitwindow.c.

◆ vertical

GtkWidget* vertical

Definition at line 62 of file splitwindow.c.