removed trailing whitespace

svn path=/trunk/; revision=26852
This commit is contained in:
Sven Neumann 2008-09-04 08:37:32 +00:00
parent eada9412bf
commit 8ec1d65a4a
48 changed files with 358 additions and 306 deletions

View File

@ -1,3 +1,51 @@
2008-09-04 Sven Neumann <sven@gimp.org>
* app/composite/make-installer.py
* app/composite/ns.py
* app/dialogs/tips-dialog.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-scroll.c
* app/display/gimpdisplayshell.c
* app/display/gimpnavigationeditor.c
* app/paint/gimppaintcore-stroke.c
* app/tools/gimpcroptool.c
* app/widgets/gtkscalebutton.c
* plug-ins/common/animation-play.c
* plug-ins/common/displace.c
* plug-ins/common/file-raw.c
* plug-ins/imagemap/imap_cern_lex.c
* plug-ins/imagemap/imap_cern_parse.c
* plug-ins/imagemap/imap_csim_lex.c
* plug-ins/imagemap/imap_csim_parse.c
* plug-ins/imagemap/imap_ncsa_lex.c
* plug-ins/imagemap/imap_ncsa_parse.c
* plug-ins/pygimp/gimpfu.py
* plug-ins/pygimp/gimpshelf.py
* plug-ins/pygimp/gimpthumbmodule.c
* plug-ins/pygimp/gimpui.py
* plug-ins/pygimp/gimpuimodule.c
* plug-ins/pygimp/plug-ins/benchmark-foreground-extract.py
* plug-ins/pygimp/plug-ins/foggify.py
* plug-ins/pygimp/plug-ins/palette-offset.py
* plug-ins/pygimp/plug-ins/palette-sort.py
* plug-ins/pygimp/plug-ins/palette-to-gradient.py
* plug-ins/pygimp/plug-ins/py-slice.py
* plug-ins/pygimp/plug-ins/python-console.py
* plug-ins/pygimp/plug-ins/python-eval.py
* plug-ins/pygimp/plug-ins/whirlpinch.py
* plug-ins/pygimp/pygimp-colors.c
* plug-ins/pygimp/pygimp-drawable.c
* plug-ins/pygimp/pygimp-image.c
* plug-ins/script-fu/re/engine.c
* plug-ins/script-fu/re/regerror.c
* plug-ins/script-fu/tinyscheme/dynload.c
* plug-ins/twain/tw_func.c
* plug-ins/twain/tw_util.c
* plug-ins/twain/tw_win.c
* plug-ins/twain/twain.h
* tools/defcheck.py
* tools/gimppath2svg.py: removed trailing whitespace.
2008-09-03 Lars-Peter Clausen <lars@metafoo.de>
* plugin-ins/pygimp/pygimp-tile.c: Removed trailing whitespace.

View File

