SF.net SVN: geany:[4199] trunk
ntrel at users.sourceforge.net
ntrel at xxxxx
Wed Sep 16 14:13:38 UTC 2009
Revision: 4199
http://geany.svn.sourceforge.net/geany/?rev=4199&view=rev
Author: ntrel
Date: 2009-09-16 14:13:38 +0000 (Wed, 16 Sep 2009)
Log Message:
-----------
Run ./scripts/fix-alignment.pl -w src/*.[hc] plugins/*.[hc] (skipping generated files).
Modified Paths:
--------------
trunk/plugins/htmlchars.c
trunk/plugins/splitwindow.c
trunk/src/about.c
trunk/src/build.c
trunk/src/build.h
trunk/src/callbacks.c
trunk/src/dialogs.c
trunk/src/document.c
trunk/src/editor.c
trunk/src/encodings.c
trunk/src/filetypes.c
trunk/src/gb.c
trunk/src/geanyobject.c
trunk/src/highlighting.c
trunk/src/keybindings.c
trunk/src/keyfile.c
trunk/src/main.c
trunk/src/msgwindow.c
trunk/src/notebook.c
trunk/src/prefix.c
trunk/src/project.c
trunk/src/queue.c
trunk/src/sciwrappers.c
trunk/src/sciwrappers.h
trunk/src/search.c
trunk/src/socket.c
trunk/src/symbols.c
trunk/src/templates.c
trunk/src/toolbar.c
trunk/src/tools.c
trunk/src/treeviews.c
trunk/src/ui_utils.c
trunk/src/utils.c
trunk/src/vte.c
trunk/src/win32.c
Modified: trunk/plugins/htmlchars.c
===================================================================
--- trunk/plugins/htmlchars.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/plugins/htmlchars.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -349,6 +349,7 @@
plugin_active = new_status;
}
+
static void toggle_status(G_GNUC_UNUSED GtkMenuItem * menuitem)
{
if (plugin_active == TRUE)
@@ -434,6 +435,7 @@
set_status(TRUE);
}
+
static void tools_show_dialog_insert_special_chars(void)
{
if (sc_dialog == NULL)
@@ -530,6 +532,7 @@
}
}
+
/* just inserts the HTML_NAME coloumn of the selected row at current position
* returns only TRUE if a valid selection(i.e. no category) could be found */
static gboolean sc_insert(GtkTreeModel *model, GtkTreeIter *iter)
@@ -650,6 +653,7 @@
tools_show_dialog_insert_special_chars();
}
+
static void kb_activate(G_GNUC_UNUSED guint key_id)
{
item_activate(NULL, NULL);
@@ -664,7 +668,6 @@
}
-
static void kb_special_chars_replacement(G_GNUC_UNUSED guint key_id)
{
replace_special_character();
Modified: trunk/plugins/splitwindow.c
===================================================================
--- trunk/plugins/splitwindow.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/plugins/splitwindow.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -149,7 +149,7 @@
}
else
{
- scintilla_send_message(sci, SCI_SETMARGINWIDTHN, 0, 0 );
+ scintilla_send_message(sci, SCI_SETMARGINWIDTHN, 0, 0);
}
}
Modified: trunk/src/about.c
===================================================================
--- trunk/src/about.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/about.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -151,14 +151,14 @@
gtk_widget_show(header_hbox);
gtk_container_add(GTK_CONTAINER(header_eventbox), header_hbox);
header_image = gtk_image_new();
- gtk_box_pack_start(GTK_BOX(header_hbox), header_image, FALSE,FALSE,0);
+ gtk_box_pack_start(GTK_BOX(header_hbox), header_image, FALSE, FALSE, 0);
header_label = gtk_label_new(NULL);
gtk_label_set_use_markup(GTK_LABEL(header_label), TRUE);
/* print the subversion revision generated by ./configure if it is available */
g_snprintf(buffer, sizeof(buffer), HEADER, main_get_version_string());
gtk_label_set_markup(GTK_LABEL(header_label), buffer);
gtk_widget_show(header_label);
- gtk_box_pack_start(GTK_BOX(header_hbox), header_label, FALSE,FALSE,0);
+ gtk_box_pack_start(GTK_BOX(header_hbox), header_label, FALSE, FALSE, 0);
header_eventbox_style_set(header_eventbox);
header_label_style_set(header_label);
g_signal_connect_after(header_eventbox, "style-set", G_CALLBACK(header_eventbox_style_set), NULL);
Modified: trunk/src/build.c
===================================================================
--- trunk/src/build.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/build.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -79,10 +79,10 @@
#endif
/* pack group (<8) and command (<32) into a user_data pointer */
-#define GRP_CMD_TO_POINTER(grp, cmd) GINT_TO_POINTER((((grp)&7)<<5)|((cmd)&0x1f))
+#define GRP_CMD_TO_POINTER(grp, cmd) GINT_TO_POINTER((((grp)&7) << 5) | ((cmd)&0x1f))
#define GBO_TO_POINTER(gbo) (GRP_CMD_TO_POINTER(GBO_TO_GBG(gbo), GBO_TO_CMD(gbo)))
#define GPOINTER_TO_CMD(gptr) (GPOINTER_TO_INT(gptr)&0x1f)
-#define GPOINTER_TO_GRP(gptr) ((GPOINTER_TO_INT(gptr)&0xe0)>>5)
+#define GPOINTER_TO_GRP(gptr) ((GPOINTER_TO_INT(gptr)&0xe0) >> 5)
static gpointer last_toolbutton_action = GBO_TO_POINTER(GEANY_GBO_BUILD);
@@ -200,7 +200,7 @@
#ifndef PRINTBUILDCMDS
#define PRINTBUILDCMDS FALSE
#endif
-gboolean printbuildcmds=PRINTBUILDCMDS;
+gboolean printbuildcmds = PRINTBUILDCMDS;
static GeanyBuildCommand **cl[GEANY_GBG_COUNT][GEANY_BCS_COUNT] = {
/* GEANY_BCS_DEF, GEANY_BCS_FT, GEANY_BCS_HOME_FT, GEANY_BCS_PREF, GEANY_BCS_PROJ */
@@ -213,13 +213,13 @@
/* for debug only, print the commands structures in priority order */
static void printfcmds()
{
- GeanyFiletype *ft=NULL;
+ GeanyFiletype *ft = NULL;
GeanyDocument *doc;
- gint i,j,k,l,m;
+ gint i, j, k, l, m;
enum GeanyBuildCmdEntries n;
gint cc[GEANY_BCS_COUNT];
gchar c;
- doc=document_get_current();
+ doc = document_get_current();
if (doc != NULL)
ft = doc->file_type;
if (ft != NULL)
@@ -243,7 +243,7 @@
for (n = 0; n < GEANY_BC_CMDENTRIES_COUNT; n++)
{
if ((*(cl[j][i]))[k].entries[n] != NULL &&
- (l=strlen((*(cl[j][i]))[k].entries[n])) > m)
+ (l = strlen((*(cl[j][i]))[k].entries[n])) > m)
{
m = l;
}
@@ -261,7 +261,7 @@
c = ' ';
for (j = 0; j < GEANY_BCS_COUNT; ++j)
{
- if (cl[i][j]!=NULL && *(cl[i][j]) != NULL && (*(cl[i][j]))[k].exists)
+ if (cl[i][j] != NULL && *(cl[i][j]) != NULL && (*(cl[i][j]))[k].exists)
{
for (n = 0; n < GEANY_BC_CMDENTRIES_COUNT; n++)
{
@@ -305,7 +305,7 @@
static GeanyBuildCommand *get_next_build_cmd(GeanyDocument *doc, gint cmdgrp, gint cmdindex,
gint below, gint *from)
{
- GeanyFiletype *ft=NULL;
+ GeanyFiletype *ft = NULL;
gint sink, *fr = &sink;
if (printbuildcmds)
@@ -318,7 +318,7 @@
doc = document_get_current();
if (doc != NULL)
ft = doc->file_type;
- switch(cmdgrp)
+ switch (cmdgrp)
{
case GEANY_GBG_FT: /* order proj ft, home ft, ft, defft */
if (ft != NULL)
@@ -348,12 +348,14 @@
return NULL;
}
+
/* shortcut to start looking at the top */
static GeanyBuildCommand *get_build_cmd(GeanyDocument *doc, gint grp, gint cmdindex, gint *from)
{
return get_next_build_cmd(doc, grp, cmdindex, GEANY_BCS_COUNT, from);
}
+
#define return_nonblank_regex(src, ptr) if (NZV(ptr)) \
{ *fr = (src); return &(ptr); }
@@ -363,14 +365,14 @@
{
gint sink, *fr = &sink;
if (from != NULL)
- fr=from;
+ fr = from;
if (grp == GEANY_GBG_FT)
{
if (ft == NULL)
{
- GeanyDocument *doc=document_get_current();
+ GeanyDocument *doc = document_get_current();
if (doc != NULL)
- ft=doc->file_type;
+ ft = doc->file_type;
}
if (ft == NULL)
return NULL;
@@ -393,15 +395,15 @@
GeanyDocument *doc;
GeanyFiletype *ft;
- switch(grp)
+ switch (grp)
{
case GEANY_GBG_FT:
- if ((doc=document_get_current())==NULL)
+ if ((doc = document_get_current()) == NULL)
return NULL;
- if ((ft=doc->file_type)==NULL)
+ if ((ft = doc->file_type) == NULL)
return NULL;
- switch(src)
+ switch (src)
{
case GEANY_BCS_DEF: return ft->ftdefcmds;
case GEANY_BCS_FT: return ft->filecmds;
@@ -412,7 +414,7 @@
}
break;
case GEANY_GBG_NON_FT:
- switch(src)
+ switch (src)
{
case GEANY_BCS_DEF: return non_ft_def;
case GEANY_BCS_PREF: return non_ft_pref;
@@ -421,12 +423,12 @@
}
break;
case GEANY_GBG_EXEC:
- if ((doc=document_get_current())==NULL)
+ if ((doc = document_get_current()) == NULL)
return NULL;
- if ((ft=doc->file_type)==NULL)
+ if ((ft = doc->file_type) == NULL)
return NULL;
- switch(src)
+ switch (src)
{
case GEANY_BCS_DEF: return exec_def;
case GEANY_BCS_FT: return ft->execcmds;
@@ -456,7 +458,7 @@
for (i = 0; i < build_groups_count[grp]; ++i)
bc[i].exists = FALSE;
}
- else if(cmd < build_groups_count[grp])
+ else if (cmd < build_groups_count[grp])
bc[cmd].exists = FALSE;
}
@@ -612,7 +614,7 @@
gint stderr_fd;
#endif
- if( !((doc != NULL && NZV(doc->file_name)) || NZV(dir)))
+ if (!((doc != NULL && NZV(doc->file_name)) || NZV(dir)))
{
geany_debug("Failed to run command with no working directory");
ui_set_statusbar(TRUE, _("Process failed, no working directory"));
@@ -682,9 +684,9 @@
}
/* use GIOChannels to monitor stdout and stderr */
- utils_set_up_io_channel(stdout_fd, G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL,
+ utils_set_up_io_channel(stdout_fd, G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
TRUE, build_iofunc, GINT_TO_POINTER(0));
- utils_set_up_io_channel(stderr_fd, G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL,
+ utils_set_up_io_channel(stderr_fd, G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
TRUE, build_iofunc, GINT_TO_POINTER(1));
#endif
@@ -694,6 +696,7 @@
return build_info.pid;
}
+
/* Returns: NULL if there was an error, or the working directory the script was created in.
* vte_cmd_nonscript is the location of a string which is filled with the command to be used
* when vc->skip_run_script is set, otherwise it will be set to NULL */
@@ -727,7 +730,7 @@
/* only test whether working dir exists, don't change it or else Windows support will break
* (gspawn-win32-helper.exe is used by GLib and must be in $PATH which means current working
* dir where geany.exe was started from, so we can't change it) */
- if ( !NZV(working_dir) || ! g_file_test(working_dir, G_FILE_TEST_EXISTS) ||
+ if (!NZV(working_dir) || ! g_file_test(working_dir, G_FILE_TEST_EXISTS) ||
! g_file_test(working_dir, G_FILE_TEST_IS_DIR))
{
ui_set_statusbar(TRUE, _("Failed to change the working directory to \"%s\""),
@@ -760,7 +763,7 @@
if (! result)
{
ui_set_statusbar(TRUE, _("Failed to execute \"%s\" (start-script could not be created)"),
- NZV(cmd_string) ? cmd_string: NULL);
+ NZV(cmd_string) ? cmd_string : NULL);
}
utils_free_pointers(4, cmd_string, tmp, executable, locale_filename, NULL);
@@ -803,7 +806,7 @@
vte_cmd = g_strconcat("\n/bin/sh ", RUN_SCRIPT_CMD, "\n", NULL);
/* change into current directory if it is not done by default */
- if (! vc->follow_path )
+ if (! vc->follow_path)
{
/* we need to convert the working_dir back to UTF-8 because the VTE expects it */
gchar *utf8_working_dir = utils_get_utf8_from_locale(working_dir);
@@ -1231,16 +1234,16 @@
* value order is important, see the following table for use */
/* the rest in each group */
-#define MENU_FT_REST (GEANY_GBG_COUNT+GEANY_GBG_FT)
-#define MENU_NON_FT_REST (GEANY_GBG_COUNT+GEANY_GBG_NON_FT)
-#define MENU_EXEC_REST (GEANY_GBG_COUNT+GEANY_GBG_EXEC)
+#define MENU_FT_REST (GEANY_GBG_COUNT + GEANY_GBG_FT)
+#define MENU_NON_FT_REST (GEANY_GBG_COUNT + GEANY_GBG_NON_FT)
+#define MENU_EXEC_REST (GEANY_GBG_COUNT + GEANY_GBG_EXEC)
/* the separator */
#define MENU_SEPARATOR (2*GEANY_GBG_COUNT)
/* the fixed items */
-#define MENU_NEXT_ERROR (MENU_SEPARATOR+1)
-#define MENU_PREV_ERROR (MENU_NEXT_ERROR+1)
-#define MENU_COMMANDS (MENU_PREV_ERROR+1)
-#define MENU_DONE (MENU_COMMANDS+1)
+#define MENU_NEXT_ERROR (MENU_SEPARATOR + 1)
+#define MENU_PREV_ERROR (MENU_NEXT_ERROR + 1)
+#define MENU_COMMANDS (MENU_PREV_ERROR + 1)
+#define MENU_DONE (MENU_COMMANDS + 1)
static struct BuildMenuItemSpec {
@@ -1256,7 +1259,7 @@
{ GEANY_STOCK_BUILD, GEANY_KEYS_BUILD_LINK, GBO_TO_GBG(GEANY_GBO_BUILD),
GBO_TO_CMD(GEANY_GBO_BUILD), NULL, on_build_menu_item },
{ NULL, -1, MENU_FT_REST,
- GBO_TO_CMD(GEANY_GBO_BUILD)+1, NULL, on_build_menu_item },
+ GBO_TO_CMD(GEANY_GBO_BUILD) + 1, NULL, on_build_menu_item },
{ NULL, -1, MENU_SEPARATOR,
GBF_SEP_1, NULL, NULL },
{ NULL, GEANY_KEYS_BUILD_MAKE, GBO_TO_GBG(GEANY_GBO_MAKE_ALL),
@@ -1266,7 +1269,7 @@
{ NULL, GEANY_KEYS_BUILD_MAKEOBJECT, GBO_TO_GBG(GEANY_GBO_MAKE_OBJECT),
GBO_TO_CMD(GEANY_GBO_MAKE_OBJECT), NULL, on_build_menu_item },
{ NULL, -1, MENU_NON_FT_REST,
- GBO_TO_CMD(GEANY_GBO_MAKE_OBJECT)+1, NULL, on_build_menu_item },
+ GBO_TO_CMD(GEANY_GBO_MAKE_OBJECT) + 1, NULL, on_build_menu_item },
{ NULL, -1, MENU_SEPARATOR,
GBF_SEP_2, NULL, NULL },
{ NULL, GEANY_KEYS_BUILD_NEXTERROR, MENU_NEXT_ERROR,
@@ -1278,7 +1281,7 @@
{ GTK_STOCK_EXECUTE, GEANY_KEYS_BUILD_RUN, GBO_TO_GBG(GEANY_GBO_EXEC),
GBO_TO_CMD(GEANY_GBO_EXEC), NULL, on_build_menu_item },
{ NULL, -1, MENU_EXEC_REST,
- GBO_TO_CMD(GEANY_GBO_EXEC)+1, NULL, on_build_menu_item },
+ GBO_TO_CMD(GEANY_GBO_EXEC) + 1, NULL, on_build_menu_item },
{ NULL, -1, MENU_SEPARATOR,
GBF_SEP_4, NULL, NULL },
{ GTK_STOCK_PREFERENCES, GEANY_KEYS_BUILD_OPTIONS, MENU_COMMANDS,
@@ -1315,7 +1318,7 @@
GtkWidget *menu;
GtkAccelGroup *accel_group = gtk_accel_group_new();
GeanyKeyGroup *keygroup = g_ptr_array_index(keybinding_groups, GEANY_KEY_GROUP_BUILD);
- gint i,j;
+ gint i, j;
menu = gtk_menu_new();
build_menu_items->menu_item[GEANY_GBG_FT] = g_new0(GtkWidget*, build_groups_count[GEANY_GBG_FT]);
@@ -1391,7 +1394,7 @@
for (i = 0; build_menu_specs[i].build_grp != MENU_DONE; ++i)
{
struct BuildMenuItemSpec *bs = &(build_menu_specs[i]);
- switch(bs->build_grp)
+ switch (bs->build_grp)
{
case MENU_SEPARATOR:
if (vis == TRUE)
@@ -1499,7 +1502,7 @@
gtk_widget_set_sensitive(widgets.toolitem_set_args, TRUE);
gtk_action_set_sensitive(widgets.compile_action, can_compile);
- gtk_action_set_sensitive(widgets.build_action, can_make );
+ gtk_action_set_sensitive(widgets.build_action, can_make);
gtk_action_set_sensitive(widgets.run_action, run_sensitivity);
/* show the stop command if a program is running from execute 0 , otherwise show run command */
@@ -1554,12 +1557,12 @@
static void on_toolbutton_make_activate(GtkWidget *menuitem, gpointer user_data)
{
gchar *msg;
- gint grp,cmd;
+ gint grp, cmd;
last_toolbutton_action = user_data;
grp = GPOINTER_TO_GRP(user_data);
cmd = GPOINTER_TO_CMD(user_data);
- if ( last_toolbutton_action == GBO_TO_POINTER(GEANY_GBO_MAKE_ALL))
+ if (last_toolbutton_action == GBO_TO_POINTER(GEANY_GBO_MAKE_ALL))
msg = _("Build the current file with Make and the default target");
else if (last_toolbutton_action == GBO_TO_POINTER(GEANY_GBO_CUSTOM))
msg = _("Build the current file with Make and the specified target");
@@ -1600,7 +1603,7 @@
}
-static void on_build_next_error(GtkWidget *menuitem,gpointer user_data)
+static void on_build_next_error(GtkWidget *menuitem, gpointer user_data)
{
if (ui_tree_view_find_next(GTK_TREE_VIEW(msgwindow.tree_compiler),
msgwin_goto_compiler_file_line))
@@ -1839,7 +1842,7 @@
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
gtk_table_attach(table, label, 0, DC_N_COL, row, row + 1, GTK_FILL, GTK_FILL | GTK_EXPAND,
entry_x_padding, entry_y_padding);
- for (++row, cmd = 0; cmd < build_groups_count[GEANY_GBG_NON_FT]; ++row,++cmdindex, ++cmd)
+ for (++row, cmd = 0; cmd < build_groups_count[GEANY_GBG_NON_FT]; ++row, ++cmdindex, ++cmd)
fields->rows[cmdindex] = build_add_dialog_row(
doc, table, row, dst, GEANY_GBG_NON_FT, cmd, TRUE);
label = gtk_label_new(_("Error Regular Expression"));
@@ -1873,7 +1876,7 @@
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
gtk_table_attach(table, label, 0, DC_N_COL, row, row + 1, GTK_FILL, GTK_FILL | GTK_EXPAND,
entry_x_padding, entry_y_padding);
- for (++row, cmd = 0; cmd < build_groups_count[GEANY_GBG_EXEC]; ++row,++cmdindex, ++cmd)
+ for (++row, cmd = 0; cmd < build_groups_count[GEANY_GBG_EXEC]; ++row, ++cmdindex, ++cmd)
fields->rows[cmdindex] = build_add_dialog_row(doc, table, row, dst, GEANY_GBG_EXEC, cmd, TRUE);
sep = gtk_hseparator_new();
gtk_table_attach(table, sep, 0, DC_N_COL, row, row + 1, GTK_FILL, GTK_FILL | GTK_EXPAND,
@@ -2115,9 +2118,9 @@
static const gchar *groups[GEANY_GBG_COUNT] = { "FT", "NF", "EX" };
static const gchar *fixedkey="xx_xx_xx";
-#define set_key_grp(key,grp) (key[prefixlen+0]=grp[0], key[prefixlen+1]=grp[1])
-#define set_key_cmd(key,cmd) (key[prefixlen+3]=cmd[0], key[prefixlen+4]=cmd[1])
-#define set_key_fld(key,fld) (key[prefixlen+6]=fld[0], key[prefixlen+7]=fld[1])
+#define set_key_grp(key, grp) (key[prefixlen + 0] = grp[0], key[prefixlen + 1] = grp[1])
+#define set_key_cmd(key, cmd) (key[prefixlen + 3] = cmd[0], key[prefixlen + 4] = cmd[1])
+#define set_key_fld(key, fld) (key[prefixlen + 6] = fld[0], key[prefixlen + 7] = fld[1])
static void build_load_menu_grp(GKeyFile *config, GeanyBuildCommand **dst, gint grp,
gchar *prefix, gboolean loc)
@@ -2175,7 +2178,7 @@
if (g_key_file_has_group(config, build_grp_name))
{
- switch(src)
+ switch (src)
{
case GEANY_BCS_FT:
ft = (GeanyFiletype*)p;
@@ -2249,7 +2252,7 @@
} else \
g_free(value);
- switch(src)
+ switch (src)
{
case GEANY_BCS_FT:
ft = (GeanyFiletype*)p;
@@ -2382,12 +2385,13 @@
i++;
}
else
- g_key_file_remove_key(d->config, build_grp_name,regkey, NULL);
+ g_key_file_remove_key(d->config, build_grp_name, regkey, NULL);
g_free(regkey);
if (i > 0)
g_ptr_array_add(d->ft_names, ft->name);
}
+
void build_save_menu(GKeyFile *config, gpointer ptr, GeanyBuildSource src)
{
GeanyFiletype *ft;
@@ -2395,7 +2399,7 @@
ForEachData data;
gchar *regkey;
- switch(src)
+ switch (src)
{
case GEANY_BCS_HOME_FT:
ft = (GeanyFiletype*)ptr;
@@ -2407,7 +2411,7 @@
if (NZV(ft->homeerror_regex_string))
g_key_file_set_string(config, build_grp_name, regkey, ft->projerror_regex_string);
else
- g_key_file_remove_key(config, build_grp_name,regkey, NULL);
+ g_key_file_remove_key(config, build_grp_name, regkey, NULL);
g_free(regkey);
break;
case GEANY_BCS_PREF:
@@ -2448,7 +2452,7 @@
void build_set_group_count(GeanyBuildGroup grp, gint count)
{
gint i, sum;
- if (count>build_groups_count[grp])
+ if (count > build_groups_count[grp])
build_groups_count[grp] = count;
for (i = 0, sum = 0; i < GEANY_GBG_COUNT; ++i)
sum += build_groups_count[i];
Modified: trunk/src/build.h
===================================================================
--- trunk/src/build.h 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/build.h 2009-09-16 14:13:38 UTC (rev 4199)
@@ -68,7 +68,7 @@
* Note this is a macro so that it can be used in static initialisers.
**/
#define GBO_TO_GBG(gbo) ((gbo)>GEANY_GBO_EXEC?GEANY_GBG_COUNT:((gbo)>=GEANY_GBO_EXEC?GEANY_GBG_EXEC: \
- ((gbo)>=GEANY_GBO_MAKE_ALL?GEANY_GBG_NON_FT:GEANY_GBG_FT)))
+ ((gbo) >= GEANY_GBO_MAKE_ALL ? GEANY_GBG_NON_FT : GEANY_GBG_FT)))
/** Convert @c GeanyBuildType to command index.
*
@@ -82,7 +82,7 @@
* Note this is a macro so that it can be used in static initialisers.
**/
#define GBO_TO_CMD(gbo) ((gbo)>=GEANY_GBO_COUNT?(gbo)-GEANY_GBO_COUNT:((gbo)>=GEANY_GBO_EXEC?(gbo)-GEANY_GBO_EXEC: \
- ((gbo)>=GEANY_GBO_MAKE_ALL?(gbo)-GEANY_GBO_MAKE_ALL:(gbo))))
+ ((gbo) >= GEANY_GBO_MAKE_ALL ? (gbo)-GEANY_GBO_MAKE_ALL : (gbo))))
enum GeanyBuildFixedMenuItems
{
Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/callbacks.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -530,6 +530,7 @@
document_new_file(NULL, NULL, NULL);
}
+
/* open file */
void
on_toolbutton_open_clicked (GtkAction *action,
@@ -655,6 +656,7 @@
sci_zoom_in(doc->editor->sci);
}
+
/* zoom out from menu bar and popup menu */
void
on_zoom_out1_activate (GtkMenuItem *menuitem,
@@ -2153,6 +2155,7 @@
doc->editor->line_breaking = !doc->editor->line_breaking;
}
+
void
on_replace_spaces_activate (GtkMenuItem *menuitem,
gpointer user_data)
@@ -2229,6 +2232,7 @@
#endif
}
+
gboolean on_window_state_event (GtkWidget *widget,
GdkEventWindowState *event,
gpointer user_data)
Modified: trunk/src/dialogs.c
===================================================================
--- trunk/src/dialogs.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/dialogs.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -696,7 +696,7 @@
#endif
g_free(msg);
- switch(ret)
+ switch (ret)
{
case GTK_RESPONSE_YES:
{
Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/document.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -114,9 +114,9 @@
/* ignore the case of filenames and paths under WIN32, causes errors if not */
#ifdef G_OS_WIN32
-#define filenamecmp(a,b) utils_str_casecmp((a), (b))
+#define filenamecmp(a, b) utils_str_casecmp((a), (b))
#else
-#define filenamecmp(a,b) strcmp((a), (b))
+#define filenamecmp(a, b) strcmp((a), (b))
#endif
/**
@@ -1411,6 +1411,7 @@
}
}
+
/**
* Reloads the document with the specified file encoding
* @a forced_enc or @c NULL to auto-detect the file encoding.
@@ -1786,7 +1787,7 @@
if (doc->encoding != NULL && ! utils_str_equal(doc->encoding, "UTF-8") &&
! utils_str_equal(doc->encoding, encodings[GEANY_ENCODING_NONE].charset))
{
- if (! save_convert_to_encoding(doc, &data, &len))
+ if (! save_convert_to_encoding(doc, &data, &len))
{
g_free(data);
return FALSE;
Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/editor.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -545,6 +545,7 @@
}
}
+
static void autocomplete_scope(GeanyEditor *editor)
{
ScintillaObject *sci = editor->sci;
@@ -1993,7 +1994,7 @@
construct = g_strdup_printf("%s\\end%s{%s}", eol, full_cmd, env);
SSM(sci, SCI_INSERTTEXT, pos, (sptr_t) construct);
- sci_goto_pos(sci,pos, TRUE);
+ sci_goto_pos(sci, pos, TRUE);
g_free(construct);
g_free(eol);
}
@@ -4094,7 +4095,7 @@
/* don't set the indicator on whitespace */
while (isspace(linebuf[i]))
i++;
- while (len > 1 && len > i && isspace(linebuf[len-1]))
+ while (len > 1 && len > i && isspace(linebuf[len - 1]))
{
len--;
end--;
@@ -4257,7 +4258,7 @@
if (search_pos == -1)
break;
- pos_in_line = sci_get_col_from_position(editor->sci,search_pos);
+ pos_in_line = sci_get_col_from_position(editor->sci, search_pos);
current_tab_true_length = tab_len - (pos_in_line % tab_len);
tab_str = g_strnfill(current_tab_true_length, ' ');
sci_set_target_start(editor->sci, search_pos);
@@ -4330,7 +4331,7 @@
i--;
ch = sci_get_char_at(editor->sci, i);
}
- if (i < (line_end-1))
+ if (i < (line_end - 1))
{
sci_set_target_start(editor->sci, i + 1);
sci_set_target_end(editor->sci, line_end);
Modified: trunk/src/encodings.c
===================================================================
--- trunk/src/encodings.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/encodings.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -232,6 +232,7 @@
return enc->charset;
}
+
static GtkWidget *radio_items[GEANY_ENCODINGS_MAX];
@@ -636,7 +637,7 @@
if (bom_len)
*bom_len = 2;
- if ((guchar)string[0]==0xfe && (guchar)string[1] == 0xff)
+ if ((guchar)string[0] == 0xfe && (guchar)string[1] == 0xff)
{
return GEANY_ENCODING_UTF_16BE; /* Big endian */
}
Modified: trunk/src/filetypes.c
===================================================================
--- trunk/src/filetypes.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/filetypes.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -941,7 +941,7 @@
if (strncmp(tmp, "env ", 4) == 0 && strlen(tmp) > 4)
{ /* skip "env" and read the following interpreter */
- basename_interpreter +=4;
+ basename_interpreter += 4;
}
if (strncmp(basename_interpreter, "sh", 2) == 0)
@@ -1228,8 +1228,8 @@
}
/* read build settings */
- build_load_menu( config, GEANY_BCS_FT, (gpointer)ft );
- build_load_menu( configh, GEANY_BCS_HOME_FT, (gpointer)ft );
+ build_load_menu(config, GEANY_BCS_FT, (gpointer)ft);
+ build_load_menu(configh, GEANY_BCS_HOME_FT, (gpointer)ft);
}
@@ -1482,10 +1482,10 @@
if (!NZV(regstr))
return FALSE;
- if (!ft->priv->error_regex_compiled || regstr!=ft->priv->last_string)
+ if (!ft->priv->error_regex_compiled || regstr != ft->priv->last_string)
{
compile_regex(ft, regex, regstr);
- ft->priv->last_string=regstr;
+ ft->priv->last_string = regstr;
}
if (!ft->priv->error_regex_compiled) /* regex error */
return FALSE;
Modified: trunk/src/gb.c
===================================================================
--- trunk/src/gb.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/gb.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -146,6 +146,7 @@
gtk_widget_grab_focus(button4);
}
+
static GtkWidget *create_help_dialog(void)
{
GtkWidget *help_dialog;
@@ -251,7 +252,7 @@
/* assign icons */
loops = 30;
- for(i = 0; i < loops; i++)
+ for (i = 0; i < loops; i++)
{
if (l > 9) l = 0;
if (m > 9) m = 0;
Modified: trunk/src/geanyobject.c
===================================================================
--- trunk/src/geanyobject.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/geanyobject.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -134,7 +134,7 @@
}
-static void geany_cclosure_marshal_BOOL__POINTER_POINTER( GClosure *closure, GValue *return_value,
+static void geany_cclosure_marshal_BOOL__POINTER_POINTER(GClosure *closure, GValue *return_value,
guint n_param_values, const GValue *param_values,
gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data)
{
Modified: trunk/src/highlighting.c
===================================================================
--- trunk/src/highlighting.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/highlighting.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -371,11 +371,11 @@
if (list == NULL)
list = g_key_file_get_string_list(config, section, key, &len, NULL);
- if (G_LIKELY(list != NULL) && G_LIKELY(list[0] != NULL) )
+ if (G_LIKELY(list != NULL) && G_LIKELY(list[0] != NULL))
style->foreground = strtol(list[0], &end1, 10);
else
style->foreground = fdefault_val;
- if (G_LIKELY(list != NULL) && G_LIKELY(list[1] != NULL) )
+ if (G_LIKELY(list != NULL) && G_LIKELY(list[1] != NULL))
style->background = strtol(list[1], &end2, 10);
else
style->background = sdefault_val;
@@ -687,18 +687,18 @@
{
case 2:
{
- SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPEN, SC_MARK_CIRCLEMINUS);
- SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDER, SC_MARK_CIRCLEPLUS);
- SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEREND, SC_MARK_CIRCLEPLUSCONNECTED);
- SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_CIRCLEMINUSCONNECTED);
+ SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPEN, SC_MARK_CIRCLEMINUS);
+ SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDER, SC_MARK_CIRCLEPLUS);
+ SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEREND, SC_MARK_CIRCLEPLUSCONNECTED);
+ SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_CIRCLEMINUSCONNECTED);
break;
}
default:
{
- SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPEN, SC_MARK_BOXMINUS);
- SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDER, SC_MARK_BOXPLUS);
- SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEREND, SC_MARK_BOXPLUSCONNECTED);
- SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_BOXMINUSCONNECTED);
+ SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPEN, SC_MARK_BOXMINUS);
+ SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDER, SC_MARK_BOXPLUS);
+ SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEREND, SC_MARK_BOXPLUSCONNECTED);
+ SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDEROPENMID, SC_MARK_BOXMINUSCONNECTED);
break;
}
}
@@ -708,34 +708,34 @@
{
case 2:
{
- SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_TCORNERCURVE);
- SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNERCURVE);
+ SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_TCORNERCURVE);
+ SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNERCURVE);
break;
}
default:
{
- SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_TCORNER);
- SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNER);
+ SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERMIDTAIL, SC_MARK_TCORNER);
+ SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERTAIL, SC_MARK_LCORNER);
break;
}
}
- SSM(sci,SCI_MARKERDEFINE, SC_MARKNUM_FOLDERSUB, SC_MARK_VLINE);
+ SSM(sci, SCI_MARKERDEFINE, SC_MARKNUM_FOLDERSUB, SC_MARK_VLINE);
- SSM(sci,SCI_MARKERSETFORE, SC_MARKNUM_FOLDEROPEN, 0xffffff);
- SSM(sci,SCI_MARKERSETBACK, SC_MARKNUM_FOLDEROPEN, 0x000000);
- SSM(sci,SCI_MARKERSETFORE, SC_MARKNUM_FOLDER, 0xffffff);
- SSM(sci,SCI_MARKERSETBACK, SC_MARKNUM_FOLDER, 0x000000);
- SSM(sci,SCI_MARKERSETFORE, SC_MARKNUM_FOLDERSUB, 0xffffff);
- SSM(sci,SCI_MARKERSETBACK, SC_MARKNUM_FOLDERSUB, 0x000000);
- SSM(sci,SCI_MARKERSETFORE, SC_MARKNUM_FOLDERTAIL, 0xffffff);
- SSM(sci,SCI_MARKERSETBACK, SC_MARKNUM_FOLDERTAIL, 0x000000);
- SSM(sci,SCI_MARKERSETFORE, SC_MARKNUM_FOLDEREND, 0xffffff);
- SSM(sci,SCI_MARKERSETBACK, SC_MARKNUM_FOLDEREND, 0x000000);
- SSM(sci,SCI_MARKERSETFORE, SC_MARKNUM_FOLDEROPENMID, 0xffffff);
- SSM(sci,SCI_MARKERSETBACK, SC_MARKNUM_FOLDEROPENMID, 0x000000);
- SSM(sci,SCI_MARKERSETFORE, SC_MARKNUM_FOLDERMIDTAIL, 0xffffff);
- SSM(sci,SCI_MARKERSETBACK, SC_MARKNUM_FOLDERMIDTAIL, 0x000000);
+ SSM(sci, SCI_MARKERSETFORE, SC_MARKNUM_FOLDEROPEN, 0xffffff);
+ SSM(sci, SCI_MARKERSETBACK, SC_MARKNUM_FOLDEROPEN, 0x000000);
+ SSM(sci, SCI_MARKERSETFORE, SC_MARKNUM_FOLDER, 0xffffff);
+ SSM(sci, SCI_MARKERSETBACK, SC_MARKNUM_FOLDER, 0x000000);
+ SSM(sci, SCI_MARKERSETFORE, SC_MARKNUM_FOLDERSUB, 0xffffff);
+ SSM(sci, SCI_MARKERSETBACK, SC_MARKNUM_FOLDERSUB, 0x000000);
+ SSM(sci, SCI_MARKERSETFORE, SC_MARKNUM_FOLDERTAIL, 0xffffff);
+ SSM(sci, SCI_MARKERSETBACK, SC_MARKNUM_FOLDERTAIL, 0x000000);
+ SSM(sci, SCI_MARKERSETFORE, SC_MARKNUM_FOLDEREND, 0xffffff);
+ SSM(sci, SCI_MARKERSETBACK, SC_MARKNUM_FOLDEREND, 0x000000);
+ SSM(sci, SCI_MARKERSETFORE, SC_MARKNUM_FOLDEROPENMID, 0xffffff);
+ SSM(sci, SCI_MARKERSETBACK, SC_MARKNUM_FOLDEROPENMID, 0x000000);
+ SSM(sci, SCI_MARKERSETFORE, SC_MARKNUM_FOLDERMIDTAIL, 0xffffff);
+ SSM(sci, SCI_MARKERSETBACK, SC_MARKNUM_FOLDERMIDTAIL, 0x000000);
SSM(sci, SCI_SETPROPERTY, (uptr_t) "fold", (sptr_t) "1");
SSM(sci, SCI_SETPROPERTY, (uptr_t) "fold.compact", (sptr_t) "0");
@@ -1019,6 +1019,7 @@
SSM(sci, SCI_SETPROPERTY, (uptr_t) "preprocessor.end.$(file.patterns.cpp)", (sptr_t) "endif");
}
+
static void styleset_cs_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
{
new_styleset(GEANY_FILETYPES_CS, 21);
@@ -2659,6 +2660,7 @@
style_sets[GEANY_FILETYPES_MARKDOWN].keywords = NULL;
}
+
static void styleset_markdown(ScintillaObject *sci)
{
const filetype_id ft_id = GEANY_FILETYPES_MARKDOWN;
@@ -2690,6 +2692,7 @@
set_sci_style(sci, SCE_MARKDOWN_CODEBK, GEANY_FILETYPES_MARKDOWN, 16);
}
+
static void styleset_haskell_init(gint ft_id, GKeyFile *config, GKeyFile *config_home)
{
new_styleset(GEANY_FILETYPES_HASKELL, 17);
Modified: trunk/src/keybindings.c
===================================================================
--- trunk/src/keybindings.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/keybindings.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -1298,11 +1298,13 @@
on_preferences1_activate(NULL, NULL);
}
+
static void cb_func_menu_help(G_GNUC_UNUSED guint key_id)
{
on_help1_activate(NULL, NULL);
}
+
static void cb_func_search_action(guint key_id)
{
GeanyDocument *doc = document_get_current();
@@ -1394,6 +1396,7 @@
gtk_check_menu_item_set_active(c, ! gtk_check_menu_item_get_active(c));
}
+
static void cb_func_menu_messagewindow(G_GNUC_UNUSED guint key_id)
{
GtkCheckMenuItem *c = GTK_CHECK_MENU_ITEM(
@@ -2016,7 +2019,7 @@
editor_strip_line_trailing_spaces(editor, i);
/* remove starting spaces from second and following lines due to the same reason */
- for (i = start+1; i <= end; i++)
+ for (i = start + 1; i <= end; i++)
sci_set_line_indentation(editor->sci, i, 0);
/*
Modified: trunk/src/keyfile.c
===================================================================
--- trunk/src/keyfile.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/keyfile.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -407,7 +407,7 @@
g_key_file_set_string(config, PACKAGE, "context_action_cmd", tool_prefs.context_action_cmd);
/* build menu */
- build_save_menu( config, NULL, GEANY_BCS_PREF );
+ build_save_menu(config, NULL, GEANY_BCS_PREF);
/* printing */
g_key_file_set_string(config, "printing", "print_cmd", printing_prefs.external_print_cmd ? printing_prefs.external_print_cmd : "");
@@ -776,7 +776,7 @@
build_set_group_count( GEANY_GBG_FT, utils_get_setting_integer( config, "build-menu", "number_ft_menu_items", 0 ));
build_set_group_count( GEANY_GBG_NON_FT, utils_get_setting_integer( config, "build-menu", "number_non_ft_menu_items", 0 ));
build_set_group_count( GEANY_GBG_EXEC, utils_get_setting_integer( config, "build-menu", "number_exec_menu_items", 0 ));
- build_load_menu( config, GEANY_BCS_PREF, NULL );
+ build_load_menu(config, GEANY_BCS_PREF, NULL);
/* printing */
tmp_string2 = g_find_program_in_path(GEANY_DEFAULT_TOOLS_PRINTCMD);
Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/main.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -158,6 +158,7 @@
}
}
+
/* special things for the initial setup of the checkboxes and related stuff
* an action on a setting is only performed if the setting is not equal to the program default
* (all the following code is not perfect but it works for the moment) */
@@ -224,7 +225,7 @@
ui_widgets.open_filesel = NULL;
ui_widgets.save_filesel = NULL;
ui_widgets.prefs_dialog = NULL;
- main_status.main_window_realized= FALSE;
+ main_status.main_window_realized = FALSE;
file_prefs.tab_order_ltr = FALSE;
main_status.quitting = FALSE;
ignore_callback = FALSE;
@@ -1025,7 +1026,7 @@
{
socket_info.read_ioc = g_io_channel_unix_new(socket_info.lock_socket);
socket_info.lock_socket_tag = g_io_add_watch(socket_info.read_ioc,
- G_IO_IN|G_IO_PRI|G_IO_ERR, socket_lock_input_cb, main_widgets.window);
+ G_IO_IN | G_IO_PRI | G_IO_ERR, socket_lock_input_cb, main_widgets.window);
}
#endif
Modified: trunk/src/msgwindow.c
===================================================================
--- trunk/src/msgwindow.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/msgwindow.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -1061,6 +1061,7 @@
gtk_widget_grab_focus(widget);
}
+
/**
* Removes all messages from a tab specified by @a tabnum in the messages window.
*
Modified: trunk/src/notebook.c
===================================================================
--- trunk/src/notebook.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/notebook.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -390,7 +390,7 @@
GtkWidget *page;
/* deal with less than 2 pages */
- switch(gtk_notebook_get_n_pages(notebook))
+ switch (gtk_notebook_get_n_pages(notebook))
{case 0: return -1; case 1: return 0;}
tab_pos = gtk_notebook_get_tab_pos(notebook); /* which edge */
@@ -412,9 +412,9 @@
max_x = tab->allocation.x + tab->allocation.width - GTK_WIDGET(notebook)->allocation.x;
max_y = tab->allocation.y + tab->allocation.height - GTK_WIDGET(notebook)->allocation.y;
- if (((tab_pos == GTK_POS_TOP) || (tab_pos == GTK_POS_BOTTOM)) && (x<=max_x))
+ if (((tab_pos == GTK_POS_TOP) || (tab_pos == GTK_POS_BOTTOM)) && (x <= max_x))
return page_num;
- else if (((tab_pos == GTK_POS_LEFT) || (tab_pos == GTK_POS_RIGHT)) && (y<=max_y))
+ else if (((tab_pos == GTK_POS_LEFT) || (tab_pos == GTK_POS_RIGHT)) && (y <= max_y))
return page_num;
page_num++;
Modified: trunk/src/prefix.c
===================================================================
--- trunk/src/prefix.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/prefix.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -39,7 +39,7 @@
#ifdef __GNUC__
#define br_return_val_if_fail(expr,val) if (!(expr)) {fprintf (stderr, "** BinReloc (%s): assertion %s failed\n", __PRETTY_FUNCTION__, #expr); return val;}
#else
- #define br_return_val_if_fail(expr,val) if (!(expr)) return val
+ #define br_return_val_if_fail(expr, val) if (!(expr)) return val
#endif /* __GNUC__ */
@@ -59,6 +59,7 @@
free (br_last_value);
}
+
/**
* br_thread_local_store:
* str: A dynamically allocated string.
@@ -287,6 +288,7 @@
return newpath;
}
+
#else /* ENABLE_BINRELOC */
typedef int iso_c_forbids_an_empty_source_file;
Modified: trunk/src/project.c
===================================================================
--- trunk/src/project.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/project.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -91,7 +91,7 @@
#define SHOW_ERR(args) dialogs_show_msgbox(GTK_MESSAGE_ERROR, args)
-#define SHOW_ERR1(args,more) dialogs_show_msgbox(GTK_MESSAGE_ERROR, args, more)
+#define SHOW_ERR1(args, more) dialogs_show_msgbox(GTK_MESSAGE_ERROR, args, more)
#define MAX_NAME_LEN 50
/* "projects" is part of the default project base path so be careful when translating
* please avoid special characters and spaces, look at the source for details or ask Frank */
@@ -322,12 +322,12 @@
}
-static void remove_foreach_project_filetype( gpointer data, gpointer user_data )
+static void remove_foreach_project_filetype(gpointer data, gpointer user_data)
{
GeanyFiletype *ft = (GeanyFiletype*)data;
if (ft != NULL)
{
- setptr( ft->projfilecmds, NULL);
+ setptr(ft->projfilecmds, NULL);
setptr(ft->projerror_regex_string, NULL);
ft->project_list_entry = -1;
}
@@ -347,7 +347,7 @@
/* remove project filetypes build entries */
if (app->project->build_filetypes_list != NULL)
{
- g_ptr_array_foreach( app->project->build_filetypes_list, remove_foreach_project_filetype, NULL);
+ g_ptr_array_foreach(app->project->build_filetypes_list, remove_foreach_project_filetype, NULL);
g_ptr_array_free(app->project->build_filetypes_list, FALSE);
}
@@ -476,8 +476,8 @@
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (0), 0, 0);
- if (doc!=NULL) ft=doc->file_type;
- build_table = build_commands_table( doc, GEANY_BCS_PROJ, &(e->build_properties), ft );
+ if (doc != NULL) ft = doc->file_type;
+ build_table = build_commands_table(doc, GEANY_BCS_PROJ, &(e->build_properties), ft);
label = gtk_label_new(_("Build"));
notebook = ui_lookup_widget(e->dialog, "project_notebook");
gtk_notebook_insert_page(GTK_NOTEBOOK(notebook), build_table, label, 2);
@@ -582,7 +582,7 @@
stash_group_update(indent_group, e->dialog);
}
- build_free_fields( e->build_properties );
+ build_free_fields(e->build_properties);
gtk_widget_destroy(e->dialog);
g_free(e);
}
@@ -726,7 +726,7 @@
GeanyDocument *doc = document_get_current();
BuildDestination menu_dst;
GeanyBuildCommand *oldvalue;
- GeanyFiletype *ft=NULL;
+ GeanyFiletype *ft = NULL;
/* get and set the project description */
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(e->description));
@@ -735,9 +735,9 @@
setptr(p->description, g_strdup(gtk_text_buffer_get_text(buffer, &start, &end, FALSE)));
/* read the project build menu */
- if ( doc!=NULL )
+ if (doc != NULL)
ft = doc->file_type;
- if ( ft!=NULL )
+ if (ft != NULL)
{
menu_dst.dst[GEANY_GBG_FT] = &(ft->projfilecmds);
oldvalue = ft->projfilecmds;
@@ -752,7 +752,7 @@
menu_dst.dst[GEANY_GBG_NON_FT] = &non_ft_proj;
menu_dst.dst[GEANY_GBG_EXEC] = &exec_proj;
menu_dst.nonfileregexstr = ®ex_proj;
- build_read_commands( &menu_dst, e->build_properties, GTK_RESPONSE_ACCEPT );
+ build_read_commands(&menu_dst, e->build_properties, GTK_RESPONSE_ACCEPT);
if (ft != NULL && ft->projfilecmds != oldvalue && ft->project_list_entry < 0)
{
if (p->build_filetypes_list == NULL)
@@ -968,7 +968,7 @@
p->base_path = utils_get_setting_string(config, "project", "base_path", "");
p->file_patterns = g_key_file_get_string_list(config, "project", "file_patterns", NULL, NULL);
- build_load_menu( config, GEANY_BCS_PROJ, (gpointer)p );
+ build_load_menu(config, GEANY_BCS_PROJ, (gpointer)p);
if (project_prefs.project_session)
{
/* save current (non-project) session (it could has been changed since program startup) */
@@ -1022,7 +1022,7 @@
/* store the session files into the project too */
if (project_prefs.project_session)
configuration_save_session_files(config);
- build_save_menu( config, (gpointer)p, GEANY_BCS_PROJ );
+ build_save_menu(config, (gpointer)p, GEANY_BCS_PROJ);
if (emit_signal)
{
g_signal_emit_by_name(geany_object, "project-save", config);
Modified: trunk/src/queue.c
===================================================================
--- trunk/src/queue.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/queue.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -105,6 +105,7 @@
while ((queue_start = queue_delete(queue_start, NULL, FALSE)));
}
+
typedef void (*ForeachFunc) (GeanyQueue *queue_start, gpointer data);
/* Iterates through param, and calls func with the node queue_start and each node in param */
Modified: trunk/src/sciwrappers.c
===================================================================
--- trunk/src/sciwrappers.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/sciwrappers.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -54,10 +54,11 @@
}
else
{
- SSM (sci, SCI_SETMARGINWIDTHN, 0, 0 );
+ SSM (sci, SCI_SETMARGINWIDTHN, 0, 0);
}
}
+
void sci_set_mark_long_lines(ScintillaObject *sci, gint type, gint column, const gchar *colour)
{
if (column == 0)
@@ -86,7 +87,7 @@
/* symbol margin visibility */
-void sci_set_symbol_margin(ScintillaObject *sci, gboolean set )
+void sci_set_symbol_margin(ScintillaObject *sci, gboolean set)
{
if (set)
{
@@ -100,6 +101,7 @@
}
}
+
/* folding margin visibility */
void sci_set_folding_margin_visible(ScintillaObject *sci, gboolean set)
{
@@ -115,115 +117,123 @@
}
}
+
/* end of lines */
-void sci_set_visible_eols(ScintillaObject *sci, gboolean set )
+void sci_set_visible_eols(ScintillaObject *sci, gboolean set)
{
- SSM(sci,SCI_SETVIEWEOL,set,0);
+ SSM(sci, SCI_SETVIEWEOL, set, 0);
}
-void sci_set_visible_white_spaces(ScintillaObject *sci, gboolean set )
+
+void sci_set_visible_white_spaces(ScintillaObject *sci, gboolean set)
{
if (set)
- SSM(sci,SCI_SETVIEWWS,SCWS_VISIBLEALWAYS,0);
+ SSM(sci, SCI_SETVIEWWS, SCWS_VISIBLEALWAYS, 0);
else
- SSM(sci,SCI_SETVIEWWS,SCWS_INVISIBLE,0);
+ SSM(sci, SCI_SETVIEWWS, SCWS_INVISIBLE, 0);
}
-void sci_set_lines_wrapped(ScintillaObject *sci, gboolean set )
+
+void sci_set_lines_wrapped(ScintillaObject *sci, gboolean set)
{
if (set)
- SSM(sci,SCI_SETWRAPMODE,SC_WRAP_WORD,0);
+ SSM(sci, SCI_SETWRAPMODE, SC_WRAP_WORD, 0);
else
- SSM(sci,SCI_SETWRAPMODE,SC_WRAP_NONE,0);
+ SSM(sci, SCI_SETWRAPMODE, SC_WRAP_NONE, 0);
}
-gint sci_get_eol_mode( ScintillaObject *sci)
+
+gint sci_get_eol_mode(ScintillaObject *sci)
{
- return SSM( sci, SCI_GETEOLMODE, 0, 0);
+ return SSM(sci, SCI_GETEOLMODE, 0, 0);
}
-void sci_set_eol_mode( ScintillaObject *sci, gint eolmode)
+
+void sci_set_eol_mode(ScintillaObject *sci, gint eolmode)
{
- SSM( sci, SCI_SETEOLMODE, eolmode, 0);
+ SSM(sci, SCI_SETEOLMODE, eolmode, 0);
}
-void sci_convert_eols( ScintillaObject *sci, gint eolmode)
+
+void sci_convert_eols(ScintillaObject *sci, gint eolmode)
{
- SSM( sci, SCI_CONVERTEOLS, eolmode,0);
+ SSM(sci, SCI_CONVERTEOLS, eolmode, 0);
}
+
void sci_add_text(ScintillaObject *sci, const gchar *text)
{
if (text != NULL)
{ /* if null text is passed to scintilla will segfault */
- SSM( sci, SCI_ADDTEXT, strlen(text), (sptr_t) text);
+ SSM(sci, SCI_ADDTEXT, strlen(text), (sptr_t) text);
}
}
+
/** Set all text.
* @param sci Scintilla widget.
* @param text Text. */
void sci_set_text(ScintillaObject *sci, const gchar *text)
{
if( text != NULL ){ /* if null text is passed to scintilla will segfault */
- SSM( sci, SCI_SETTEXT, 0, (sptr_t) text);
+ SSM(sci, SCI_SETTEXT, 0, (sptr_t) text);
}
}
-gboolean sci_can_undo( ScintillaObject *sci )
+gboolean sci_can_undo(ScintillaObject *sci)
{
- return SSM( sci, SCI_CANUNDO, 0, 0);
+ return SSM(sci, SCI_CANUNDO, 0, 0);
}
-gboolean sci_can_redo( ScintillaObject *sci )
+gboolean sci_can_redo(ScintillaObject *sci)
{
- return SSM( sci, SCI_CANREDO, 0, 0);
+ return SSM(sci, SCI_CANREDO, 0, 0);
}
-void sci_undo( ScintillaObject *sci )
+void sci_undo(ScintillaObject *sci)
{
- if( sci_can_undo(sci) )
- SSM( sci, SCI_UNDO, 0, 0);
+ if (sci_can_undo(sci))
+ SSM(sci, SCI_UNDO, 0, 0);
}
-void sci_redo( ScintillaObject *sci )
+void sci_redo(ScintillaObject *sci)
{
- if( sci_can_redo( sci ) )
- SSM( sci, SCI_REDO,0,0);
+ if (sci_can_redo(sci) )
+ SSM(sci, SCI_REDO, 0, 0);
}
/** Begin grouping a set of edits together as one Undo action.
* You must call sci_end_undo_action() after making your edits.
* @param sci Scintilla @c GtkWidget. */
-void sci_start_undo_action( ScintillaObject *sci )
+void sci_start_undo_action(ScintillaObject *sci)
{
- SSM( sci,SCI_BEGINUNDOACTION,0,0 );
+ SSM(sci, SCI_BEGINUNDOACTION, 0, 0);
}
/** End grouping a set of edits together as one Undo action.
* @param sci Scintilla @c GtkWidget.
* @see sci_start_undo_action(). */
-void sci_end_undo_action( ScintillaObject *sci )
+void sci_end_undo_action(ScintillaObject *sci)
{
- SSM( sci, SCI_ENDUNDOACTION,0,0);
+ SSM(sci, SCI_ENDUNDOACTION, 0, 0);
}
-void sci_set_undo_collection( ScintillaObject *sci, gboolean set )
+void sci_set_undo_collection(ScintillaObject *sci, gboolean set)
{
- SSM( sci, SCI_SETUNDOCOLLECTION,set,0);
+ SSM(sci, SCI_SETUNDOCOLLECTION, set, 0);
}
-void sci_empty_undo_buffer( ScintillaObject *sci )
+void sci_empty_undo_buffer(ScintillaObject *sci)
{
- SSM( sci, SCI_EMPTYUNDOBUFFER,0,0);
+ SSM(sci, SCI_EMPTYUNDOBUFFER, 0, 0);
}
@@ -233,27 +243,27 @@
}
-void sci_zoom_in( ScintillaObject *sci )
+void sci_zoom_in(ScintillaObject *sci)
{
- SSM( sci, SCI_ZOOMIN,0,0);
+ SSM(sci, SCI_ZOOMIN, 0, 0);
}
-void sci_zoom_out( ScintillaObject *sci )
+void sci_zoom_out(ScintillaObject *sci)
{
- SSM( sci, SCI_ZOOMOUT,0,0);
+ SSM(sci, SCI_ZOOMOUT, 0, 0);
}
-void sci_zoom_off( ScintillaObject *sci )
+void sci_zoom_off(ScintillaObject *sci)
{
- SSM( sci, SCI_SETZOOM,0,0);
+ SSM(sci, SCI_SETZOOM, 0, 0);
}
-gint sci_get_zoom( ScintillaObject *sci )
+gint sci_get_zoom(ScintillaObject *sci)
{
- return SSM( sci, SCI_GETZOOM,0,0);
+ return SSM(sci, SCI_GETZOOM, 0, 0);
}
@@ -261,9 +271,9 @@
* @param sci Scintilla widget.
* @param line_number Line number.
* @param marker Marker number. */
-void sci_set_marker_at_line( ScintillaObject *sci, gint line_number, gint marker )
+void sci_set_marker_at_line(ScintillaObject *sci, gint line_number, gint marker)
{
- SSM( sci, SCI_MARKERADD, line_number, marker);
+ SSM(sci, SCI_MARKERADD, line_number, marker);
}
@@ -271,9 +281,9 @@
* @param sci Scintilla widget.
* @param line_number Line number.
* @param marker Marker number. */
-void sci_delete_marker_at_line( ScintillaObject *sci, gint line_number, gint marker )
+void sci_delete_marker_at_line(ScintillaObject *sci, gint line_number, gint marker)
{
- SSM( sci, SCI_MARKERDELETE, line_number, marker);
+ SSM(sci, SCI_MARKERDELETE, line_number, marker);
}
@@ -286,7 +296,7 @@
{
gint state;
- state = SSM( sci, SCI_MARKERGET, line, 0 );
+ state = SSM(sci, SCI_MARKERGET, line, 0);
return (state & (1 << marker));
}
@@ -338,7 +348,7 @@
/** Get line number from position.
* @param sci Scintilla widget.
* @param position Position. */
-gint sci_get_line_from_position(ScintillaObject *sci, gint position )
+gint sci_get_line_from_position(ScintillaObject *sci, gint position)
{
return SSM(sci, SCI_LINEFROMPOSITION, position, 0);
}
@@ -347,7 +357,7 @@
/** Get column number relative to the start of the line that @a position is on.
* @param sci Scintilla widget.
* @param position Position. */
-gint sci_get_col_from_position(ScintillaObject *sci, gint position )
+gint sci_get_col_from_position(ScintillaObject *sci, gint position)
{
return SSM(sci, SCI_GETCOLUMN, position, 0);
}
@@ -357,7 +367,7 @@
* @param sci Scintilla widget.
* @param line Line.
* @return Position. */
-gint sci_get_position_from_line(ScintillaObject *sci, gint line )
+gint sci_get_position_from_line(ScintillaObject *sci, gint line)
{
return SSM(sci, SCI_POSITIONFROMLINE, line, 0);
}
@@ -366,7 +376,7 @@
/** Get cursor position.
* @param sci Scintilla widget.
* @return Position. */
-gint sci_get_current_position(ScintillaObject *sci )
+gint sci_get_current_position(ScintillaObject *sci)
{
return SSM(sci, SCI_GETCURRENTPOS, 0, 0);
}
@@ -400,7 +410,7 @@
/** Get total number of lines.
* @param sci Scintilla widget. */
-gint sci_get_line_count( ScintillaObject *sci )
+gint sci_get_line_count(ScintillaObject *sci)
{
return SSM(sci, SCI_GETLINECOUNT, 0, 0);
}
@@ -465,7 +475,7 @@
* @return Position. */
gint sci_get_selection_start(ScintillaObject *sci)
{
- return SSM(sci, SCI_GETSELECTIONSTART,0,0);
+ return SSM(sci, SCI_GETSELECTIONSTART, 0, 0);
}
@@ -474,7 +484,7 @@
* @return Position. */
gint sci_get_selection_end(ScintillaObject *sci)
{
- return SSM(sci, SCI_GETSELECTIONEND,0,0);
+ return SSM(sci, SCI_GETSELECTIONEND, 0, 0);
}
@@ -483,7 +493,7 @@
* @param text Text. */
void sci_replace_sel(ScintillaObject *sci, const gchar *text)
{
- SSM(sci, SCI_REPLACESEL,0, (sptr_t) text);
+ SSM(sci, SCI_REPLACESEL, 0, (sptr_t) text);
}
@@ -492,13 +502,13 @@
* @return Length. */
gint sci_get_length(ScintillaObject *sci)
{
- return SSM(sci,SCI_GETLENGTH,0,0);
+ return SSM(sci, SCI_GETLENGTH, 0, 0);
}
gint sci_get_lexer(ScintillaObject *sci)
{
- return SSM(sci,SCI_GETLEXER,0,0);
+ return SSM(sci, SCI_GETLEXER, 0, 0);
}
@@ -506,9 +516,9 @@
* @param sci Scintilla widget.
* @param line Line number.
* @return Length. */
-gint sci_get_line_length(ScintillaObject *sci,gint line)
+gint sci_get_line_length(ScintillaObject *sci, gint line)
{
- return SSM(sci,SCI_LINELENGTH, line,0);
+ return SSM(sci, SCI_LINELENGTH, line, 0);
}
@@ -536,9 +546,10 @@
* @param text Text buffer; must be allocated @a len + 1 bytes for null-termination. */
void sci_get_text(ScintillaObject *sci, gint len, gchar *text)
{
- SSM( sci, SCI_GETTEXT, len, (sptr_t) text );
+ SSM(sci, SCI_GETTEXT, len, (sptr_t) text);
}
+
/** Get all text inside a given text length.
* @param sci Scintilla widget.
* @param len Length of the text to retrieve from the start of the document,
@@ -554,6 +565,7 @@
return text;
}
+
/** Get selected text.
* @deprecated sci_get_selected_text is deprecated and should not be used in newly-written code.
* Use sci_get_selection_contents() instead.
@@ -563,9 +575,10 @@
* for null-termination. */
void sci_get_selected_text(ScintillaObject *sci, gchar *text)
{
- SSM( sci, SCI_GETSELTEXT, 0, (sptr_t) text);
+ SSM(sci, SCI_GETSELTEXT, 0, (sptr_t) text);
}
+
/** Get selected text.
* @param sci Scintilla widget.
*
@@ -583,14 +596,16 @@
return selection;
}
+
/** Get selected text length.
* @param sci Scintilla widget.
* @return Length. */
gint sci_get_selected_text_length(ScintillaObject *sci)
{
- return SSM( sci, SCI_GETSELTEXT, 0, 0);
+ return SSM(sci, SCI_GETSELTEXT, 0, 0);
}
+
gint sci_get_position_from_xy(ScintillaObject *sci, gint x, gint y, gboolean nearby)
{
/* for nearby return -1 if there is no character near to the x,y point. */
@@ -604,7 +619,7 @@
* @return Whether @a line will be drawn on the screen. */
gboolean sci_get_line_is_visible(ScintillaObject *sci, gint line)
{
- return SSM(sci,SCI_GETLINEVISIBLE, line,0);
+ return SSM(sci, SCI_GETLINEVISIBLE, line, 0);
}
@@ -613,50 +628,50 @@
* @param line Line number. */
void sci_ensure_line_is_visible(ScintillaObject *sci, gint line)
{
- SSM(sci,SCI_ENSUREVISIBLE,line,0);
+ SSM(sci, SCI_ENSUREVISIBLE, line, 0);
}
gint sci_get_fold_level(ScintillaObject *sci, gint line)
{
- return SSM(sci,SCI_GETFOLDLEVEL, line,0);
+ return SSM(sci, SCI_GETFOLDLEVEL, line, 0);
}
/* Get the line number of the fold point before start_line, or -1 if there isn't one */
gint sci_get_fold_parent(ScintillaObject *sci, gint start_line)
{
- return SSM( sci, SCI_GETFOLDPARENT, start_line, 0);
+ return SSM(sci, SCI_GETFOLDPARENT, start_line, 0);
}
void sci_toggle_fold(ScintillaObject *sci, gint line)
{
- SSM( sci, SCI_TOGGLEFOLD, line, 1);
+ SSM(sci, SCI_TOGGLEFOLD, line, 1);
}
gboolean sci_get_fold_expanded(ScintillaObject *sci, gint line)
{
- return SSM( sci, SCI_GETFOLDEXPANDED, line, 0);
+ return SSM(sci, SCI_GETFOLDEXPANDED, line, 0);
}
-void sci_colourise( ScintillaObject *sci, gint start, gint end)
+void sci_colourise(ScintillaObject *sci, gint start, gint end)
{
- SSM( sci, SCI_COLOURISE, start, end);
+ SSM(sci, SCI_COLOURISE, start, end);
}
void sci_clear_all(ScintillaObject *sci)
{
- SSM( sci, SCI_CLEARALL, 0, 0);
+ SSM(sci, SCI_CLEARALL, 0, 0);
}
gint sci_get_end_styled(ScintillaObject *sci)
{
- return SSM(sci,SCI_GETENDSTYLED, 0,0);
+ return SSM(sci, SCI_GETENDSTYLED, 0, 0);
}
@@ -693,6 +708,7 @@
SSM(sci, SCI_SETSAVEPOINT, 0, 0);
}
+
void sci_set_indentation_guides(ScintillaObject *sci, gint mode)
{
SSM(sci, SCI_SETINDENTATIONGUIDES, mode, 0);
@@ -713,7 +729,7 @@
**/
gboolean sci_has_selection(ScintillaObject *sci)
{
- if (SSM(sci, SCI_GETSELECTIONEND,0,0) - SSM(sci, SCI_GETSELECTIONSTART,0,0))
+ if (SSM(sci, SCI_GETSELECTIONEND, 0, 0) - SSM(sci, SCI_GETSELECTIONSTART, 0, 0))
return TRUE;
else
return FALSE;
@@ -722,7 +738,7 @@
void sci_goto_pos(ScintillaObject *sci, gint pos, gboolean unfold)
{
- if (unfold) SSM(sci,SCI_ENSUREVISIBLE,SSM(sci, SCI_LINEFROMPOSITION, pos, 0),0);
+ if (unfold) SSM(sci, SCI_ENSUREVISIBLE, SSM(sci, SCI_LINEFROMPOSITION, pos, 0), 0);
SSM(sci, SCI_GOTOPOS, pos, 0);
}
@@ -765,19 +781,19 @@
gint sci_search_next(ScintillaObject *sci, gint flags, const gchar *text)
{
- return SSM(sci, SCI_SEARCHNEXT, flags, (sptr_t) text );
+ return SSM(sci, SCI_SEARCHNEXT, flags, (sptr_t) text);
}
gint sci_search_prev(ScintillaObject *sci, gint flags, const gchar *text)
{
- return SSM(sci, SCI_SEARCHPREV, flags, (sptr_t) text );
+ return SSM(sci, SCI_SEARCHPREV, flags, (sptr_t) text);
}
gint sci_find_text(ScintillaObject *sci, gint flags, struct Sci_TextToFind *ttf)
{
- return SSM(sci, SCI_FINDTEXT, flags, (long) ttf );
+ return SSM(sci, SCI_FINDTEXT, flags, (long) ttf);
}
@@ -810,6 +826,7 @@
return SSM(sci, SCI_GETSTYLEAT, position, 0);
}
+
void sci_set_codepage(ScintillaObject *sci, gint cp)
{
g_return_if_fail(cp == 0 || cp == SC_CP_UTF8);
@@ -846,6 +863,7 @@
SSM(sci, SCI_GETTEXTRANGE, 0, (long) &tr);
}
+
/** Get text between @a start and @a end.
*
* @param sci Scintilla widget.
@@ -914,11 +932,13 @@
SSM(sci, SCI_SETKEYWORDS, k, (sptr_t) text);
}
+
void sci_set_readonly(ScintillaObject *sci, gboolean readonly)
{
SSM(sci, SCI_SETREADONLY, readonly, 0);
}
+
/** A simple convenience function for sending Scintilla commands without any parameters.
* @param sci The Scintilla @c GtkWidget.
* @param cmd @c SCI_COMMAND.
@@ -940,6 +960,7 @@
return SSM(sci, SCI_LINEFROMPOSITION, SSM(sci, SCI_GETCURRENTPOS, 0, 0), 0);
}
+
/* Get number of lines partially or fully selected.
* Returns 1 if there is a partial selection on the same line.
* Returns 2 if a whole line is selected including the line break char(s). */
@@ -954,6 +975,7 @@
return SSM(sci, SCI_LINEFROMPOSITION, end, 0) - SSM(sci, SCI_LINEFROMPOSITION, start, 0) + 1;
}
+
gint sci_get_first_visible_line(ScintillaObject *sci)
{
return SSM(sci, SCI_GETFIRSTVISIBLELINE, 0, 0);
@@ -976,11 +998,13 @@
SSM(sci, SCI_SETINDICATORCURRENT, indic, 0);
}
+
void sci_indicator_fill(ScintillaObject *sci, gint pos, gint len)
{
SSM(sci, SCI_INDICATORFILLRANGE, pos, len);
}
+
/**
* Clear a range of text from the currently set indicator.
* Starting at @a pos, @a len characters long.
@@ -998,21 +1022,25 @@
SSM(sci, SCI_INDICATORCLEARRANGE, pos, len);
}
+
void sci_select_all(ScintillaObject *sci)
{
SSM(sci, SCI_SELECTALL, 0, 0);
}
+
gint sci_get_line_indent_position(ScintillaObject *sci, gint line)
{
return SSM(sci, SCI_GETLINEINDENTPOSITION, line, 0);
}
+
void sci_set_autoc_max_height(ScintillaObject *sci, gint val)
{
SSM(sci, SCI_AUTOCSETMAXHEIGHT, val, 0);
}
+
/** Find a matching brace at @a pos.
* @param sci Scintilla widget.
* @param pos Position.
@@ -1025,31 +1053,37 @@
return SSM(sci, SCI_BRACEMATCH, pos, 0);
}
+
gint sci_get_overtype(ScintillaObject *sci)
{
return SSM(sci, SCI_GETOVERTYPE, 0, 0);
}
+
void sci_set_tab_indents(ScintillaObject *sci, gboolean set)
{
SSM(sci, SCI_SETTABINDENTS, set, 0);
}
+
void sci_set_use_tabs(ScintillaObject *sci, gboolean set)
{
SSM(sci, SCI_SETUSETABS, set, 0);
}
+
gint sci_get_pos_at_line_sel_start(ScintillaObject *sci, gint line)
{
return SSM(sci, SCI_GETLINESELSTARTPOSITION, line, 0);
}
+
gint sci_get_pos_at_line_sel_end(ScintillaObject *sci, gint line)
{
return SSM(sci, SCI_GETLINESELENDPOSITION, line, 0);
}
+
/** Get selection mode.
* @param sci Scintilla widget.
* @return Selection mode. */
@@ -1058,6 +1092,7 @@
return SSM(sci, SCI_GETSELECTIONMODE, 0, 0);
}
+
/** Set selection mode.
* @param sci Scintilla widget.
* @param mode Mode. */
@@ -1066,62 +1101,74 @@
SSM(sci, SCI_SETSELECTIONMODE, mode, 0);
}
+
void sci_set_scrollbar_mode(ScintillaObject *sci, gboolean visible)
{
SSM(sci, SCI_SETHSCROLLBAR, visible, 0);
SSM(sci, SCI_SETVSCROLLBAR, visible, 0);
}
+
void sci_set_line_indentation(ScintillaObject *sci, gint line, gint indent)
{
SSM(sci, SCI_SETLINEINDENTATION, line, indent);
}
+
gint sci_get_line_indentation(ScintillaObject *sci, gint line)
{
return SSM(sci, SCI_GETLINEINDENTATION, line, 0);
}
+
void sci_set_caret_policy_x(ScintillaObject *sci, gint policy, gint slop)
{
SSM(sci, SCI_SETXCARETPOLICY, policy, slop);
}
+
void sci_set_caret_policy_y(ScintillaObject *sci, gint policy, gint slop)
{
SSM(sci, SCI_SETYCARETPOLICY, policy, slop);
}
+
void sci_set_scroll_stop_at_last_line(ScintillaObject *sci, gboolean set)
{
SSM(sci, SCI_SETENDATLASTLINE, set, 0);
}
+
void sci_cancel(ScintillaObject *sci)
{
- SSM( sci, SCI_CANCEL, 0, 0);
+ SSM(sci, SCI_CANCEL, 0, 0);
}
+
gint sci_get_target_end(ScintillaObject *sci)
{
- return SSM( sci, SCI_GETTARGETEND, 0, 0);
+ return SSM(sci, SCI_GETTARGETEND, 0, 0);
}
+
gint sci_get_position_after(ScintillaObject *sci, gint start)
{
return SSM(sci, SCI_POSITIONAFTER, start, 0);
}
+
void sci_lines_split(ScintillaObject *sci, gint pixelWidth)
{
SSM(sci, SCI_LINESSPLIT, pixelWidth, 0);
}
+
void sci_lines_join(ScintillaObject *sci)
{
SSM(sci, SCI_LINESJOIN, 0, 0);
}
+
gint sci_text_width(ScintillaObject *sci, gint styleNumber, const gchar *text)
{
return SSM(sci, SCI_TEXTWIDTH, styleNumber, (sptr_t) text);
Modified: trunk/src/sciwrappers.h
===================================================================
--- trunk/src/sciwrappers.h 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/sciwrappers.h 2009-09-16 14:13:38 UTC (rev 4199)
@@ -43,9 +43,9 @@
void sci_start_undo_action (ScintillaObject *sci);
gboolean sci_is_modified (ScintillaObject *sci);
-void sci_set_visible_eols (ScintillaObject *sci, gboolean set );
-void sci_set_lines_wrapped (ScintillaObject *sci, gboolean set );
-void sci_set_visible_white_spaces(ScintillaObject *sci, gboolean set );
+void sci_set_visible_eols (ScintillaObject *sci, gboolean set);
+void sci_set_lines_wrapped (ScintillaObject *sci, gboolean set);
+void sci_set_visible_white_spaces(ScintillaObject *sci, gboolean set);
void sci_convert_eols (ScintillaObject *sci, gint eolmode);
gint sci_get_eol_mode (ScintillaObject *sci);
void sci_set_eol_mode (ScintillaObject *sci, gint eolmode);
@@ -83,7 +83,7 @@
void sci_set_selection (ScintillaObject *sci, gint anchorPos, gint currentPos);
gint sci_get_length (ScintillaObject *sci);
-void sci_get_text (ScintillaObject *sci,gint len,gchar *text);
+void sci_get_text (ScintillaObject *sci, gint len, gchar *text);
gchar* sci_get_contents (ScintillaObject *sci, gint len);
void sci_get_selected_text (ScintillaObject *sci, gchar *text);
gint sci_get_selected_text_length(ScintillaObject *sci);
@@ -103,7 +103,7 @@
gint sci_get_fold_level (ScintillaObject *sci, gint line);
gint sci_get_fold_parent (ScintillaObject *sci, gint start_line);
-void sci_set_folding_margin_visible (ScintillaObject *sci, gboolean set );
+void sci_set_folding_margin_visible (ScintillaObject *sci, gboolean set);
gboolean sci_get_fold_expanded (ScintillaObject *sci, gint line);
void sci_colourise (ScintillaObject *sci, gint start, gint end);
Modified: trunk/src/search.c
===================================================================
--- trunk/src/search.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/search.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -1423,9 +1423,9 @@
msgwindow.find_in_files_dir = g_strdup(dir);
/* we can pass 'enc' without strdup'ing it here because it's a global const string and
* always exits longer than the lifetime of this function */
- utils_set_up_io_channel(stdout_fd, G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL,
+ utils_set_up_io_channel(stdout_fd, G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
TRUE, search_read_io, (gpointer) enc);
- utils_set_up_io_channel(stderr_fd, G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL,
+ utils_set_up_io_channel(stderr_fd, G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
TRUE, search_read_io_stderr, (gpointer) enc);
g_child_watch_add(child_pid, search_close_pid, NULL);
Modified: trunk/src/socket.c
===================================================================
--- trunk/src/socket.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/socket.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -704,6 +704,7 @@
#endif
}
+
#endif
Modified: trunk/src/symbols.c
===================================================================
--- trunk/src/symbols.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/symbols.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -1734,7 +1734,7 @@
tm_file = doc->tm_file;
/* if the document has no changes, get the previous function name from TM */
- if(! doc->changed && tm_file != NULL && tm_file->tags_array != NULL)
+ if (! doc->changed && tm_file != NULL && tm_file->tags_array != NULL)
{
const TMTag *tag = (const TMTag*) tm_get_current_function(tm_file->tags_array, line);
Modified: trunk/src/templates.c
===================================================================
--- trunk/src/templates.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/templates.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -276,6 +276,7 @@
}
}
+
/* FIXME the callers should use GStrings instead of char arrays */
static gchar *replace_all(gchar *text, const gchar *year, const gchar *date, const gchar *datetime)
{
Modified: trunk/src/toolbar.c
===================================================================
--- trunk/src/toolbar.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/toolbar.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -583,6 +583,7 @@
}
}
+
static const GMarkupParser tb_editor_xml_parser =
{
tb_editor_handler_start_element, NULL, NULL, NULL, NULL
Modified: trunk/src/tools.c
===================================================================
--- trunk/src/tools.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/tools.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -257,10 +257,10 @@
g_child_watch_add(pid, (GChildWatchFunc) cc_exit_cb, doc);
/* use GIOChannel to monitor stdout */
- utils_set_up_io_channel(stdout_fd, G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL,
+ utils_set_up_io_channel(stdout_fd, G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
FALSE, cc_iofunc, NULL);
/* copy program's stderr to Geany's stdout to help error tracking */
- utils_set_up_io_channel(stderr_fd, G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL,
+ utils_set_up_io_channel(stderr_fd, G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
FALSE, cc_iofunc_err, (gpointer)command);
/* get selection */
Modified: trunk/src/treeviews.c
===================================================================
--- trunk/src/treeviews.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/treeviews.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -846,6 +846,7 @@
return FALSE;
}
+
static void documents_menu_update(GtkTreeSelection *selection)
{
GtkTreeModel *model;
Modified: trunk/src/ui_utils.c
===================================================================
--- trunk/src/ui_utils.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/ui_utils.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -870,7 +870,7 @@
/* Note: remember to unref the pixbuf once an image or window has added a reference. */
GdkPixbuf *ui_new_pixbuf_from_inline(gint img)
{
- switch(img)
+ switch (img)
{
case GEANY_IMAGE_LOGO:
return gdk_pixbuf_new_from_inline(-1, aladin_inline, FALSE, NULL);
@@ -1193,7 +1193,7 @@
gint i, max = gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook));
GeanyDocument *doc;
- for(i = 0; i < max; i++)
+ for (i = 0; i < max; i++)
{
doc = document_get_from_page(i);
@@ -1981,7 +1981,6 @@
}
-
/* Progress Bar */
static guint progress_bar_timer_id = (guint) -1;
Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/utils.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -139,14 +139,14 @@
}
else if (buffer[i] == 0x0d)
{
- if (i >= (size-1))
+ if (i >= (size - 1))
{
/* Last char, CR */
cr++;
}
else
{
- if (buffer[i+1] != 0x0a)
+ if (buffer[i + 1] != 0x0a)
{
/* CR */
cr++;
@@ -641,7 +641,7 @@
{
for (j = 1; (j < needle_length); j++)
{
- if (haystack[i+j] == needle[j])
+ if (haystack[i + j] == needle[j])
{
if (pos == -1)
pos = i;
@@ -913,7 +913,7 @@
{
f = fmt_tenths;
++u;
- frac = ((((gint)(val % 1024)) * 10) + (1024/2)) / 1024;
+ frac = ((((gint)(val % 1024)) * 10) + (1024 / 2)) / 1024;
val /= 1024;
}
if (frac >= 10)
@@ -1086,11 +1086,11 @@
{
return FALSE;
}
- if (isdigit(string[i-1])) string[j] = string[i-1]-48;
- else if (isxdigit(string[i-1])) string[j] = tolower(string[i-1])-87;
+ if (isdigit(string[i - 1])) string[j] = string[i - 1] - 48;
+ else if (isxdigit(string[i - 1])) string[j] = tolower(string[i - 1])-87;
else return FALSE;
string[j] <<= 4;
- if (isdigit(string[i])) string[j] |= string[i]-48;
+ if (isdigit(string[i])) string[j] |= string[i] - 48;
else if (isxdigit(string[i])) string[j] |= tolower(string[i])-87;
else return FALSE;
break;
@@ -1101,42 +1101,42 @@
{
return FALSE;
}
- if (isdigit(string[i-1])) unicodechar = string[i-1]-48;
- else if (isxdigit(string[i-1])) unicodechar = tolower(string[i-1])-87;
+ if (isdigit(string[i - 1])) unicodechar = string[i - 1] - 48;
+ else if (isxdigit(string[i - 1])) unicodechar = tolower(string[i - 1])-87;
else return FALSE;
unicodechar <<= 4;
- if (isdigit(string[i])) unicodechar |= string[i]-48;
+ if (isdigit(string[i])) unicodechar |= string[i] - 48;
else if (isxdigit(string[i])) unicodechar |= tolower(string[i])-87;
else return FALSE;
- if (((i+2) < strlen(string)) && (isdigit(string[i+1]) || isxdigit(string[i+1]))
- && (isdigit(string[i+2]) || isxdigit(string[i+2])))
+ if (((i + 2) < strlen(string)) && (isdigit(string[i + 1]) || isxdigit(string[i + 1]))
+ && (isdigit(string[i + 2]) || isxdigit(string[i + 2])))
{
i += 2;
unicodechar <<= 8;
- if (isdigit(string[i-1])) unicodechar |= ((string[i-1]-48)<<4);
- else unicodechar |= ((tolower(string[i-1])-87) << 4);
- if (isdigit(string[i])) unicodechar |= string[i]-48;
+ if (isdigit(string[i - 1])) unicodechar |= ((string[i - 1] - 48) << 4);
+ else unicodechar |= ((tolower(string[i - 1])-87) << 4);
+ if (isdigit(string[i])) unicodechar |= string[i] - 48;
else unicodechar |= tolower(string[i])-87;
}
- if (((i+2) < strlen(string)) && (isdigit(string[i+1]) || isxdigit(string[i+1]))
- && (isdigit(string[i+2]) || isxdigit(string[i+2])))
+ if (((i + 2) < strlen(string)) && (isdigit(string[i + 1]) || isxdigit(string[i + 1]))
+ && (isdigit(string[i + 2]) || isxdigit(string[i + 2])))
{
i += 2;
unicodechar <<= 8;
- if (isdigit(string[i-1])) unicodechar |= ((string[i-1]-48) << 4);
- else unicodechar |= ((tolower(string[i-1])-87) << 4);
- if (isdigit(string[i])) unicodechar |= string[i]-48;
+ if (isdigit(string[i - 1])) unicodechar |= ((string[i - 1] - 48) << 4);
+ else unicodechar |= ((tolower(string[i - 1])-87) << 4);
+ if (isdigit(string[i])) unicodechar |= string[i] - 48;
else unicodechar |= tolower(string[i])-87;
}
- if(unicodechar < 0x80)
+ if (unicodechar < 0x80)
{
string[j] = unicodechar;
}
else if (unicodechar < 0x800)
{
- string[j] = (unsigned char) ((unicodechar >> 6)| 0xC0);
+ string[j] = (unsigned char) ((unicodechar >> 6) | 0xC0);
j++;
- string[j] = (unsigned char) ((unicodechar & 0x3F)| 0x80);
+ string[j] = (unsigned char) ((unicodechar & 0x3F) | 0x80);
}
else if (unicodechar < 0x10000)
{
Modified: trunk/src/vte.c
===================================================================
--- trunk/src/vte.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/vte.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -235,7 +235,7 @@
const gchar *sonames[] = { "libvte.so", "libvte.so.4",
"libvte.so.8", "libvte.so.9", NULL };
- for (i = 0; sonames[i] != NULL && module == NULL; i++ )
+ for (i = 0; sonames[i] != NULL && module == NULL; i++)
{
module = g_module_open(sonames[i], G_MODULE_BIND_LAZY);
}
@@ -935,4 +935,5 @@
g_free(text);
}
+
#endif
Modified: trunk/src/win32.c
===================================================================
--- trunk/src/win32.c 2009-09-16 14:05:14 UTC (rev 4198)
+++ trunk/src/win32.c 2009-09-16 14:13:38 UTC (rev 4199)
@@ -113,7 +113,7 @@
/* replace all "\t"s by \0 */
len = strlen(string);
- for(i = 0; i < len; i++)
+ for (i = 0; i < len; i++)
{
if (string[i] == '\t') string[i] = '\0';
}
@@ -145,7 +145,7 @@
/* replace all "\t"s by \0 */
len = strlen(string);
- for(i = 0; i < len; i++)
+ for (i = 0; i < len; i++)
{
if (string[i] == '\t') string[i] = '\0';
}
@@ -183,7 +183,7 @@
* folder when the dialog is initialised. Yeah, I like Windows. */
INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM pData)
{
- switch(uMsg)
+ switch (uMsg)
{
case BFFM_INITIALIZED:
{
@@ -388,7 +388,7 @@
{
if (! fname[x])
{
- if (! fname[x+1])
+ if (! fname[x + 1])
break;
WideCharToMultiByte(CP_UTF8, 0, fname + x + 1, -1,
@@ -630,7 +630,7 @@
parent_hwnd = GDK_WINDOW_HWND(main_widgets.window->window);
ret = MessageBoxW(parent_hwnd, w_msg, w_title, MB_YESNOCANCEL | MB_ICONQUESTION);
- switch(ret)
+ switch (ret)
{
case IDYES: ret = GTK_RESPONSE_YES; break;
case IDNO: ret = GTK_RESPONSE_NO; break;
@@ -640,6 +640,7 @@
return ret;
}
+
/* Just a simple wrapper function to open a browser window */
void win32_open_browser(const gchar *uri)
{
@@ -729,9 +730,9 @@
TCHAR buffer[MAX_PATH]=TEXT("");
TCHAR cmdline[MAX_PATH] = TEXT("");
TCHAR* lpPart[MAX_PATH]={NULL};
- DWORD retval=0;
+ DWORD retval = 0;
gint argc = 0, i;
- gint cmdpos=0;
+ gint cmdpos = 0;
SECURITY_ATTRIBUTES saAttr;
BOOL fSuccess;
@@ -959,10 +960,10 @@
gchar *expandedCmdline;
/* Set up members of the PROCESS_INFORMATION structure. */
- ZeroMemory(&piProcInfo, sizeof(PROCESS_INFORMATION) );
+ ZeroMemory(&piProcInfo, sizeof(PROCESS_INFORMATION));
/* Set up members of the STARTUPINFO structure.*/
- ZeroMemory(&siStartInfo, sizeof(STARTUPINFO) );
+ ZeroMemory(&siStartInfo, sizeof(STARTUPINFO));
siStartInfo.cb = sizeof(STARTUPINFO);
siStartInfo.hStdError = gw_spawn->hChildStderrWr;
@@ -1055,7 +1056,7 @@
static HANDLE GetTempFileHandle(GError **error)
{
/* Temp file */
- DWORD dwBufSize=BUFSIZE;
+ DWORD dwBufSize = BUFSIZE;
UINT uRetVal;
TCHAR szTempName[BUFSIZE];
TCHAR lpPathBuffer[BUFSIZE];
@@ -1195,11 +1196,13 @@
return path;
}
+
void win32_set_working_directory(const gchar *dir)
{
SetCurrentDirectory(dir);
}
+
gchar *win32_get_installation_dir(void)
{
#if GLIB_CHECK_VERSION(2, 16, 0)
@@ -1209,4 +1212,5 @@
#endif
}
+
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list