Geany  dev
Typedefs | Enumerations | Functions
build.h File Reference

Interface to the Build menu functionality. More...

Typedefs

typedef enum GeanyBuildCmdEntries GeanyBuildCmdEntries
 The entries of a command for a menu item.
 

Enumerations

enum  GeanyBuildCmdEntries { GEANY_BC_LABEL, GEANY_BC_COMMAND, GEANY_BC_WORKING_DIR, GEANY_BC_CMDENTRIES_COUNT }
 The entries of a command for a menu item. More...
 
enum  GeanyBuildGroup { GEANY_GBG_FT, GEANY_GBG_NON_FT, GEANY_GBG_EXEC, GEANY_GBG_COUNT }
 Groups of Build menu items. More...
 
enum  GeanyBuildSource {
  GEANY_BCS_DEF, GEANY_BCS_FT, GEANY_BCS_HOME_FT, GEANY_BCS_PREF,
  GEANY_BCS_PROJ_FT, GEANY_BCS_PROJ, GEANY_BCS_COUNT
}
 Build menu item sources in increasing priority. More...
 

Functions

void build_activate_menu_item (const GeanyBuildGroup grp, const guint cmd)
 Activate the menu item. More...
 
const gchar * build_get_current_menu_item (const GeanyBuildGroup grp, const guint cmd, const GeanyBuildCmdEntries field)
 Get the string for the menu item field. More...
 
guint build_get_group_count (const GeanyBuildGroup grp)
 Get the count of commands for the group. More...
 
void build_remove_menu_item (const GeanyBuildSource src, const GeanyBuildGroup grp, const gint cmd)
 Remove the specified Build menu item. More...
 
void build_set_menu_item (const GeanyBuildSource src, const GeanyBuildGroup grp, const guint cmd, const GeanyBuildCmdEntries field, const gchar *value)
 Set the string for the menu item field. More...
 

Detailed Description

Interface to the Build menu functionality.

Enumeration Type Documentation

The entries of a command for a menu item.

Enumerator
GEANY_BC_LABEL 

The menu item label, _ marks mnemonic.

GEANY_BC_COMMAND 

The command to run.

GEANY_BC_WORKING_DIR 

The directory to run in.

GEANY_BC_CMDENTRIES_COUNT 

Count of entries.

Groups of Build menu items.

Enumerator
GEANY_GBG_FT 

filetype items

GEANY_GBG_NON_FT 

non filetype items.

GEANY_GBG_EXEC 

execute items

GEANY_GBG_COUNT 

count of groups.

Build menu item sources in increasing priority.

Enumerator
GEANY_BCS_DEF 

Default values.

GEANY_BCS_FT 

System filetype values.

GEANY_BCS_HOME_FT 

Filetypes in ~/.config/geany/filedefs.

GEANY_BCS_PREF 

Preferences file ~/.config/geany/geany.conf.

GEANY_BCS_PROJ_FT 

Project file filetype command.

GEANY_BCS_PROJ 

Project file if open.

GEANY_BCS_COUNT 

Count of sources.

Function Documentation

void build_activate_menu_item ( const GeanyBuildGroup  grp,
const guint  cmd 
)

Activate the menu item.

Activate the menu item specified by grp and cmd.

Parameters
grpthe group of the specified menu item.
cmdthe index of the command within the group.
const gchar* build_get_current_menu_item ( const GeanyBuildGroup  grp,
const guint  cmd,
const GeanyBuildCmdEntries  fld 
)

Get the string for the menu item field.

Get the current highest priority command specified by grp and cmd. This is the one that the menu item will use if activated.

Parameters
grpthe group of the specified menu item.
cmdthe index of the command within the group.
fldthe field to return
Returns
a pointer to the constant string or NULL if it doesn't exist. This is a pointer to an internal structure and must not be freed.
guint build_get_group_count ( const GeanyBuildGroup  grp)

Get the count of commands for the group.

Get the number of commands in the group specified by grp.

Parameters
grpthe group of the specified menu item.
Returns
a count of the number of commands in the group
void build_remove_menu_item ( const GeanyBuildSource  src,
const GeanyBuildGroup  grp,
const gint  cmd 
)

Remove the specified Build menu item.

Makes the specified menu item configuration no longer exist. This is different to setting fields to blank because the menu item will be deleted from the configuration file on saving (except the system filetypes settings

See Also
Build Menu Configuration section of the Manual).
Parameters
srcthe source of the menu item to remove.
grpthe group of the command to remove.
cmdthe index (from 0) of the command within the group. A negative value will remove the whole group.

If any parameter is out of range does nothing.

Updates the menu.

void build_set_menu_item ( const GeanyBuildSource  src,
const GeanyBuildGroup  grp,
const guint  cmd,
const GeanyBuildCmdEntries  fld,
const gchar *  val 
)

Set the string for the menu item field.

Set the specified field of the command specified by src, grp and cmd.

Parameters
srcthe source of the menu item
grpthe group of the specified menu item.
cmdthe index of the menu item within the group.
fldthe field in the menu item command to set
valthe value to set the field to, is copied