@ -102,7 +102,7 @@ pixel_format=[
def mode_name(mode):
s = string.replace(mode.lower(), "gimp_composite_", "")
return (s)
def pixel_depth_name(pixel_format):
s = string.replace(pixel_format.lower(), "gimp_pixelformat_", "")
return (s)
@ -135,7 +135,7 @@ def print_function_table(fpout, name, function_table, requirements=[]):
if len(function_table) < 1:
return;
print >>fpout, 'static const struct install_table {'
print >>fpout, ' GimpCompositeOperation mode;'
print >>fpout, ' GimpPixelFormat A;'
@ -148,7 +148,7 @@ def print_function_table(fpout, name, function_table, requirements=[]):
for r in requirements:
print >>fpout, '#if %s' % (r)
pass
for mode in composite_modes:
for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format):
for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format):
@ -168,9 +168,9 @@ def print_function_table(fpout, name, function_table, requirements=[]):
print >>fpout, ' { 0, 0, 0, 0, NULL }'
print >>fpout, '};'
return
def print_function_table_name(fpout, name, function_table):
print >>fpout, ''
@ -197,9 +197,9 @@ def print_function_table_name(fpout, name, function_table):
pass
print >>fpout, '};\n'
return
def load_function_table(filename):
nmx = ns.nmx(filename)
@ -210,12 +210,12 @@ def load_function_table(filename):
for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format):
for D in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format):
key = "%s_%s_%s_%s" % (string.lower(mode), pixel_depth_name(A), pixel_depth_name(B), pixel_depth_name(D))
for a in ["GIMP_PIXELFORMAT_ANY", A]:
for b in ["GIMP_PIXELFORMAT_ANY", B]:
for d in ["GIMP_PIXELFORMAT_ANY", D]:
key = "%s_%s_%s_%s" % (string.lower(mode), pixel_depth_name(a), pixel_depth_name(b), pixel_depth_name(d))
f = nmx.exports_re(key + ".*")
if f != None: gimp_composite_function["%s_%s_%s_%s" % (string.lower(mode), pixel_depth_name(A), pixel_depth_name(B), pixel_depth_name(D))] = [f]
pass
@ -231,7 +231,7 @@ def load_function_table(filename):
def merge_function_tables(tables):
main_table = copy.deepcopy(tables[0][1])
for t in tables[1:]:
#print >>sys.stderr, t[0]
for mode in composite_modes:
@ -248,7 +248,7 @@ def merge_function_tables(tables):
pass
pass
pass
return (main_table)
@ -281,7 +281,7 @@ def gimp_composite_regression(fpout, function_tables, options):
for r in options.requires:
print >>fpout, '#if %s' % (r)
pass
print >>fpout, ' GimpCompositeContext generic_ctx;'
print >>fpout, ' GimpCompositeContext special_ctx;'
print >>fpout, ' double ft0;'
@ -349,11 +349,11 @@ def gimp_composite_regression(fpout, function_tables, options):
print >>fpout, ' gimp_composite_context_init (&generic_ctx, %s, %s, %s, %s, %s, n_pixels, (unsigned char *) %sA, (unsigned char *) %sB, (unsigned char *) %sB, (unsigned char *) %sD1);' % (
mode, A, B, D, D, pixel_depth_name(A), pixel_depth_name(B), pixel_depth_name(D), pixel_depth_name(D))
print >>fpout, ' ft0 = gimp_composite_regression_time_function (iterations, %s, &generic_ctx);' % ("gimp_composite_dispatch")
print >>fpout, ' ft1 = gimp_composite_regression_time_function (iterations, %s, &special_ctx);' % (generic_table[key][0])
print >>fpout, ' if (gimp_composite_regression_compare_contexts ("%s", &generic_ctx, &special_ctx))' % (mode_name(mode))
print >>fpout, ' {'
print >>fpout, ' printf("%s_%s_%s_%s failed\\n");' % (mode_name(mode), pixel_depth_name(A), pixel_depth_name(B), pixel_depth_name(D))
print >>fpout, ' return (1);'
@ -364,11 +364,11 @@ def gimp_composite_regression(fpout, function_tables, options):
pass
pass
pass
for r in options.requires:
print >>fpout, '#endif'
pass
print >>fpout, ' return (0);'
print >>fpout, '}'
@ -434,7 +434,7 @@ def gimp_composite_installer_install2(fpout, name, function_table, requirements=
else:
print >>fpout, ' /* nothing to do */'
pass
print >>fpout, ''
print >>fpout, ' return (FALSE);'
print >>fpout, '}'
@ -499,7 +499,7 @@ def gimp_composite_hfile(fpout, name, function_table):
print >>fpout, 'void %s_install (void);' % (functionnameify(name))
print >>fpout, ''
print >>fpout, 'typedef void (*%s_table[%s][%s][%s][%s]);' % (functionnameify(name), "GIMP_COMPOSITE_N", "GIMP_PIXELFORMAT_N", "GIMP_PIXELFORMAT_N", "GIMP_PIXELFORMAT_N")
return
def gimp_composite_cfile(fpout, name, function_table, requirements=[], cpu_feature=[]):

View File

@ -42,7 +42,7 @@ class nmx:
def __init__(self, objfile=None):
self.objects = dict()
self.filename = None
if objfile != None:
self.update(objfile)
pass
@ -71,7 +71,7 @@ class nmx:
pass
object = objfile
for (type, symbol) in symbols:
if not self.objects.has_key(object):
self.objects.update({ object : dict({ "exports" : dict(), "imports" : dict() }) })

View File

@ -188,7 +188,7 @@ tips_dialog_create (Gimp *gimp)
hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
more_button = gtk_link_button_new_with_label ("http://docs.gimp.org/",
/* a link to the related section in the user manual */
_("Learn more"));

View File

@ -333,17 +333,17 @@ gimp_display_shell_canvas_size_allocate (GtkWidget *widget,
*/
target_offset_x = shell->offset_x;
target_offset_y = shell->offset_y;
if (! center_horizontally)
{
target_offset_x = MAX (shell->offset_x, 0);
}
if (! center_vertically)
{
target_offset_y = MAX (shell->offset_y, 0);
}
gimp_display_shell_scroll_set_offset (shell,
target_offset_x,
target_offset_y);

View File

@ -405,7 +405,7 @@ gimp_display_shell_scroll_center_image_on_next_size_allocate (GimpDisplayShell *
data->shell = shell;
data->horizontally = horizontally;
data->vertically = vertically;
g_signal_connect (shell->canvas, "size-allocate",
G_CALLBACK (gimp_display_shell_scroll_center_image_callback),
data);

View File

@ -343,7 +343,7 @@ gimp_display_shell_init (GimpDisplayShell *shell)
shell->scroll_start_x = 0;
shell->scroll_start_y = 0;
shell->button_press_before_focus = FALSE;
shell->highlight = NULL;
shell->mask = NULL;

View File

@ -278,7 +278,7 @@ gimp_navigation_editor_popup (GimpDisplayShell *shell,
gint popup_width, popup_height;
gint border_width, border_height;
gint screen_click_x, screen_click_y;
gdk_window_get_origin (widget->window, &x_origin, &y_origin);
screen_click_x = x_origin + click_x;

View File

@ -338,7 +338,7 @@ gimp_paint_core_stroke_emulate_dynamics (GimpCoords *coords,
{
coords[i].pressure = i * slope;
}
/* Calculate pressure end ramp */
for (i = length - ramp_length; i < length; i++)
{

View File

@ -338,7 +338,7 @@ gimp_crop_tool_execute (GimpRectangleTool *rectangle,
* gimp_crop_tool_rectangle_change_complete:
* @rectangle:
*
* Returns:
* Returns:
**/
static gboolean
gimp_crop_tool_rectangle_change_complete (GimpRectangleTool *rectangle)

View File

@ -175,7 +175,7 @@ gimp_gtk_binding_signal_new (const gchar *signal_name,
guint signal_id;
g_return_val_if_fail (signal_name != NULL, 0);
va_start (args, n_params);
signal_id = g_signal_new_valist (signal_name, itype, signal_flags,
@ -184,7 +184,7 @@ gimp_gtk_binding_signal_new (const gchar *signal_name,
return_type, n_params, args);
va_end (args);
return signal_id;
}

View File

@ -1,3 +1,7 @@
2008-09-04 Sven Neumann <sven@gimp.org>
* tools/shadow.c: removed trailing whitespace.
2008-08-29 Sven Neumann <sven@gimp.org>
* libgimpwidgets/libgimpwidgets.types

View File

@ -112,13 +112,13 @@ create_shadow (GdkPixbuf *src)
sumb += src_pixels [src_y * src_rowstride +
src_x * src_bpp + 2] *
filter->data [i * filter->size + j];
if (src_bpp == 4)
suma += src_pixels [src_y * src_rowstride +
src_x * src_bpp + 3] *
filter->data [i * filter->size + j];
}
}

View File

@ -1438,7 +1438,7 @@ play_callback (GtkToggleAction *action)
playing = gtk_toggle_action_get_active (action);
if (playing)
timer = g_timeout_add (get_frame_duration (frame_number) *
timer = g_timeout_add (get_frame_duration (frame_number) *
get_duration_factor (duration_index),
advance_frame_callback, NULL);

View File

@ -843,10 +843,10 @@ displace_get_label_size (void)
for (j = 0; j < 2; j++)
{
GtkRequisition requisition;
gtk_button_set_label (GTK_BUTTON (toggle_x), gettext (mtext[i][j]));
gtk_widget_size_request (toggle_x, &requisition);
if (requisition.width > label_maxwidth)
label_maxwidth = requisition.width;
}

View File

@ -213,7 +213,7 @@ run (const gchar *name,
static GimpParam values[2];
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GError *error = NULL;
GError *error = NULL;
gint32 image_id;
gint32 drawable_id;

View File

@ -52,7 +52,7 @@
#if __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
* if you want the limit (max/min) macros for int types.
* if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
@ -69,7 +69,7 @@ typedef uint32_t flex_uint32_t;
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
@ -179,7 +179,7 @@ extern FILE *cern_in, *cern_out;
#define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
@ -246,7 +246,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@ -621,7 +621,7 @@ extern int cern_wrap (void );
#endif
static void yyunput (int c,char *buf_ptr );
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
@ -742,7 +742,7 @@ YY_DECL
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
#line 45 "imap_cern.l"
@ -1194,7 +1194,7 @@ static int yy_get_next_buffer (void)
{
register yy_state_type yy_current_state;
register char *yy_cp;
yy_current_state = (yy_start);
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
@ -1248,7 +1248,7 @@ static int yy_get_next_buffer (void)
static void yyunput (int c, register char * yy_bp )
{
register char *yy_cp;
yy_cp = (yy_c_buf_p);
/* undo effects of setting up cern_text */
@ -1291,7 +1291,7 @@ static int yy_get_next_buffer (void)
{
int c;
*(yy_c_buf_p) = (yy_hold_char);
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
@ -1358,12 +1358,12 @@ static int yy_get_next_buffer (void)
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
*
*
* @note This function does not reset the start condition to @c INITIAL .
*/
void cern_restart (FILE * input_file )
{
if ( ! YY_CURRENT_BUFFER ){
cern_ensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
@ -1376,11 +1376,11 @@ static int yy_get_next_buffer (void)
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
*
*
*/
void cern__switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
/* TODO. We should be able to replace this entire function body
* with
* cern_pop_buffer_state();
@ -1420,13 +1420,13 @@ static void cern__load_buffer_state (void)
/** Allocate and initialize an input buffer state.
* @param file A readable stream.
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
*
*
* @return the allocated buffer state.
*/
YY_BUFFER_STATE cern__create_buffer (FILE * file, int size )
{
YY_BUFFER_STATE b;
b = (YY_BUFFER_STATE) cern_alloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in cern__create_buffer()" );
@ -1449,11 +1449,11 @@ static void cern__load_buffer_state (void)
/** Destroy the buffer.
* @param b a buffer created with cern__create_buffer()
*
*
*/
void cern__delete_buffer (YY_BUFFER_STATE b )
{
if ( ! b )
return;
@ -1469,7 +1469,7 @@ static void cern__load_buffer_state (void)
#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* such as during a cern_restart() or at EOF.
@ -1478,7 +1478,7 @@ extern int isatty (int );
{
int oerrno = errno;
cern__flush_buffer(b );
b->yy_input_file = file;
@ -1494,13 +1494,13 @@ extern int isatty (int );
}
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
*
*
*/
void cern__flush_buffer (YY_BUFFER_STATE b )
{
@ -1529,7 +1529,7 @@ extern int isatty (int );
* the current state. This function will allocate the stack
* if necessary.
* @param new_buffer The new state.
*
*
*/
void cern_push_buffer_state (YY_BUFFER_STATE new_buffer )
{
@ -1559,7 +1559,7 @@ void cern_push_buffer_state (YY_BUFFER_STATE new_buffer )
/** Removes and deletes the top of the stack, if present.
* The next element becomes the new top.
*
*
*/
void cern_pop_buffer_state (void)
{
@ -1583,7 +1583,7 @@ void cern_pop_buffer_state (void)
static void cern_ensure_buffer_stack (void)
{
int num_to_alloc;
if (!(yy_buffer_stack)) {
/* First allocation is just for 2 elements, since we don't know if this
@ -1594,9 +1594,9 @@ static void cern_ensure_buffer_stack (void)
(yy_buffer_stack) = (struct yy_buffer_state**)cern_alloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
);
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
(yy_buffer_stack_max) = num_to_alloc;
(yy_buffer_stack_top) = 0;
return;
@ -1622,13 +1622,13 @@ static void cern_ensure_buffer_stack (void)
/** Setup the input buffer state to scan directly from a user-specified character buffer.
* @param base the character buffer
* @param size the size in bytes of the character buffer
*
* @return the newly allocated buffer state object.
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE cern__scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
@ -1657,14 +1657,14 @@ YY_BUFFER_STATE cern__scan_buffer (char * base, yy_size_t size )
/** Setup the input buffer state to scan a string. The next call to cern_lex() will
* scan from a @e copy of @a str.
* @param str a NUL-terminated string to scan
*
*
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
* cern__scan_bytes() instead.
*/
YY_BUFFER_STATE cern__scan_string (yyconst char * yystr )
{
return cern__scan_bytes(yystr,strlen(yystr) );
}
@ -1672,7 +1672,7 @@ YY_BUFFER_STATE cern__scan_string (yyconst char * yystr )
* scan from a @e copy of @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
*
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE cern__scan_bytes (yyconst char * yybytes, int _yybytes_len )
@ -1681,7 +1681,7 @@ YY_BUFFER_STATE cern__scan_bytes (yyconst char * yybytes, int _yybytes_len )
char *buf;
yy_size_t n;
int i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
buf = (char *) cern_alloc(n );
@ -1735,16 +1735,16 @@ static void yy_fatal_error (yyconst char* msg )
/* Accessor methods (get/set functions) to struct members. */
/** Get the current line number.
*
*
*/
int cern_get_lineno (void)
{
return cern_lineno;
}
/** Get the input stream.
*
*
*/
FILE *cern_get_in (void)
{
@ -1752,7 +1752,7 @@ FILE *cern_get_in (void)
}
/** Get the output stream.
*
*
*/
FILE *cern_get_out (void)
{
@ -1760,7 +1760,7 @@ FILE *cern_get_out (void)
}
/** Get the length of the current token.
*
*
*/
int cern_get_leng (void)
{
@ -1768,7 +1768,7 @@ int cern_get_leng (void)
}
/** Get the current token.
*
*
*/
char *cern_get_text (void)
@ -1778,18 +1778,18 @@ char *cern_get_text (void)
/** Set the current line number.
* @param line_number
*
*
*/
void cern_set_lineno (int line_number )
{
cern_lineno = line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
* @param in_str A readable stream.
*
*
* @see cern__switch_to_buffer
*/
void cern_set_in (FILE * in_str )
@ -1843,7 +1843,7 @@ static int yy_init_globals (void)
/* cern_lex_destroy is for both reentrant and non-reentrant scanners. */
int cern_lex_destroy (void)
{
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
cern__delete_buffer(YY_CURRENT_BUFFER );

View File

@ -1165,7 +1165,7 @@ yyparse ()
#endif
#endif
{
int yystate;
int yyn;
int yyresult;
@ -1470,7 +1470,7 @@ yyreduce:
{
Polygon_t *polygon = ObjectToPolygon(current_object);
GdkPoint *point = new_point((gint) (yyvsp[(2) - (5)].value), (gint) (yyvsp[(4) - (5)].value));
polygon->points = g_list_append(polygon->points,
polygon->points = g_list_append(polygon->points,
(gpointer) point);
}
break;
@ -1497,7 +1497,7 @@ yyreduce:
MapInfo_t *info = get_map_info();
gchar *description;
description = g_strconcat(info->description, (yyvsp[(2) - (2)].id), "\n",
description = g_strconcat(info->description, (yyvsp[(2) - (2)].id), "\n",
NULL);
g_strreplace(&info->description, description);
g_free ((yyvsp[(2) - (2)].id));
@ -1723,7 +1723,7 @@ yyreturn:
#line 163 "imap_cern.y"
static void
static void
cern_error(char* s)
{
extern FILE *cern_in;

View File

@ -52,7 +52,7 @@
#if __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
* if you want the limit (max/min) macros for int types.
* if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
@ -69,7 +69,7 @@ typedef uint32_t flex_uint32_t;
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
@ -179,7 +179,7 @@ extern FILE *csim_in, *csim_out;
#define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
@ -246,7 +246,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@ -641,7 +641,7 @@ extern int csim_wrap (void );
#endif
static void yyunput (int c,char *buf_ptr );
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
@ -762,7 +762,7 @@ YY_DECL
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
#line 46 "imap_csim.l"
@ -1311,7 +1311,7 @@ static int yy_get_next_buffer (void)
{
register yy_state_type yy_current_state;
register char *yy_cp;
yy_current_state = (yy_start);
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
@ -1365,7 +1365,7 @@ static int yy_get_next_buffer (void)
static void yyunput (int c, register char * yy_bp )
{
register char *yy_cp;
yy_cp = (yy_c_buf_p);
/* undo effects of setting up csim_text */
@ -1408,7 +1408,7 @@ static int yy_get_next_buffer (void)
{
int c;
*(yy_c_buf_p) = (yy_hold_char);
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
@ -1475,12 +1475,12 @@ static int yy_get_next_buffer (void)
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
*
*
* @note This function does not reset the start condition to @c INITIAL .
*/
void csim_restart (FILE * input_file )
{
if ( ! YY_CURRENT_BUFFER ){
csim_ensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
@ -1493,11 +1493,11 @@ static int yy_get_next_buffer (void)
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
*
*
*/
void csim__switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
/* TODO. We should be able to replace this entire function body
* with
* csim_pop_buffer_state();
@ -1537,13 +1537,13 @@ static void csim__load_buffer_state (void)
/** Allocate and initialize an input buffer state.
* @param file A readable stream.
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
*
*
* @return the allocated buffer state.
*/
YY_BUFFER_STATE csim__create_buffer (FILE * file, int size )
{
YY_BUFFER_STATE b;
b = (YY_BUFFER_STATE) csim_alloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in csim__create_buffer()" );
@ -1566,11 +1566,11 @@ static void csim__load_buffer_state (void)
/** Destroy the buffer.
* @param b a buffer created with csim__create_buffer()
*
*
*/
void csim__delete_buffer (YY_BUFFER_STATE b )
{
if ( ! b )
return;
@ -1586,7 +1586,7 @@ static void csim__load_buffer_state (void)
#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* such as during a csim_restart() or at EOF.
@ -1595,7 +1595,7 @@ extern int isatty (int );
{
int oerrno = errno;
csim__flush_buffer(b );
b->yy_input_file = file;
@ -1611,13 +1611,13 @@ extern int isatty (int );
}
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
*
*
*/
void csim__flush_buffer (YY_BUFFER_STATE b )
{
@ -1646,7 +1646,7 @@ extern int isatty (int );
* the current state. This function will allocate the stack
* if necessary.
* @param new_buffer The new state.
*
*
*/
void csim_push_buffer_state (YY_BUFFER_STATE new_buffer )
{
@ -1676,7 +1676,7 @@ void csim_push_buffer_state (YY_BUFFER_STATE new_buffer )
/** Removes and deletes the top of the stack, if present.
* The next element becomes the new top.
*
*
*/
void csim_pop_buffer_state (void)
{
@ -1700,7 +1700,7 @@ void csim_pop_buffer_state (void)
static void csim_ensure_buffer_stack (void)
{
int num_to_alloc;
if (!(yy_buffer_stack)) {
/* First allocation is just for 2 elements, since we don't know if this
@ -1711,9 +1711,9 @@ static void csim_ensure_buffer_stack (void)
(yy_buffer_stack) = (struct yy_buffer_state**)csim_alloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
);
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
(yy_buffer_stack_max) = num_to_alloc;
(yy_buffer_stack_top) = 0;
return;
@ -1739,13 +1739,13 @@ static void csim_ensure_buffer_stack (void)
/** Setup the input buffer state to scan directly from a user-specified character buffer.
* @param base the character buffer
* @param size the size in bytes of the character buffer
*
* @return the newly allocated buffer state object.
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE csim__scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
@ -1774,14 +1774,14 @@ YY_BUFFER_STATE csim__scan_buffer (char * base, yy_size_t size )
/** Setup the input buffer state to scan a string. The next call to csim_lex() will
* scan from a @e copy of @a str.
* @param str a NUL-terminated string to scan
*
*
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
* csim__scan_bytes() instead.
*/
YY_BUFFER_STATE csim__scan_string (yyconst char * yystr )
{
return csim__scan_bytes(yystr,strlen(yystr) );
}
@ -1789,7 +1789,7 @@ YY_BUFFER_STATE csim__scan_string (yyconst char * yystr )
* scan from a @e copy of @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
*
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE csim__scan_bytes (yyconst char * yybytes, int _yybytes_len )
@ -1798,7 +1798,7 @@ YY_BUFFER_STATE csim__scan_bytes (yyconst char * yybytes, int _yybytes_len )
char *buf;
yy_size_t n;
int i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
buf = (char *) csim_alloc(n );
@ -1852,16 +1852,16 @@ static void yy_fatal_error (yyconst char* msg )
/* Accessor methods (get/set functions) to struct members. */
/** Get the current line number.
*
*
*/
int csim_get_lineno (void)
{
return csim_lineno;
}
/** Get the input stream.
*
*
*/
FILE *csim_get_in (void)
{
@ -1869,7 +1869,7 @@ FILE *csim_get_in (void)
}
/** Get the output stream.
*
*
*/
FILE *csim_get_out (void)
{
@ -1877,7 +1877,7 @@ FILE *csim_get_out (void)
}
/** Get the length of the current token.
*
*
*/
int csim_get_leng (void)
{
@ -1885,7 +1885,7 @@ int csim_get_leng (void)
}
/** Get the current token.
*
*
*/
char *csim_get_text (void)
@ -1895,18 +1895,18 @@ char *csim_get_text (void)
/** Set the current line number.
* @param line_number
*
*
*/
void csim_set_lineno (int line_number )
{
csim_lineno = line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
* @param in_str A readable stream.
*
*
* @see csim__switch_to_buffer
*/
void csim_set_in (FILE * in_str )
@ -1960,7 +1960,7 @@ static int yy_init_globals (void)
/* csim_lex_destroy is for both reentrant and non-reentrant scanners. */
int csim_lex_destroy (void)
{
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
csim__delete_buffer(YY_CURRENT_BUFFER );

View File

@ -1260,7 +1260,7 @@ yyparse ()
#endif
#endif
{
int yystate;
int yyn;
int yyresult;

View File

@ -52,7 +52,7 @@
#if __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
* if you want the limit (max/min) macros for int types.
* if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
@ -69,7 +69,7 @@ typedef uint32_t flex_uint32_t;
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
@ -179,7 +179,7 @@ extern FILE *ncsa_in, *ncsa_out;
#define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
@ -246,7 +246,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@ -593,7 +593,7 @@ extern int ncsa_wrap (void );
#endif
static void yyunput (int c,char *buf_ptr );
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
@ -714,7 +714,7 @@ YY_DECL
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
#line 46 "imap_ncsa.l"
@ -1179,7 +1179,7 @@ static int yy_get_next_buffer (void)
{
register yy_state_type yy_current_state;
register char *yy_cp;
yy_current_state = (yy_start);
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
@ -1233,7 +1233,7 @@ static int yy_get_next_buffer (void)
static void yyunput (int c, register char * yy_bp )
{
register char *yy_cp;
yy_cp = (yy_c_buf_p);
/* undo effects of setting up ncsa_text */
@ -1276,7 +1276,7 @@ static int yy_get_next_buffer (void)
{
int c;
*(yy_c_buf_p) = (yy_hold_char);
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
@ -1343,12 +1343,12 @@ static int yy_get_next_buffer (void)
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
*
*
* @note This function does not reset the start condition to @c INITIAL .
*/
void ncsa_restart (FILE * input_file )
{
if ( ! YY_CURRENT_BUFFER ){
ncsa_ensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
@ -1361,11 +1361,11 @@ static int yy_get_next_buffer (void)
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
*
*
*/
void ncsa__switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
/* TODO. We should be able to replace this entire function body
* with
* ncsa_pop_buffer_state();
@ -1405,13 +1405,13 @@ static void ncsa__load_buffer_state (void)
/** Allocate and initialize an input buffer state.
* @param file A readable stream.
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
*
*
* @return the allocated buffer state.
*/
YY_BUFFER_STATE ncsa__create_buffer (FILE * file, int size )
{
YY_BUFFER_STATE b;
b = (YY_BUFFER_STATE) ncsa_alloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in ncsa__create_buffer()" );
@ -1434,11 +1434,11 @@ static void ncsa__load_buffer_state (void)
/** Destroy the buffer.
* @param b a buffer created with ncsa__create_buffer()
*
*
*/
void ncsa__delete_buffer (YY_BUFFER_STATE b )
{
if ( ! b )
return;
@ -1454,7 +1454,7 @@ static void ncsa__load_buffer_state (void)
#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* such as during a ncsa_restart() or at EOF.
@ -1463,7 +1463,7 @@ extern int isatty (int );
{
int oerrno = errno;
ncsa__flush_buffer(b );
b->yy_input_file = file;
@ -1479,13 +1479,13 @@ extern int isatty (int );
}
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
*
*
*/
void ncsa__flush_buffer (YY_BUFFER_STATE b )
{
@ -1514,7 +1514,7 @@ extern int isatty (int );
* the current state. This function will allocate the stack
* if necessary.
* @param new_buffer The new state.
*
*
*/
void ncsa_push_buffer_state (YY_BUFFER_STATE new_buffer )
{
@ -1544,7 +1544,7 @@ void ncsa_push_buffer_state (YY_BUFFER_STATE new_buffer )
/** Removes and deletes the top of the stack, if present.
* The next element becomes the new top.
*
*
*/
void ncsa_pop_buffer_state (void)
{
@ -1568,7 +1568,7 @@ void ncsa_pop_buffer_state (void)
static void ncsa_ensure_buffer_stack (void)
{
int num_to_alloc;
if (!(yy_buffer_stack)) {
/* First allocation is just for 2 elements, since we don't know if this
@ -1579,9 +1579,9 @@ static void ncsa_ensure_buffer_stack (void)
(yy_buffer_stack) = (struct yy_buffer_state**)ncsa_alloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
);
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
(yy_buffer_stack_max) = num_to_alloc;
(yy_buffer_stack_top) = 0;
return;
@ -1607,13 +1607,13 @@ static void ncsa_ensure_buffer_stack (void)
/** Setup the input buffer state to scan directly from a user-specified character buffer.
* @param base the character buffer
* @param size the size in bytes of the character buffer
*
* @return the newly allocated buffer state object.
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE ncsa__scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
@ -1642,14 +1642,14 @@ YY_BUFFER_STATE ncsa__scan_buffer (char * base, yy_size_t size )
/** Setup the input buffer state to scan a string. The next call to ncsa_lex() will
* scan from a @e copy of @a str.
* @param str a NUL-terminated string to scan
*
*
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
* ncsa__scan_bytes() instead.
*/
YY_BUFFER_STATE ncsa__scan_string (yyconst char * yystr )
{
return ncsa__scan_bytes(yystr,strlen(yystr) );
}
@ -1657,7 +1657,7 @@ YY_BUFFER_STATE ncsa__scan_string (yyconst char * yystr )
* scan from a @e copy of @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
*
*
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE ncsa__scan_bytes (yyconst char * yybytes, int _yybytes_len )
@ -1666,7 +1666,7 @@ YY_BUFFER_STATE ncsa__scan_bytes (yyconst char * yybytes, int _yybytes_len )
char *buf;
yy_size_t n;
int i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
buf = (char *) ncsa_alloc(n );
@ -1720,16 +1720,16 @@ static void yy_fatal_error (yyconst char* msg )
/* Accessor methods (get/set functions) to struct members. */
/** Get the current line number.
*
*
*/
int ncsa_get_lineno (void)
{
return ncsa_lineno;
}
/** Get the input stream.
*
*
*/
FILE *ncsa_get_in (void)
{
@ -1737,7 +1737,7 @@ FILE *ncsa_get_in (void)
}
/** Get the output stream.
*
*
*/
FILE *ncsa_get_out (void)
{
@ -1745,7 +1745,7 @@ FILE *ncsa_get_out (void)
}
/** Get the length of the current token.
*
*
*/
int ncsa_get_leng (void)
{
@ -1753,7 +1753,7 @@ int ncsa_get_leng (void)
}
/** Get the current token.
*
*
*/
char *ncsa_get_text (void)
@ -1763,18 +1763,18 @@ char *ncsa_get_text (void)
/** Set the current line number.
* @param line_number
*
*
*/
void ncsa_set_lineno (int line_number )
{
ncsa_lineno = line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
* @param in_str A readable stream.
*
*
* @see ncsa__switch_to_buffer
*/
void ncsa_set_in (FILE * in_str )
@ -1828,7 +1828,7 @@ static int yy_init_globals (void)
/* ncsa_lex_destroy is for both reentrant and non-reentrant scanners. */
int ncsa_lex_destroy (void)
{
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
ncsa__delete_buffer(YY_CURRENT_BUFFER );

View File

@ -1164,7 +1164,7 @@ yyparse ()
#endif
#endif
{
int yystate;
int yyn;
int yyresult;
@ -1439,7 +1439,7 @@ yyreduce:
MapInfo_t *info = get_map_info();
gchar *description;
description = g_strconcat(info->description, (yyvsp[(2) - (2)].id), "\n",
description = g_strconcat(info->description, (yyvsp[(2) - (2)].id), "\n",
NULL);
g_strreplace(&info->description, description);
g_free ((yyvsp[(2) - (2)].id));
@ -1449,7 +1449,7 @@ yyreduce:
case 20:
#line 118 "imap_ncsa.y"
{
MapInfo_t *info = get_map_info();
MapInfo_t *info = get_map_info();
g_strreplace(&info->default_url, (yyvsp[(2) - (2)].id));
g_free ((yyvsp[(2) - (2)].id));
}
@ -1507,7 +1507,7 @@ yyreduce:
{
Polygon_t *polygon = ObjectToPolygon(current_object);
GdkPoint *point = new_point((gint) (yyvsp[(1) - (3)].value), (gint) (yyvsp[(3) - (3)].value));
polygon->points = g_list_append(polygon->points,
polygon->points = g_list_append(polygon->points,
(gpointer) point);
}
break;
@ -1731,7 +1731,7 @@ yyreturn:
#line 174 "imap_ncsa.y"
static void
static void
ncsa_error(char* s)
{
extern FILE *ncsa_in;

View File

@ -385,7 +385,7 @@ def _interact(proc_name, start_params):
exc_str = exc_only_str = _('Missing exception information')
try:
etype, value, tb = sys.exc_info()
etype, value, tb = sys.exc_info()
exc_str = ''.join(traceback.format_exception(etype, value, tb))
exc_only_str = ''.join(traceback.format_exception_only(etype, value))
finally:
@ -414,7 +414,7 @@ def _interact(proc_name, start_params):
expander.add(scrolled)
scrolled.show()
label = gtk.Label(exc_str)
label.set_alignment(0.0, 0.0)
label.set_padding(6, 6)
@ -442,7 +442,7 @@ def _interact(proc_name, start_params):
def __init__ (self, default=''):
gtk.ScrolledWindow.__init__(self)
self.set_shadow_type(gtk.SHADOW_IN)
self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
self.set_size_request(100, -1)
@ -453,7 +453,7 @@ def _interact(proc_name, start_params):
self.buffer = self.view.get_buffer()
self.set_value(str(default))
def set_value(self, text):
self.buffer.set_text(text)
@ -551,7 +551,7 @@ def _interact(proc_name, start_params):
class ComboEntry(gtk.ComboBox):
def __init__(self, default=0, items=()):
store = gtk.ListStore(str)
store = gtk.ListStore(str)
for item in items:
store.append([item])
@ -715,10 +715,10 @@ def _interact(proc_name, start_params):
table.attach(wid, 2,3, i,i+1, yoptions=0)
if pf_type != PF_TEXT:
tooltips.set_tip(wid, desc, None)
tooltips.set_tip(wid, desc, None)
else:
#Attach tip to TextView, not to ScrolledWindow
tooltips.set_tip(wid.view, desc, None)
tooltips.set_tip(wid.view, desc, None)
wid.show()
wid.desc = desc
@ -763,7 +763,7 @@ def _run(proc_name, params):
if run_mode == RUN_NONINTERACTIVE:
return apply(func, params[1:])
script_params = _registered_plugins_[proc_name][8]
script_params = _registered_plugins_[proc_name][8]
min_args = 0
if len(params) > 1:

View File

@ -69,7 +69,7 @@ class Gimpshelf:
return 1
except gimp.error:
return 0
def __getitem__(self, key):
try:
s = gimp.get_data(key)

View File

@ -33,12 +33,12 @@
#include "pygimp-util.h"
void gimpthumb_register_classes(PyObject *d);
void gimpthumb_register_classes(PyObject *d);
void gimpthumb_add_constants(PyObject *module, const gchar *strip_prefix);
extern PyMethodDef gimpthumb_functions[];
static char gimpthumb_doc[] =
static char gimpthumb_doc[] =
"This module provides interfaces to allow you to write gimp plugins"
;
@ -48,7 +48,7 @@ PyMODINIT_FUNC
initgimpthumb(void)
{
PyObject *m, *d;
pygimp_init_pygobject();
m = Py_InitModule3("gimpthumb", gimpthumb_functions, gimpthumb_doc);

View File

@ -55,7 +55,7 @@ def _createMenu(items, callback, data):
callback, data)
menu_item.show()
return menu
def ImageMenu(constraint=None, callback=None, data=None):
items = []
@ -210,7 +210,7 @@ class PaletteSelector(PaletteSelectButton):
self.set_palette(default)
def get_value(self):
return self.get_palette()
class FontSelector(FontSelectButton):
def __init__(self, default="Sans"):
FontSelectButton.__init__(self)
@ -218,7 +218,7 @@ class FontSelector(FontSelectButton):
self.set_font(default)
def get_value(self):
return self.get_font()
class FileSelector(gtk.FileChooserButton):
def __init__(self, default=""):
gtk.FileChooserButton.__init__(self, _("Python-Fu File Selection"))

View File

@ -35,12 +35,12 @@
#include "pygimp-util.h"
void gimpui_register_classes(PyObject *d);
void gimpui_register_classes(PyObject *d);
void gimpui_add_constants(PyObject *module, const gchar *strip_prefix);
extern PyMethodDef gimpui_functions[];
static char gimpui_doc[] =
static char gimpui_doc[] =
"This module provides interfaces to allow you to write gimp plugins"
;

View File

@ -48,7 +48,7 @@ def benchmark (folder, save_output):
if not os.path.exists (folder):
gimp.message("Folder '" + folder + "' doesn't exist.\n")
return;
total_unclassified = 0
total_misclassified = 0
total_time = 0.0

View File

@ -38,10 +38,10 @@ def foggify(img, layer, name, colour, turbulence, opacity):
# create a layer mask for the new layer
mask = fog.create_mask(0)
fog.add_mask(mask)
# add some clouds to the layer
pdb.plug_in_plasma(img, mask, int(time.time()), turbulence)
# apply the clouds to the layer
fog.remove_mask(MASK_APPLY)

View File

@ -20,8 +20,8 @@ gettext.install("gimp20-python", gimp.locale_directory, unicode=True)
def palette_offset(palette, amount):
#If palette is read only, work on a copy:
editable = pdb.gimp_palette_is_editable(palette)
if not editable:palette = pdb.gimp_palette_duplicate (palette)
editable = pdb.gimp_palette_is_editable(palette)
if not editable:palette = pdb.gimp_palette_duplicate (palette)
num_colors = pdb.gimp_palette_get_info (palette)

View File

@ -19,11 +19,11 @@ from gimpfu import *
gettext.install("gimp20-python", gimp.locale_directory, unicode=True)
def palette_sort (palette, model, channel, ascending):
#If palette is read only, work on a copy:
editable = pdb.gimp_palette_is_editable(palette)
if not editable:palette = pdb.gimp_palette_duplicate (palette)
#If palette is read only, work on a copy:
editable = pdb.gimp_palette_is_editable(palette)
if not editable:palette = pdb.gimp_palette_duplicate (palette)
num_colors = pdb.gimp_palette_get_info (palette)
num_colors = pdb.gimp_palette_get_info (palette)
entry_list = []
for i in xrange (num_colors):
entry = (pdb.gimp_palette_entry_get_name (palette, i),
@ -39,8 +39,8 @@ def palette_sort (palette, model, channel, ascending):
entry_list.reverse()
for i in xrange(num_colors):
pdb.gimp_palette_entry_set_name (palette, i, entry_list[i][1][0])
pdb.gimp_palette_entry_set_color (palette, i, entry_list[i][1][1])
pdb.gimp_palette_entry_set_color (palette, i, entry_list[i][1][1])
return palette
@ -55,15 +55,15 @@ register(
"",
[
(PF_PALETTE, "palette", _("Palette"), ""),
(PF_RADIO, "model", _("Color _model"), "HSV",
((_("RGB"), "RGB"),
(PF_RADIO, "model", _("Color _model"), "HSV",
((_("RGB"), "RGB"),
(_("HSV"), "HSV"))),
(PF_RADIO, "channel", _("Channel to _sort"), 2,
((_("Red or Hue"), 0),
(_("Green or Saturation"), 1),
(PF_RADIO, "channel", _("Channel to _sort"), 2,
((_("Red or Hue"), 0),
(_("Green or Saturation"), 1),
(_("Blue or Value"), 2))),
(PF_BOOL, "ascending", _("_Ascending"), True)
],
],
[],
palette_sort,
menu="<Palettes>",

View File

@ -21,7 +21,7 @@ gettext.install("gimp20-python", gimp.locale_directory, unicode=True)
def make_gradient(palette, num_segments, num_colors):
gradient = pdb.gimp_gradient_new(palette)
pdb.gimp_gradient_segment_range_split_uniform(gradient, 0, -1, num_segments)
for color_number in range(0,num_segments):
if (color_number == num_colors-1):color_number_next = 0
else: color_number_next = color_number + 1

View File

@ -175,9 +175,9 @@ def slice(image, drawable, image_path, image_basename, image_extension,
True, False, False)
if image_extension == "jpg" and image.base_type == INDEXED:
pdb.gimp_image_convert_rgb (temp_image)
pdb.gimp_file_save(temp_image, temp_drawable, filename, filename)
pdb.gimp_file_save(temp_image, temp_drawable, filename, filename)
gimp.delete(temp_image)
return src
@ -238,7 +238,7 @@ class TableWriter:
self.image_prefix = self.image_prefix.replace ("-", "_")
self.image_prefix = self.image_prefix.replace (" ", "_")
if animate:
self.animate = True
self.images = []
@ -252,12 +252,12 @@ class TableWriter:
self.urls = self.parse_urls ()
else:
self.urls = []
self.url_index = 0
self.html = open(filename, 'wt')
self.html = open(filename, 'wt')
self.open()
def next_url (self):
if self.url_index < len (self.urls):
self.url_index += 1
@ -392,24 +392,24 @@ End of the part generated by GIMP
of the given file and return then as a list
"""
import re
url_list = []
url_list = []
try:
html_file = open (self.filename)
#Regular expression to pick everything up to the next doublequote
#character after finding the sequence 'href="'. The found sequences
#will be returned as a list by the "findall" method.
expr = re.compile (r"""href\=\"([^\"]*?)\"""")
url_list = expr.findall (html_file.read (2 ** 18))
html_file.close()
except:
#silently ignore any errors parsing this. The file being
#ovewriten may not be a file genrated by py-slice.
pass
return url_list
register(
"python-fu-slice",

View File

@ -36,7 +36,7 @@ def do_console():
'__name__': '__main__', '__doc__': None,
'gimp': gimp, 'pdb': gimp.pdb,
'shelf': gimpshelf.shelf}
for s in gimpenums.__dict__.keys():
if s[0] != '_':
namespace[s] = getattr(gimpenums, s)
@ -109,7 +109,7 @@ def do_console():
return
proc = pdb[proc_name]
cmd = ''
if len(proc.return_vals) > 0:

View File

@ -24,7 +24,7 @@ def code_eval(code):
import sys
code = sys.stdin
exec code in globals()
register(
"python-fu-eval",
"Evaluate Python code",

View File

@ -197,7 +197,7 @@ def calc_undistorted_coords(self, wx, wy, whirl, pinch, radius):
x = wx
y = wy
return inside, float(x), float(y)
def bilinear(x, y, values):
x = x % 1.0
y = y % 1.0

View File

@ -460,7 +460,7 @@ static PyGetSetDef rgb_getsets[] = {
{ NULL, (getter)0, (setter)0 },
};
static Py_ssize_t
static Py_ssize_t
rgb_length(PyObject *self)
{
return 4;
@ -480,7 +480,7 @@ rgb_getitem(PyObject *self, Py_ssize_t pos)
return NULL;
}
rgb = pyg_boxed_get(self, GimpRGB);
rgb = pyg_boxed_get(self, GimpRGB);
switch (pos) {
case 0: val = rgb->r; break;
@ -600,7 +600,7 @@ rgb_subscript(PyObject *self, PyObject *item)
else {
PyErr_SetObject(PyExc_KeyError, item);
return NULL;
}
}
} else {
PyErr_SetString(PyExc_TypeError,
"indices must be integers");
@ -983,7 +983,7 @@ static PyGetSetDef hsv_getsets[] = {
{ NULL, (getter)0, (setter)0 },
};
static Py_ssize_t
static Py_ssize_t
hsv_length(PyObject *self)
{
return 4;
@ -1003,7 +1003,7 @@ hsv_getitem(PyObject *self, Py_ssize_t pos)
return NULL;
}
hsv = pyg_boxed_get(self, GimpHSV);
hsv = pyg_boxed_get(self, GimpHSV);
switch (pos) {
case 0: val = hsv->h; scale_factor = 360.0; break;
@ -1516,7 +1516,7 @@ hsl_getitem(PyObject *self, Py_ssize_t pos)
return NULL;
}
hsl = pyg_boxed_get(self, GimpHSL);
hsl = pyg_boxed_get(self, GimpHSL);
switch (pos) {
case 0: val = hsl->h; scale_factor = 360.0; break;
@ -2020,7 +2020,7 @@ cmyk_getitem(PyObject *self, Py_ssize_t pos)
return NULL;
}
cmyk = pyg_boxed_get(self, GimpCMYK);
cmyk = pyg_boxed_get(self, GimpCMYK);
switch (pos) {
case 0: val = cmyk->c; break;

View File

@ -131,7 +131,7 @@ drw_get_tile(PyGimpDrawable *self, PyObject *args, PyObject *kwargs)
ensure_drawable(self);
if(row < 0 || row >= self->drawable->ntile_rows ||
if(row < 0 || row >= self->drawable->ntile_rows ||
col < 0 || col >= self->drawable->ntile_cols) {
Py_INCREF(Py_None);
return Py_None;

View File

@ -28,7 +28,7 @@ img_add_channel(PyGimpImage *self, PyObject *args)
{
PyGimpChannel *chn;
int pos = -1;
if (!PyArg_ParseTuple(args, "O!|i:add_channel",
&PyGimpChannel_Type, &chn, &pos))
return NULL;
@ -49,7 +49,7 @@ img_add_layer(PyGimpImage *self, PyObject *args)
{
PyGimpLayer *lay;
int pos = -1;
if (!PyArg_ParseTuple(args, "O!|i:add_layer", &PyGimpLayer_Type, &lay,
&pos))
return NULL;
@ -108,7 +108,7 @@ img_new_layer(PyGimpImage *self, PyObject *args, PyObject *kwargs)
break;
default:
PyErr_SetString(pygimp_error, "Unknown image base type");
return NULL;
return NULL;
}
if (fill_mode == -1)
@ -293,7 +293,7 @@ img_pick_correlate_layer(PyGimpImage *self, PyObject *args)
{
int x,y;
gint32 id;
if (!PyArg_ParseTuple(args, "ii:pick_correlate_layer", &x, &y))
return NULL;
@ -311,7 +311,7 @@ static PyObject *
img_raise_channel(PyGimpImage *self, PyObject *args)
{
PyGimpChannel *chn;
if (!PyArg_ParseTuple(args, "O!:raise_channel", &PyGimpChannel_Type, &chn))
return NULL;
@ -529,10 +529,10 @@ static PyObject *
img_get_component_visible(PyGimpImage *self, PyObject *args)
{
int comp;
if (!PyArg_ParseTuple(args, "i:get_component_visible", &comp))
return NULL;
return PyBool_FromLong(gimp_image_get_component_visible(self->ID, comp));
}
@ -1014,7 +1014,7 @@ img_get_colormap(PyGimpImage *self, void *closure)
self->ID);
return NULL;
}
ret = PyString_FromStringAndSize((char *)cmap, n_colours * 3);
g_free(cmap);

View File

@ -956,7 +956,7 @@ FILE *d;
fprintf(d, "\n");
}
/*
/*
- at - print current situation
== #ifdef REDEBUG
== static void at(struct match *m, char *title, char *start, char *stop, \

View File

@ -71,7 +71,7 @@ size_t errbuf_size;
for (r = rerrs; r->code != 0; r++)
if (r->code == target)
break;
if (errcode&REG_ITOA) {
if (r->code != 0)
(void) strcpy(convbuf, r->name);

View File

@ -13,8 +13,8 @@
# define MAXPATHLEN 1024
#endif
static void make_filename(const char *name, char *filename);
static void make_init_fn(const char *name, char *init_fn);
static void make_filename(const char *name, char *filename);
static void make_init_fn(const char *name, char *init_fn);
#ifdef _WIN32
# include <windows.h>
@ -28,27 +28,27 @@ typedef void (*FARPROC)();
#define PREFIX ""
#define SUFFIX ".dll"
static void display_w32_error_msg(const char *additional_message)
{
LPVOID msg_buf;
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER,
NULL, GetLastError(), 0,
(LPTSTR)&msg_buf, 0, NULL);
fprintf(stderr, "scheme load-extension: %s: %s", additional_message, msg_buf);
LocalFree(msg_buf);
}
static void display_w32_error_msg(const char *additional_message)
{
LPVOID msg_buf;
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER,
NULL, GetLastError(), 0,
(LPTSTR)&msg_buf, 0, NULL);
fprintf(stderr, "scheme load-extension: %s: %s", additional_message, msg_buf);
LocalFree(msg_buf);
}
static HMODULE dl_attach(const char *module) {
HMODULE dll = LoadLibrary(module);
if (!dll) display_w32_error_msg(module);
return dll;
if (!dll) display_w32_error_msg(module);
return dll;
}
static FARPROC dl_proc(HMODULE mo, const char *proc) {
FARPROC procedure = GetProcAddress(mo,proc);
if (!procedure) display_w32_error_msg(proc);
return procedure;
FARPROC procedure = GetProcAddress(mo,proc);
if (!procedure) display_w32_error_msg(proc);
return procedure;
}
static void dl_detach(HMODULE mo) {
@ -65,7 +65,7 @@ static void dl_detach(HMODULE mo) {
static HMODULE dl_attach(const char *module) {
HMODULE so=dlopen(module,RTLD_LAZY);
if(!so) {
fprintf(stderr, "Error loading scheme extension \"%s\": %s\n", module, dlerror());
fprintf(stderr, "Error loading scheme extension \"%s\": %s\n", module, dlerror());
}
return so;
}
@ -93,11 +93,11 @@ pointer scm_load_ext(scheme *sc, pointer args)
char *name;
HMODULE dll_handle;
void (*module_init)(scheme *sc);
if ((args != sc->NIL) && is_string((first_arg = pair_car(args)))) {
name = string_value(first_arg);
make_filename(name,filename);
make_init_fn(name,init_fn);
make_filename(name,filename);
make_init_fn(name,init_fn);
dll_handle = dl_attach(filename);
if (dll_handle == 0) {
retval = sc -> F;
@ -116,14 +116,14 @@ pointer scm_load_ext(scheme *sc, pointer args)
else {
retval = sc -> F;
}
return(retval);
}
static void make_filename(const char *name, char *filename) {
strcpy(filename,name);
strcat(filename,SUFFIX);
}
}
static void make_init_fn(const char *name, char *init_fn) {
const char *p=strrchr(name,'/');

View File

@ -229,7 +229,7 @@ openDSM(pTW_SESSION twSession)
twSession->twainState = 3;
return TRUE;
break;
case TWRC_FAILURE:
default:
LogMessage("OpenDSM failure\n");
@ -272,7 +272,7 @@ selectDS(pTW_SESSION twSession)
LogMessage("User cancelled TWAIN source selection\n");
break;
case TWRC_FAILURE:
case TWRC_FAILURE:
default:
LogMessage("Error \"%s\" during TWAIN source selection\n",
currentTwainError(twSession));
@ -602,22 +602,22 @@ transferImage(pTW_SESSION twSession, pTW_IMAGEINFO imageInfo)
TW_SETUPMEMXFER setupMemXfer;
TW_IMAGEMEMXFER imageMemXfer;
char *buffer;
/* Clear our structures */
memset(&setupMemXfer, 0, sizeof(TW_SETUPMEMXFER));
memset(&imageMemXfer, 0, sizeof(TW_IMAGEMEMXFER));
/* Find out how the source would like to transfer... */
twSession->twRC = callDSM(APP_IDENTITY(twSession), DS_IDENTITY(twSession),
DG_CONTROL, DAT_SETUPMEMXFER, MSG_GET,
(TW_MEMREF) &setupMemXfer);
/* Allocate the buffer for the transfer */
buffer = g_new (char, setupMemXfer.Preferred);
imageMemXfer.Memory.Flags = TWMF_APPOWNS | TWMF_POINTER;
imageMemXfer.Memory.Length = setupMemXfer.Preferred;
imageMemXfer.Memory.TheMem = (TW_MEMREF) buffer;
/* Get the data */
do {
/* Setup for the memory transfer */
@ -628,18 +628,18 @@ transferImage(pTW_SESSION twSession, pTW_IMAGEINFO imageInfo)
imageMemXfer.XOffset = TWON_DONTCARE32;
imageMemXfer.YOffset = TWON_DONTCARE32;
imageMemXfer.BytesWritten = TWON_DONTCARE32;
/* Get the next block of memory */
twSession->twRC = callDSM(APP_IDENTITY(twSession), DS_IDENTITY(twSession),
DG_IMAGE, DAT_IMAGEMEMXFER, MSG_GET,
(TW_MEMREF) &imageMemXfer);
if ((twSession->twRC == TWRC_SUCCESS) ||
(twSession->twRC == TWRC_XFERDONE)) {
/* Call the callback function */
if (!(*twSession->transferFunctions->txfrDataCb) (
imageInfo,
&imageMemXfer,
&imageMemXfer,
twSession->clientData)) {
/* Callback function requested to cancel */
twSession->twRC = TWRC_CANCEL;
@ -757,14 +757,14 @@ transferImages(pTW_SESSION twSession)
do {
/* Move to the new state */
twSession->twainState = 6;
/* Begin the image transfer */
if (!beginImageTransfer(twSession, &imageInfo))
continue;
/* Call the image transfer function */
transferImage(twSession, &imageInfo);
} while (endImageTransfer(twSession, &pendingCount));
/*

View File

@ -109,13 +109,13 @@ logBegin(pTW_IMAGEINFO imageInfo, void *clientData)
{
int i;
char buffer[256];
LogMessage("\n");
LogMessage("*************************************\n");
LogMessage("\n");
LogMessage("Image transfer begin:\n");
/* LogMessage("\tClient data: %s\n", (char *) clientData); */
/* Log the image information */
LogMessage("Image information:\n");
LogMessage("\tXResolution: %f\n", FIX32ToFloat(imageInfo->XResolution));
@ -129,19 +129,19 @@ logBegin(pTW_IMAGEINFO imageInfo, void *clientData)
strcat(buffer, "1");
else
strcat(buffer, "0");
if (i != 7)
strcat(buffer, ",");
}
LogMessage("%s}\n", buffer);
LogMessage("\tBitsPerPixel: %d\n", imageInfo->BitsPerPixel);
LogMessage("\tPlanar: %s\n", (imageInfo->Planar ? "TRUE" : "FALSE"));
LogMessage("\tPixelType: %d\n", imageInfo->PixelType);
/* Compression */
}
void
logData(pTW_IMAGEINFO imageInfo,
pTW_IMAGEMEMXFER imageMemXfer,
@ -157,7 +157,7 @@ logData(pTW_IMAGEINFO imageInfo,
LogMessage("\tYOffset = %d\n", imageMemXfer->YOffset);
LogMessage("\tBytesWritten = %d\n", imageMemXfer->BytesWritten);
}
#else
/*

View File

@ -174,9 +174,9 @@ int
TwainProcessMessage(LPMSG lpMsg, pTW_SESSION twSession)
{
TW_EVENT twEvent;
twSession->twRC = TWRC_NOTDSEVENT;
/* Only ask Source Manager to process event if there is a Source connected. */
if (DSM_IS_OPEN(twSession) && DS_IS_OPEN(twSession)) {
/*
@ -189,16 +189,16 @@ TwainProcessMessage(LPMSG lpMsg, pTW_SESSION twSession)
twSession->twRC = callDSM(APP_IDENTITY(twSession), DS_IDENTITY(twSession),
DG_CONTROL, DAT_EVENT, MSG_PROCESSEVENT,
(TW_MEMREF) &twEvent);
/* Check the return code */
if (twSession->twRC == TWRC_NOTDSEVENT) {
return FALSE;
}
/* Process the message as necessary */
processTwainMessage(twEvent.TWMessage, twSession);
}
/* tell the caller what happened */
return (twSession->twRC == TWRC_DSEVENT);
}
@ -214,14 +214,14 @@ int
twainMessageLoop(pTW_SESSION twSession)
{
MSG msg;
while (GetMessage(&msg, NULL, 0, 0)) {
if (DS_IS_CLOSED(twSession) || !TwainProcessMessage(&msg, twSession)) {
TranslateMessage((LPMSG)&msg);
DispatchMessage(&msg);
}
}
return msg.wParam;
}
@ -235,7 +235,7 @@ void
LogLastWinError(void)
{
LPVOID lpMsgBuf;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
@ -247,9 +247,9 @@ LogLastWinError(void)
0,
NULL
);
LogMessage("%s\n", lpMsgBuf);
/* Free the buffer. */
LocalFree( lpMsgBuf );
}

View File

@ -821,7 +821,7 @@ typedef struct {
#define TWCB_NOCLEAR 2
/* CAP_DEVICEEVENT values (DE_ means device event) */
#define TWDE_CUSTOMEVENTS 0x8000
#define TWDE_CUSTOMEVENTS 0x8000
#define TWDE_CHECKAUTOMATICCAPTURE 0
#define TWDE_CHECKBATTERY 1
#define TWDE_CHECKDEVICEONLINE 2

View File

@ -117,7 +117,7 @@ for df in def_files:
for s in doublesymbols:
print " : %s (line %d)" % s
print
if unsortindex >= 0:
print " the .def-file is not properly sorted (line %d)" % (unsortindex + 2)
print

View File

@ -47,7 +47,7 @@ class Path:
self.svgpath = ""
self.gimppoints = [[]]
self.bounds = None
def readgimpfile (self, filedesc):
text = filedesc.readlines()
for line in text:
@ -67,7 +67,7 @@ class Path:
if self.bounds[3] < y: self.bounds[3] = y
else:
self.bounds = [x,y,x,y]
def makesvg (self):
for path in self.gimppoints:
if path:
@ -79,13 +79,13 @@ class Path:
path = path[3:]
if len (curve) == 2:
svg = svg + "C %d %d %d %d %d %d z " % tuple (
tuple (curve [0][1:]) +
tuple (curve [1][1:]) +
tuple (curve [0][1:]) +
tuple (curve [1][1:]) +
tuple (start [1:]))
if len (curve) == 3:
svg = svg + "C %d %d %d %d %d %d " % tuple (
tuple (curve [0][1:]) +
tuple (curve [1][1:]) +
tuple (curve [0][1:]) +
tuple (curve [1][1:]) +
tuple (curve [2][1:]))
self.svgpath = self.svgpath + svg