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)  

htmlchars.c File Reference
#include "geanyplugin.h"
#include <string.h>
#include "SciLexer.h"
Include dependency graph for htmlchars.c:

Go to the source code of this file.

Enumerations

enum  { KB_INSERT_HTML_CHARS , KB_REPLACE_HTML_ENTITIES , KB_HTMLTOGGLE_ACTIVE , KB_COUNT }
 
enum  { COLUMN_CHARACTER , COLUMN_HTML_NAME , N_COLUMNS }
 

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 gboolean ht_editor_notify_cb (GObject *object, GeanyEditor *editor, SCNotification *nt, gpointer data)
 
static void set_status (gboolean new_status)
 
static void toggle_status (G_GNUC_UNUSED GtkMenuItem *menuitem)
 
static void sc_on_tools_show_dialog_insert_special_chars_response (GtkDialog *dialog, gint response, gpointer user_data)
 
static void sc_on_tree_row_activated (GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *col, gpointer user_data)
 
static void sc_fill_store (GtkTreeStore *store)
 
static gboolean sc_insert (GtkTreeModel *model, GtkTreeIter *iter)
 
static const gchar * get_entity (gchar *letter)
 
static void kbhtmltoggle_toggle (G_GNUC_UNUSED guint key_id)
 
static void tools_show_dialog_insert_special_chars (void)
 
static void replace_special_character (void)
 
static void item_activate (GtkMenuItem *menuitem, gpointer gdata)
 
static void kb_activate (G_GNUC_UNUSED guint key_id)
 
static void replace_special_character_activated (GtkMenuItem *menuitem, gpointer gdata)
 
static void kb_special_chars_replacement (G_GNUC_UNUSED guint key_id)
 
static void init_configuration (void)
 
void plugin_init (GeanyData *data)
 Called after loading the plugin. More...
 
void plugin_cleanup (void)
 Called before unloading the plugin. More...
 

Variables

GeanyPlugingeany_plugin
 
GeanyDatageany_data
 
static GtkWidget * main_menu_item = NULL
 
static GtkWidget * main_menu = NULL
 
static GtkWidget * main_menu_submenu = NULL
 
static GtkWidget * menu_bulk_replace = NULL
 
static GtkWidget * sc_dialog = NULL
 
static GtkTreeStore * sc_store = NULL
 
static GtkTreeView * sc_tree = NULL
 
static GtkWidget * menu_htmltoggle = NULL
 
static gboolean plugin_active = FALSE
 
static gchar * config_file = NULL
 
const gchar * chars [][2]
 
PluginCallback plugin_callbacks []
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
KB_INSERT_HTML_CHARS 
KB_REPLACE_HTML_ENTITIES 
KB_HTMLTOGGLE_ACTIVE 
KB_COUNT 

Definition at line 43 of file htmlchars.c.

◆ anonymous enum

anonymous enum
Enumerator
COLUMN_CHARACTER 
COLUMN_HTML_NAME 
N_COLUMNS 

Definition at line 52 of file htmlchars.c.

Function Documentation

◆ get_entity()

static const gchar * get_entity ( gchar *  letter)
static

Definition at line 399 of file htmlchars.c.

References chars, NULL, and utils_str_equal().

Referenced by ht_editor_notify_cb(), and replace_special_character().

◆ ht_editor_notify_cb()

◆ init_configuration()

static void init_configuration ( void  )
static

< Simple macro for geany_data that reduces typing.

Definition at line 714 of file htmlchars.c.

References config_file, geany, NULL, plugin_active, and utils_get_setting_boolean().

Referenced by plugin_init().

◆ item_activate()

static void item_activate ( GtkMenuItem *  menuitem,
gpointer  gdata 
)
static

Definition at line 688 of file htmlchars.c.

References tools_show_dialog_insert_special_chars().

Referenced by kb_activate(), and plugin_init().

◆ kb_activate()

static void kb_activate ( G_GNUC_UNUSED guint  key_id)
static

Definition at line 694 of file htmlchars.c.

References item_activate(), and NULL.

Referenced by plugin_init().

◆ kb_special_chars_replacement()

static void kb_special_chars_replacement ( G_GNUC_UNUSED guint  key_id)
static

Definition at line 708 of file htmlchars.c.

References replace_special_character().

Referenced by plugin_init().

◆ kbhtmltoggle_toggle()

static void kbhtmltoggle_toggle ( G_GNUC_UNUSED guint  key_id)
static

Definition at line 463 of file htmlchars.c.

References plugin_active, and set_status().

Referenced by plugin_init().

◆ 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 794 of file htmlchars.c.

References config_file, main_menu, main_menu_item, NULL, and sc_dialog.

◆ plugin_init()

◆ 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 39 of file htmlchars.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 36 of file htmlchars.c.

◆ replace_special_character()

◆ replace_special_character_activated()

static void replace_special_character_activated ( GtkMenuItem *  menuitem,
gpointer  gdata 
)
static

Definition at line 702 of file htmlchars.c.

References replace_special_character().

Referenced by plugin_init().

◆ sc_fill_store()

static void sc_fill_store ( GtkTreeStore *  store)
static

Definition at line 547 of file htmlchars.c.

References _, chars, COLUMN_CHARACTER, COLUMN_HTML_NAME, and NULL.

Referenced by tools_show_dialog_insert_special_chars().

◆ sc_insert()

static gboolean sc_insert ( GtkTreeModel *  model,
GtkTreeIter *  iter 
)
static

◆ sc_on_tools_show_dialog_insert_special_chars_response()

static void sc_on_tools_show_dialog_insert_special_chars_response ( GtkDialog *  dialog,
gint  response,
gpointer  user_data 
)
static

Definition at line 597 of file htmlchars.c.

References dialog, sc_insert(), and sc_tree.

Referenced by tools_show_dialog_insert_special_chars().

◆ sc_on_tree_row_activated()

static void sc_on_tree_row_activated ( GtkTreeView *  treeview,
GtkTreePath *  path,
GtkTreeViewColumn *  col,
gpointer  user_data 
)
static

Definition at line 620 of file htmlchars.c.

References sc_dialog, sc_insert(), sc_store, and sc_tree.

Referenced by tools_show_dialog_insert_special_chars().

◆ set_status()

static void set_status ( gboolean  new_status)
static

◆ toggle_status()

static void toggle_status ( G_GNUC_UNUSED GtkMenuItem *  menuitem)
static

Definition at line 380 of file htmlchars.c.

References plugin_active, and set_status().

Referenced by plugin_init().

◆ tools_show_dialog_insert_special_chars()

static void tools_show_dialog_insert_special_chars ( void  )
static

Variable Documentation

◆ chars

◆ config_file

gchar* config_file = NULL
static

Definition at line 70 of file htmlchars.c.

Referenced by init_configuration(), plugin_cleanup(), and set_status().

◆ geany_data

GeanyData* geany_data

Definition at line 33 of file htmlchars.c.

◆ geany_plugin

GeanyPlugin* geany_plugin

Definition at line 32 of file htmlchars.c.

Referenced by plugin_init().

◆ main_menu

GtkWidget* main_menu = NULL
static

Definition at line 60 of file htmlchars.c.

Referenced by plugin_cleanup(), and plugin_init().

◆ main_menu_item

GtkWidget* main_menu_item = NULL
static

Definition at line 59 of file htmlchars.c.

Referenced by plugin_cleanup(), and plugin_init().

◆ main_menu_submenu

GtkWidget* main_menu_submenu = NULL
static

Definition at line 61 of file htmlchars.c.

Referenced by plugin_init().

◆ menu_bulk_replace

GtkWidget* menu_bulk_replace = NULL
static

Definition at line 62 of file htmlchars.c.

Referenced by plugin_init().

◆ menu_htmltoggle

GtkWidget* menu_htmltoggle = NULL
static

Definition at line 66 of file htmlchars.c.

Referenced by plugin_init().

◆ plugin_active

gboolean plugin_active = FALSE
static

◆ plugin_callbacks

PluginCallback plugin_callbacks[]
Initial value:
=
{
{ "editor-notify", (GCallback) &ht_editor_notify_cb, FALSE, NULL },
{ NULL, NULL, FALSE, NULL }
}
static gboolean ht_editor_notify_cb(GObject *object, GeanyEditor *editor, SCNotification *nt, gpointer data)
Definition: htmlchars.c:420
#define NULL
Definition: rbtree.h:150

Definition at line 338 of file htmlchars.c.

◆ sc_dialog

GtkWidget* sc_dialog = NULL
static

◆ sc_store

GtkTreeStore* sc_store = NULL
static

Definition at line 64 of file htmlchars.c.

Referenced by sc_on_tree_row_activated(), and tools_show_dialog_insert_special_chars().

◆ sc_tree