diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/build.sh | 5 | ||||
-rw-r--r-- | src/canvas.cpp | 28 | ||||
-rw-r--r-- | src/canvas.h | 1846 | ||||
-rw-r--r-- | src/colorsc.h | 205 | ||||
-rw-r--r-- | src/colorsc.i | 59 | ||||
-rw-r--r-- | src/colorsc_wrap.cxx | 12605 | ||||
-rwxr-xr-x | src/deploy.sh | 2 | ||||
-rw-r--r-- | src/drwfile.h | 77 | ||||
-rw-r--r-- | src/gtk_types.h | 130 | ||||
-rw-r--r-- | src/palette.cpp | 19 | ||||
-rw-r--r-- | src/palette.h | 458 | ||||
-rw-r--r-- | src/setup.py | 15 |
12 files changed, 0 insertions, 15449 deletions
diff --git a/src/build.sh b/src/build.sh deleted file mode 100755 index 6b7678b..0000000 --- a/src/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -swig -c++ -python colorsc.i -python setup.py build_ext --inplace -mv _colorsc.so ../ -mv colorsc.py ../ - diff --git a/src/canvas.cpp b/src/canvas.cpp deleted file mode 100644 index ecdc11e..0000000 --- a/src/canvas.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright 2008 by Jens Andersson and Wade Brainerd. - This file is part of Colors! XO. - - Colors is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Colors is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Colors. If not, see <http://www.gnu.org/licenses/>. -*/ -#include "canvas.h" - -unsigned char BrushType::distance_tbl[DIST_TABLE_WIDTH][DIST_TABLE_WIDTH]; - -BrushType Brush::brush_type[BrushType::NUM_BRUSHES]; - -void test_method(void* data) -{ -} - - diff --git a/src/canvas.h b/src/canvas.h deleted file mode 100644 index bbed722..0000000 --- a/src/canvas.h +++ /dev/null @@ -1,1846 +0,0 @@ -/* - Copyright 2008 by Jens Andersson and Wade Brainerd. - This file is part of Colors! XO. - - Colors is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Colors is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Colors. If not, see <http://www.gnu.org/licenses/>. -*/ -#ifndef _CANVAS_H_ -#define _CANVAS_H_ - -#include "colorsc.h" -#include "drwfile.h" - -// Uncomment this to print all executed drawing commands to stdout. -//#define CANVAS_DEBUG_COMMANDS - -// Structure for passing pixel data to and from Python. -struct SurfaceA8R8G8B8 -{ - int width, height; - int stride; - unsigned int* pixels; -}; - -// Structure for passing buffers of draw commands to and from Python. -struct DrawCommandBuffer -{ - DrawCommandBuffer() - { - cmds = NULL; - ncommands = 0; - } - - DrawCommandBuffer(const char* _cmds, int _ncommands) - { - cmds = (char*)malloc(_ncommands*sizeof(unsigned int)); - memcpy(cmds, _cmds, _ncommands*sizeof(unsigned int)); - ncommands = _ncommands; - } - - DrawCommandBuffer(const DrawCommandBuffer& b) - { - cmds = (char*)malloc(b.ncommands*sizeof(unsigned int)); - memcpy(cmds, b.cmds, b.ncommands*sizeof(unsigned int)); - ncommands = b.ncommands; - } - - ~DrawCommandBuffer() - { - if (cmds) - { - free((void*)cmds); - cmds = NULL; - } - } - - const DrawCommandBuffer& operator=(const DrawCommandBuffer& b) - { - if (cmds) - free((void*)cmds); - cmds = (char*)malloc(b.ncommands*sizeof(unsigned int)); - memcpy(cmds, b.cmds, b.ncommands*sizeof(unsigned int)); - ncommands = b.ncommands; - return *this; - } - - void append(const DrawCommandBuffer& b) - { - char* newcmds = (char*)malloc((ncommands+b.ncommands)*sizeof(unsigned int)); - if (cmds) - { - memcpy(newcmds, cmds, ncommands*sizeof(unsigned int)); - free(cmds); - } - memcpy(newcmds + ncommands*sizeof(unsigned int), b.cmds, b.ncommands*sizeof(unsigned int)); - cmds = newcmds; - ncommands = ncommands + b.ncommands; - } - - void clear() - { - if (cmds) - { - free(cmds); - cmds = NULL; - } - ncommands = 0; - } - - ByteBuffer get_bytes() - { - ByteBuffer buf; - buf.size = ncommands*sizeof(unsigned int); - buf.data = cmds; - return buf; - } - - char* cmds; - int ncommands; - - static DrawCommandBuffer create_from_string(const char* cmds, int ncommands) - { - return DrawCommandBuffer(cmds, ncommands); - } -}; - -struct DrawCommand -{ - enum - { - TYPE_DRAW = 0, - TYPE_DRAWEND = 1, - TYPE_COLORCHANGE = 2, - TYPE_SIZECHANGE = 3, - }; - - int type; - Pos pos; - Color color; - int pressure; - bool flipx; - bool flipy; - bool is_text; - uint32_t text; - int brush_control; - int brush_type; - float size; - float opacity; - - DrawCommand() - { - type = TYPE_DRAW; - pressure = 0; - flipx = false; - flipy = false; - is_text = false; - text = 0; - brush_control = 0; - brush_type = 0; - size = 0; - opacity = 0; - } - - static DrawCommand create_color_change(const Color& c) - { - DrawCommand cmd; - cmd.type = TYPE_COLORCHANGE; - cmd.color = c; - return cmd; - } - - static DrawCommand create_draw(const Pos& pos, int pressure) - { - DrawCommand cmd; - cmd.type = TYPE_DRAW; - cmd.pos = pos; - cmd.pressure = pressure; - return cmd; - } - - static DrawCommand create_end_draw(int pressure) - { - DrawCommand cmd; - cmd.type = TYPE_DRAWEND; - cmd.pressure = pressure; - return cmd; - } - - static DrawCommand create_size_change(int brush_control, int brush_type, float size, float opacity) - { - DrawCommand cmd; - cmd.type = TYPE_SIZECHANGE; - cmd.brush_control = brush_control; - cmd.brush_type = brush_type; - cmd.size = size; - cmd.opacity = opacity; - return cmd; - } - - static DrawCommand create_flip(bool flipx) - { - DrawCommand cmd; - cmd.type = TYPE_COLORCHANGE; - cmd.flipx = flipx; - cmd.flipy = !flipx; - return cmd; - } -}; - -struct BrushType -{ - enum - { - BRUSHTYPE_HARD = 0, - BRUSHTYPE_SOFT = 1, - BRUSHTYPE_CURSOR = 2, - NUM_BRUSHES = 3, - }; - - static const int DIST_TABLE_WIDTH = 256; // Width of distance lookup-table - static const int DIST_TABLE_CENTER = DIST_TABLE_WIDTH / 2; // Center of distance lookup-table - - static const int BRUSH_TABLE_WIDTH = 256; // Width of brush lookup-table - static const int BRUSH_TABLE_HEIGHT = 65; // Height of 65 allows a brushsize down to 1.0f - - static const float EXTRA_BRUSH_SCALE = 1.023f; // Scales down the brush-size so we don't index-out-of-range. - - static unsigned char distance_tbl[DIST_TABLE_WIDTH][DIST_TABLE_WIDTH]; - - unsigned char intensity_tbl[BRUSH_TABLE_WIDTH][BRUSH_TABLE_HEIGHT]; - - // Creates a simple sqrt-lookup table. - static void create_distance_table() - { - for (int x = 0; x < DIST_TABLE_WIDTH; x++) - for (int y = 0; y < DIST_TABLE_WIDTH; y++) - { - int dx = x - DIST_TABLE_CENTER; - int dy = y - DIST_TABLE_CENTER; - float dist = sqrtf(float(dx * dx + dy * dy)); - distance_tbl[x][y] = (unsigned char)min(255.0f, dist*255/DIST_TABLE_CENTER); - } - } - - // Calculates a gradient between 0 and 1 where the derivate of both 0 and 1 is 0. - // This function is used to calculate the falloff of the brushes. - float smooth_step(float a) - { - return sinf((a*a - 0.5f) * 3.14159f) * 0.5f + 0.5f; - } - - void create_brush(float brush_border, float amp) - { - // Find at what range from brush-center the brush intensity goes below 2 - float max_r = 0; - for (int i = BRUSH_TABLE_WIDTH-1; i >= 0; i--) - { - float f = float(i) / BRUSH_TABLE_WIDTH; - float f2 = 1.0f - (f - brush_border) / (1.0f - brush_border); - if (round(smooth_step(f2) * amp) >= 2) - { - max_r = i; - break; - } - } - - // Calculate a scale-factor so the brush optimally uses the area - float r = float(max_r + 2) / BRUSH_TABLE_WIDTH / BRUSH_TABLE_WIDTH; - - for (int y = 0; y < BRUSH_TABLE_HEIGHT; y++) - { - // Each line in the brush-table is calculated for a specific brush-size - // This has two functions: - // 1. Be able to simulate the effect of resampling of the "perfect" big brush to a smaller one to improve precision - // 2. Compensate for the need to scale small brushes to avoid index out of range during rastering - - // Calculate scale for this width - float brushscale = EXTRA_BRUSH_SCALE + y * 2.0f / 64.0f; - - // Calculate brush - unsigned int intensity_row[BRUSH_TABLE_WIDTH]; - for (int i = 0; i < BRUSH_TABLE_WIDTH; i++) - { - float f = min(i * r * brushscale, 1.0f); // Apply the two different scales - if (f < brush_border) - intensity_row[i] = int(amp); - else - { - float f2 = 1.0f - (f - brush_border) / (1.0f - brush_border); - f2 = smooth_step(f2) * amp; // Make sure the border-falloff is smooth - intensity_row[i] = int(round(f2)); - } - } - - // Simulate the effect of resampling - int blurradius = int(round(y * BRUSH_TABLE_WIDTH / (brushscale * 64.0f))); - float maxintensity = 0; - for (int x = 0; x < BRUSH_TABLE_WIDTH; x++) - { - float l = 0; - for (int x2 = x - blurradius; x2 < x + blurradius + 1; x2++) - { - int i = min(max(x2, 0), BRUSH_TABLE_WIDTH-1); - if (i < BRUSH_TABLE_WIDTH) - l += intensity_row[i]; - } - float intensity = l / (blurradius * 2 + 1); - if (intensity > maxintensity) - maxintensity = intensity; - intensity_tbl[x][y] = int(intensity); - } - } - } - - void create_hard_brush() - { - create_brush(0.8f, 255); - } - - void create_soft_brush() - { - create_brush(0.0f, 128); - } - - void create_cursor() - { - } -}; - -class Brush -{ -public: - enum - { - BRUSHCONTROL_VARIABLEOPACITY = 1, - BRUSHCONTROL_VARIABLESIZE = 2, - }; - - static BrushType brush_type[BrushType::NUM_BRUSHES]; - - Color color; - int type; - int size; - int control; - float opacity; - - Brush() - { - type = BrushType::BRUSHTYPE_HARD; - color = Color(255, 255, 255, 255); - size = 32; - control = 0; - opacity = 1.0f; - } - - Brush(const Brush& a) - { - type = a.type; - color = a.color; - size = a.size; - control = a.control; - opacity = a.opacity; - } -}; - -// The canvas represents the current state of the user's painting. It maintains both the pixels representing the -// image, and also the complete list of drawing commands that contributed to the image. -class Canvas -{ -public: - // Dimensions of the reference picture (webcam snapshot). - static const int REFERENCE_WIDTH = 640; - static const int REFERENCE_HEIGHT = 480; - - // Dimensions of the videopaint buffer. - static const int VIDEO_WIDTH = 80; - static const int VIDEO_HEIGHT = 60; - - enum - { - DRAWBRUSH_TYPE_NORMAL = 0, - DRAWBRUSH_TYPE_OLDCURSOR = 1, - DRAWBRUSH_TYPE_DIRECT = 2, - DRAWBRUSH_TYPE_GETCOLOR = 3, - DRAWBRUSH_TYPE_CURSOR = 4, - }; - - // List of drawing commands that make up the painting. - vector<DrawCommand> commands; - - // Canvas dimensions. - int width; - int height; - - // Current state of the canvas pixels. - unsigned int* image; - - // Backup and alpha channel are used for multiple purposes. See description in Drawing section. - unsigned int* image_backup; - unsigned char* alpha; - - // Shared (master) picture for collaborative painting. - unsigned int* image_shared; - - // Reference (webcam snapshot) picture. - unsigned short* image_reference; - - // Videopaint variables. - unsigned int* image_video[2]; - int video_idx; - Pos videopaint_pos; - float videopaint_pressure; - - // Current brush state. - Brush brush; - - // Variables for interpolating the brush across strokes. - Pos lastpos; - Pos lastorgpos; - float lastpressure; - - // Dimensions of the canvas that have been modified since the last call to reset_dirty_rect. - Pos dirtymin; - Pos dirtymax; - - // Dimensions and state of the current stroke. - Pos strokemin; - Pos strokemax; - bool stroke; - int idle_while_drawing; - int drawtype; - - // VCR playback variables. - bool playing; - int playback; - int playback_speed; - - // True if the canvas has been modified since the last save. - bool modified; - - Canvas(int width, int height) : width(width), height(height) - { - image = new unsigned int[width*height]; - image_backup = new unsigned int[width*height]; - alpha = new unsigned char[width*height]; - - image_shared = new unsigned int[width*height]; - - image_reference = new unsigned short[REFERENCE_WIDTH*REFERENCE_HEIGHT]; - memset(image_reference, 0, REFERENCE_WIDTH*REFERENCE_HEIGHT*sizeof(unsigned short)); - - image_video[0] = new unsigned int[VIDEO_WIDTH*VIDEO_HEIGHT]; - image_video[1] = new unsigned int[VIDEO_WIDTH*VIDEO_HEIGHT]; - memset(image_video[0], 0, VIDEO_WIDTH*VIDEO_HEIGHT*sizeof(unsigned int)); - memset(image_video[1], 0, VIDEO_WIDTH*VIDEO_HEIGHT*sizeof(unsigned int)); - video_idx = 0; - - clear(); - - // Initialize lookup table. - BrushType::create_distance_table(); - - // Initialize brushes. - Brush::brush_type[BrushType::BRUSHTYPE_HARD].create_hard_brush(); - Brush::brush_type[BrushType::BRUSHTYPE_SOFT].create_soft_brush(); - Brush::brush_type[BrushType::BRUSHTYPE_CURSOR].create_cursor(); - - reset_brush(); - - lastpos = Pos(0,0); - lastorgpos = Pos(0,0); - lastpressure = 0; - - dirtymin = Pos(FLT_MAX,FLT_MAX); - dirtymax = Pos(-FLT_MAX,-FLT_MAX); - - strokemin = Pos(0,0); - strokemax = Pos(0,0); - stroke = false; - - playing = false; - playback = 0; - playback_speed = 1; - modified = false; - - idle_while_drawing = 0; - - drawtype = DRAWBRUSH_TYPE_NORMAL; - } - - ~Canvas() - { - delete[] image; - delete[] image_backup; - delete[] image_shared; - delete[] alpha; - } - - // Clears the entire canvas (command history and image). - void clear() - { - commands.clear(); - clear_image(); - } - - // Changes the size of the canvas. - // Rather than trying to repaint everything from scratch, we simply quickly rescale it. - void resize(int new_width, int new_height) - { - unsigned int* new_image = new unsigned int[new_width*new_height]; - unsigned int* new_image_backup = new unsigned int[new_width*new_height]; - unsigned char* new_alpha = new unsigned char[new_width*new_height]; - unsigned int* new_image_shared = new unsigned int[new_width*new_height]; - - int dx = (1<<16) * width / new_width; - int dy = (1<<16) * height / new_height; - int ry = 0; - for (int y = 0; y < new_height; y++) - { - int rx = 0; - for (int x = 0; x < new_width; x++) - { - int sofs = (ry>>16)*width + (rx>>16); - int dofs = y*new_width+x; - new_image[dofs] = image[sofs]; - new_image_backup[dofs] = image_backup[sofs]; - new_alpha[dofs] = alpha[sofs]; - new_image_shared[dofs] = image_shared[sofs]; - rx += dx; - } - ry += dy; - } - - delete[] image; - delete[] image_backup; - delete[] alpha; - delete[] image_shared; - - width = new_width; - height = new_height; - - image = new_image; - image_backup = new_image_backup; - alpha = new_alpha; - image_shared = new_image_shared; - } - - // Resets the brush to a random color and a default size and type. - void reset_brush() - { - // Choose a suitable random brush color. - srand(clock()); - int c0 = rand()%3; - int c1 = c0 + 1 + rand()%2; - if (c1 > 2) - c1 -= 3; - brush.type = BrushType::BRUSHTYPE_HARD; - brush.color = Color::create_from_a8r8g8b8(0xff000000 | (255 << (c0 * 8) | ((rand()%255) << (c1 * 8)))); - brush.size = width/16; - brush.control = Brush::BRUSHCONTROL_VARIABLESIZE; - brush.opacity = 1.0f; - } - - //--------------------------------------------------------------------------------------------- - // Shared image. - // - // The shared image is used in collaborative painting, and contains the current 'master' state of the canvas - // - // The user can paint ahead of the master state, but when a new master state is received the canvas - // state will be reset to the shared image. Before this happens though, the user commands are transmitted - // to the activity host, so they will be received again as a new master image later and not be lost. - void save_shared_image() - { - memcpy(image_shared, image, width*height*sizeof(unsigned int)); - } - - void restore_shared_image() - { - memcpy(image, image_shared, width*height*sizeof(unsigned int)); - memcpy(image_backup, image_shared, width*height*sizeof(unsigned int)); - } - - //--------------------------------------------------------------------------------------------- - // Drawing - // - // These methods are for drawing to and clearing the canvas. - // - // Drawing is not done directly to the canvas. The way the brush system works, the brush shapes are - // actually drawn into the alpha channel of the canvas, and the alpha channel is used to blend the - // brush color over the backup image to create the real image. - // - // The net effect this is that during a stroke, which may overlap itself many times over, the brush color - // will only be applied to any particular canvas pixel up to the defined brush transparency level. - // This is the core of our "natural media" engine. - - void clear_image() - { - memset(image, 0xff, width*height*sizeof(unsigned int)); - memset(image_backup, 0xff, width*height*sizeof(unsigned int)); - memset(alpha, 0, width*height*sizeof(unsigned char)); - - memset(image_shared, 0xff, width*height*sizeof(unsigned int)); - - dirtymin = Pos(0, 0); - dirtymax = Pos(width, height); - } - - // Called from command_draw and calculates a temporary brush size depending on pressure/alpha (0-255). - float get_variable_brush_size(float pressure) - { - if (brush.control & Brush::BRUSHCONTROL_VARIABLESIZE) - { - float size = pressure * brush.size / 255.0f; - if (size < 2.0f) - size = 2.0f; - return size; - } - else - return brush.size; - } - - // Called each tick while stylus is touching the screen and draws the selected brush into the Alpha of the Canvas. - void command_draw(const Pos& pos, int pressure, bool forced) - { - lastorgpos = pos; - - if (brush.control == 0) - pressure = 255; - - int size, opacity; - if (!stroke) - { - // This is a new stroke. Just draw the brush on incoming position, store the information needed for interpolation and wait for next call - if (brush.control & Brush::BRUSHCONTROL_VARIABLESIZE) - size = int(get_variable_brush_size(pressure)); - else - size = brush.size; - - if (brush.control & Brush::BRUSHCONTROL_VARIABLEOPACITY) - opacity = int(round(pressure * brush.opacity)); - else - opacity = int(round(255.0f * brush.opacity)); - draw_brush(pos, size, opacity); - - // Reset stroke dirty regions - strokemin = pos; - strokemax = pos; - - lastpos = pos; - lastpressure = pressure; - idle_while_drawing = 0; - stroke = true; - } - else - { - // This is continous stroke. Interpolate from last postion/pressure - - // Calculate the stroke-distance - float distx = pos.x - lastpos.x; - float disty = pos.y - lastpos.y; - float dista = pressure - lastpressure; - float distance = sqrtf(distx * distx + disty * disty); - if (distance == 0.0f) // To avoid division by zero. None or very small movements are handled later - distance = 0.0001f; - - // Calculate interpolation constants - float dx = distx / distance; - float dy = disty / distance; - float da = dista / distance; - - // Calculate the spacing between two brush-stamp. Normal spacing is 25% of brushsize. - float spacing = 0.225f; - - // Do this special spacing only for just VariableOpacity with Hard brush to avoid banding - // Decrease spacing if pressure is changing rapidly - if (da != 0 && brush.control == Brush::BRUSHCONTROL_VARIABLEOPACITY && brush.type == BrushType::BRUSHTYPE_HARD) - spacing = min(0.225f, max(fabsf(15.0f / brush.size / (da * brush.opacity)), 0.05f)); - - // Calculate the distance between two brushes from spacing - float spacingdistance = get_variable_brush_size(lastpressure) * spacing; - if (distance < spacingdistance) - { - // Too small movement to interpolate - idle_while_drawing++; - if (idle_while_drawing > 15 || forced) - { - // We've been idling too long. Draw the brush and reduce idle-counter - // Idle-counter is invalid during playback, since playback only records input that actually drew something - idle_while_drawing = 10; - - lastpos = pos; - lastpressure = pressure; - if (brush.control & Brush::BRUSHCONTROL_VARIABLEOPACITY) - draw_brush(pos, int(get_variable_brush_size(lastpressure)), int(round(pressure * brush.opacity))); - else - draw_brush(pos, int(get_variable_brush_size(lastpressure)), int(round(255.0f * brush.opacity))); - } - return; - } - - if (brush.control & Brush::BRUSHCONTROL_VARIABLESIZE) - { - // Brush size is controlled by pressure - while (distance >= spacingdistance) - { - // Interpolate stroke - lastpressure += da * spacingdistance; - lastpos.x += dx * spacingdistance; - lastpos.y += dy * spacingdistance; - distance -= spacingdistance; - - float brushsize = get_variable_brush_size(int(lastpressure)); - if (brush.control & Brush::BRUSHCONTROL_VARIABLEOPACITY) - draw_brush(lastpos, int(get_variable_brush_size(int(lastpressure))), int(round(pressure * brush.opacity))); - else - draw_brush(lastpos, int(get_variable_brush_size(int(lastpressure))), int(round(255.0f * brush.opacity))); - - // Since brush-size may have changed, we need to calculate new spacing - spacingdistance = brushsize * spacing; - } - } - else - { - // Brush size is static, so we can pre-multiply the interpolation constants - dx *= spacingdistance; - dy *= spacingdistance; - da *= spacingdistance; - while (distance >= spacingdistance) - { - lastpressure += da; - lastpos.x += dx; - lastpos.y += dy; - distance -= spacingdistance; - - draw_brush(lastpos, brush.size, int(round(lastpressure * brush.opacity))); - } - } - } - } - - // Called when stylus stops touching the screen. - void command_enddraw() - { - if (!stroke) - return; - - // Copy current image to backup image and clear alpha in the region of the stroke. - int x0 = max(min(int(strokemin.x), width), 0); - int x1 = max(min(int(strokemax.x), width), 0); - int y0 = max(min(int(strokemin.y), height), 0); - int y1 = max(min(int(strokemax.y), height), 0); - for (int y = y0; y < y1; y++) - { - memcpy(&image_backup[y*width+x0], &image[y*width+x0], (x1-x0)*sizeof(unsigned int)); - memset(&alpha[y*width+x0], 0, (x1-x0)*sizeof(unsigned char)); - } - - stroke = false; - } - - // The canvas keeps track of the area that has been modified by draw commands, this is called the 'dirty' rectangle. - // The dirty rectangle keeps accumulating until reset_dirty_rect is called, at which point it is cleared to empty. - void reset_dirty_rect() - { - dirtymin = Pos(FLT_MAX,FLT_MAX); - dirtymax = Pos(-FLT_MAX,-FLT_MAX); - } - - // Rasters a brush with specified width and opacity into alpha at a specified position using lookup-tables. - void draw_brush(const Pos& pos, int brushwidth, int opacity) - { - //printf("draw_brush %f,%f width=%d opacity=%d\n", pos.x, pos.y, brushwidth, opacity); - - // Enforce minimum brush size. - if (brushwidth<2) brushwidth = 2; - - // Calculate drawing rectangle. - float halfwidth = brushwidth/2; - float p0x = pos.x - halfwidth; - float p0y = pos.y - halfwidth; - float p1x = pos.x + halfwidth + 1; - float p1y = pos.y + halfwidth + 1; - - int x0 = int(max(min(p0x, p1x), 0.0f)); - int x1 = int(min(max(p0x, p1x), float(width))); - int y0 = int(max(min(p0y, p1y), 0.0f)); - int y1 = int(min(max(p0y, p1y), float(height))); - - // Accumulate dirty regions. - strokemin = Pos::create_from_min(strokemin, Pos(x0, y0)); - strokemax = Pos::create_from_max(strokemax, Pos(x1, y1)); - dirtymin = Pos::create_from_min(dirtymin, Pos(x0, y0)); - dirtymax = Pos::create_from_max(dirtymax, Pos(x1, y1)); - - // Calculate interpolation constants - float db = (BrushType::DIST_TABLE_WIDTH-1) / float(brushwidth); - - float xb = max(0.0f, BrushType::DIST_TABLE_CENTER - (pos.x - x0) * db); - float yb = max(0.0f, BrushType::DIST_TABLE_CENTER - (pos.y - y0) * db); - - // Select which line of the brush-lookup-table to use that most closely matches the current brush width - int brushidx = int(float(BrushType::BRUSH_TABLE_HEIGHT) / brushwidth); - - // Interpolate the distance table over the area. For each pixel find the distance, and look the - // brush-intensity up in the brush-table - if (drawtype == DRAWBRUSH_TYPE_NORMAL) - { - for (int y = y0; y < y1; y++) - { - float x2b = xb; - for (int x = x0; x < x1; x++) - { - // Find brush-intensity and mulitply that with incoming opacity - int lookup = BrushType::distance_tbl[int(x2b)][int(yb)]; - int intensity = fixed_scale(Brush::brush_type[brush.type].intensity_tbl[lookup][brushidx], opacity); - - // New Alpha = Brush Intensity + Old Alpha - (Brush Intensity * Old Alpha) - // Also make sure the result is clamped to the incoming opacity and isn't lower than the alpha - // already stored - int base = alpha[y*width+x]; - int a = max(min(intensity + base - ((intensity * base) >> 8), opacity), base); - alpha[y*width+x] = a; - - Color i = Color::create_from_a8r8g8b8(image_backup[y*width+x]); - i = Color::create_from_lerp(brush.color, i, a); - image[y*width+x] = i.get_a8r8g8b8(); - - x2b += db; - } - yb += db; - } - } - else if (drawtype == DRAWBRUSH_TYPE_GETCOLOR) - { - // Calculate color from a weighted average of the area that the brush touches. - Color c(0, 0, 0, 0); - for (int y = y0; y < y1; y++) - { - float x2b = xb; - for (int x = x0; x < x1; x++) - { - int lookup = BrushType::distance_tbl[int(x2b)][int(yb)]; - int intensity = fixed_scale(Brush::brush_type[brush.type].intensity_tbl[lookup][brushidx], opacity); - Color i = Color::create_from_a8r8g8b8(image[y*width+x]); - c.r += i.r * intensity; - c.g += i.g * intensity; - c.b += i.b * intensity; - c.a += intensity; - x2b += db; - } - yb += db; - } - brush.color.r = c.r / c.a; - brush.color.g = c.g / c.a; - brush.color.b = c.b / c.a; - } - } - - // Return the color underneath the pos. - Color pickup_color(const Pos& pos) - { - int x = int(max(min(pos.x, float(width)), 0.0f)); - int y = int(max(min(pos.y, float(height)), 0.0f)); - return Color::create_from_a8r8g8b8(image[y*width+x]); - } - - //--------------------------------------------------------------------------------------------- - // Playback - // - // These allow the canvas to be treated like a VCR, playing back and rewinding drawing commands - // to recreate the state of the canvas at different times. - - void add_command(const DrawCommand& cmd) - { - commands.push_back(cmd); - modified = true; - } - - void play_command(const DrawCommand& cmd, bool add) - { - if (cmd.type == DrawCommand::TYPE_DRAW) - { -#ifdef CANVAS_DEBUG_COMMANDS - printf("TYPE_DRAW x=%f y=%f pressure=%d\n", cmd.pos.x, cmd.pos.y, cmd.pressure); -#endif - Pos relpos = cmd.pos * Pos(width, height); - bool forcedraw = !add; // If we are not adding, we are playing back - command_draw(relpos, cmd.pressure, forcedraw); - } - else if (cmd.type == DrawCommand::TYPE_DRAWEND) - { -#ifdef CANVAS_DEBUG_COMMANDS - printf("TYPE_DRAWEND pressure=%d\n", cmd.pressure); -#endif - //if self.stroke and (self.lastpos.x != self.lastorgpos.x or self.lastpos.y != self.lastorgpos.y): - // self.command_draw(self.lastorgpos, cmd.pressure, add) - command_enddraw(); - } - else if (cmd.type == DrawCommand::TYPE_COLORCHANGE) - { -#ifdef CANVAS_DEBUG_COMMANDS - printf("TYPE_COLORCHANGE flipx=%d flipy=%d r=%d g=%d b=%d a=%d\n", cmd.flipx, cmd.flipy, cmd.color.r, cmd.color.g, cmd.color.b, cmd.color.a); -#endif - if (cmd.flipx || cmd.flipy) - { - // fixme - //pygame.transform.flip(self.image, cmd.flipx, cmd.flipy) - } - else - brush.color = cmd.color; - } - else if (cmd.type == DrawCommand::TYPE_SIZECHANGE) - { -#ifdef CANVAS_DEBUG_COMMANDS - printf("TYPE_SIZECHANGE size=%f control=%d type=%d opacity=%f\n", cmd.size, cmd.brush_control, cmd.brush_type, cmd.opacity); -#endif - brush.size = int(cmd.size * width); - if (brush.size < 2) - brush.size = 2; - brush.control = cmd.brush_control; - brush.type = cmd.brush_type; - if (cmd.opacity > 0) - brush.opacity = cmd.opacity; - } - -#ifdef CANVAS_DEBUG_COMMANDS - fflush(stdout); -#endif - - if (add) - add_command(cmd); - } - - bool playback_done() - { - return playback < 0 || playback >= (int)commands.size(); - } - - int playback_length() - { - return (int)commands.size(); - } - - int playback_pos() - { - return playback; - } - - void start_playback() - { - command_enddraw(); - clear_image(); - playback = 0; - playing = true; - } - - void pause_playback() - { - playing = false; - } - - void resume_playback() - { - playing = true; - } - - void stop_playback() - { - command_enddraw(); - playback = -1; - playing = false; - } - - void finish_playback() - { - while (!playback_done()) - play_command(commands[playback++], false); - } - - // This is used to avoid leaving the playback state in the middle of a stroke. - void playback_finish_stroke() - { - while (stroke && !playback_done()) - play_command(commands[playback++], false); - } - - void playback_to(int pos) - { - while (playback < pos && !playback_done()) - play_command(commands[playback++], false); - } - - void playback_step_to(int pos) - { - if (playback < pos && !playback_done()) - play_command(commands[playback++], false); - } - - // Same as playback_to, except it breaks if more than timeout seconds are taken. - void playback_to_timed(int pos, float timeout) - { - clock_t start = clock(); - clock_t end = (clock_t)(start + timeout * CLOCKS_PER_SEC); - printf("start: %d end: %d CLOCKS_PER_SEC: %d\n", (int)start, (int)end, (int)CLOCKS_PER_SEC); - while (playback < pos && !playback_done() && clock() < end) - play_command(commands[playback++], false); - //if (clock() > end) - // printf("killed by timeout.\n"); - } - - void set_playback_speed(int speed) - { - playback_speed = speed; - } - - void truncate_at_playback() - { - commands.resize(playback+1); - } - - void update_playback() - { - if (playing) - { - for (int i = 0; i < playback_speed; i++) - { - if (!playback_done()) - play_command(commands[playback++], false); - } - } - } - - int get_num_commands() - { - return commands.size(); - } - - void play_range(int from, int to) - { - for (int i = from; i < to; i++) - play_command(commands[i], false); - } - - //--------------------------------------------------------------------------------------------- - // Blit - // - // Draws a region of the canvas into a GdkImage for display on the screen, with optional scaling - // and darkening. - - void blit_1x(GdkImage* img, int src_x, int src_y, int dest_x, int dest_y, int dest_w, int dest_h, bool overlay) - { - unsigned short* pixels = (unsigned short*)img->mem; - int pitch = img->bpl/sizeof(unsigned short); - - // Clip destination rectangle. Source clipping is handled per pixel. - if (dest_x < 0) - { - dest_w += dest_x; - dest_x = 0; - } - if (dest_y < 0) - { - dest_h += dest_y; - dest_y = 0; - } - if (dest_x+dest_w > img->width) - dest_w = img->width - dest_x; - if (dest_y+dest_h > img->height) - dest_h = img->height - dest_y; - - int csy = src_y; - for (int cdy = dest_y; cdy < dest_y+dest_h; cdy++) - { - unsigned short* __restrict row = &pixels[cdy*pitch+dest_x]; - - // If out of bounds vertically, fill row with the background color. - if (csy < 0 || csy >= height) - { - for (int cdx = 0; cdx < dest_w; cdx++) - { - unsigned int rgb = 0; - *row++ = rgb; - } - } - else - { - unsigned int* __restrict src = &image[csy*width+src_x]; - - int cdx = 0; - int csx = src_x; - - // Fill any portion that is to the left of the src image with - // background color. - while (csx < 0 && cdx < dest_w) - { - unsigned int rgb = 0; - *row++ = rgb; - src++; - csx++; - cdx++; - } - - // Copy the pixels. - if (overlay) - { - while (csx < width && cdx < dest_w) - { - unsigned int p = *src; - p &= ~0x03030303; - p >>= 2; - unsigned int r = (((p>>16)&0xff)>>3)<<11; - unsigned int g = (((p>> 8)&0xff)>>2)<<5; - unsigned int b = (((p>> 0)&0xff)>>3); - unsigned int rgb = r|g|b; - *row++ = rgb; - src++; - csx++; - cdx++; - } - } - else - { - while (csx < width && cdx < dest_w) - { - unsigned int p = *src; - unsigned int r = (((p>>16)&0xff)>>3)<<11; - unsigned int g = (((p>> 8)&0xff)>>2)<<5; - unsigned int b = (((p>> 0)&0xff)>>3); - unsigned int rgb = r|g|b; - *row++ = rgb; - src++; - csx++; - cdx++; - } - } - - // Fill any portion to the right of src with background pixels. - while (cdx < dest_w) - { - unsigned int rgb = 0; - *row++ = rgb; - src++; - csx++; - cdx++; - } - } - - csy++; - } - } - - void blit_2x(GdkImage* img, int src_x, int src_y, int dest_x, int dest_y, int dest_w, int dest_h, bool overlay) - { - unsigned short* pixels = (unsigned short*)img->mem; - int pitch = img->bpl/sizeof(unsigned short); - - // Clip destination rectangle. Source clipping is handled per pixel. - if (dest_x < 0) - { - dest_w += dest_x; - dest_x = 0; - } - if (dest_y < 0) - { - dest_h += dest_y; - dest_y = 0; - } - if (dest_x+dest_w > img->width-2) - dest_w = (img->width-2) - dest_x; - if (dest_y+dest_h > img->height-2) - dest_h = (img->height-2) - dest_y; - - int csy = src_y; - for (int cdy = dest_y; cdy < dest_y+dest_h; cdy += 2) - { - unsigned short* __restrict row0 = &pixels[cdy*pitch+dest_x]; - unsigned short* __restrict row1 = row0 + pitch; - - // If out of bounds vertically, fill row with the background color. - if (csy < 0 || csy >= height) - { - for (int cdx = 0; cdx < dest_w; cdx += 2) - { - unsigned int rgb = 0; - row0[0] = rgb; - row0[1] = rgb; - row1[0] = rgb; - row1[1] = rgb; - row0 += 2; - row1 += 2; - } - } - else - { - unsigned int* __restrict src = &image[csy*width+src_x]; - - int cdx = 0; - int csx = src_x; - - // Fill any portion that is to the left of the src image with - // background color. - while (csx < 0 && cdx < dest_w) - { - unsigned int rgb = 0; - row0[0] = rgb; - row0[1] = rgb; - row1[0] = rgb; - row1[1] = rgb; - row0 += 2; - row1 += 2; - src++; - csx++; - cdx += 2; - } - - // Copy the pixels. - if (overlay) - { - while (csx < width && cdx < dest_w) - { - unsigned int p = *src; - p &= ~0x03030303; - p >>= 2; - unsigned int r = (((p>>16)&0xff)>>3)<<11; - unsigned int g = (((p>> 8)&0xff)>>2)<<5; - unsigned int b = (((p>> 0)&0xff)>>3); - unsigned int rgb = r|g|b; - row0[0] = rgb; - row0[1] = rgb; - row1[0] = rgb; - row1[1] = rgb; - row0 += 2; - row1 += 2; - src++; - csx++; - cdx += 2; - } - } - else - { - while (csx < width && cdx < dest_w) - { - unsigned int p = *src; - unsigned int r = (((p>>16)&0xff)>>3)<<11; - unsigned int g = (((p>> 8)&0xff)>>2)<<5; - unsigned int b = (((p>> 0)&0xff)>>3); - unsigned int rgb = r|g|b; - row0[0] = rgb; - row0[1] = rgb; - row1[0] = rgb; - row1[1] = rgb; - row0 += 2; - row1 += 2; - src++; - csx++; - cdx += 2; - } - } - - // Fill any portion to the right of src with background pixels. - while (cdx < dest_w) - { - unsigned int rgb = 0; - row0[0] = rgb; - row0[1] = rgb; - row1[0] = rgb; - row1[1] = rgb; - row0 += 2; - row1 += 2; - src++; - csx++; - cdx += 2; - } - } - - csy++; - } - } - - void blit_4x(GdkImage* img, int src_x, int src_y, int dest_x, int dest_y, int dest_w, int dest_h, bool overlay) - { - unsigned short* pixels = (unsigned short*)img->mem; - int pitch = img->bpl/sizeof(unsigned short); - - // Clip rectangle. - // Clip destination rectangle. Source clipping is handled per pixel. - if (dest_x < 0) - { - dest_w += dest_x; - dest_x = 0; - } - if (dest_y < 0) - { - dest_h += dest_y; - dest_y = 0; - } - if (dest_x + dest_w > img->width-4) - dest_w = (img->width-4) - dest_x; - if (dest_y + dest_h > img->height-4) - dest_h = (img->height-4) - dest_y; - - int csy = src_y; - for (int cdy = dest_y; cdy < dest_y+dest_h; cdy += 4) - { - unsigned short* __restrict row0 = &pixels[cdy*pitch+dest_x]; - unsigned short* __restrict row1 = row0 + pitch; - unsigned short* __restrict row2 = row1 + pitch; - unsigned short* __restrict row3 = row2 + pitch; - -#define FILL_PIXEL(rgb) \ - row0[0] = rgb; row0[1] = rgb; row0[2] = rgb; row0[3] = rgb; \ - row1[0] = rgb; row1[1] = rgb; row1[2] = rgb; row1[3] = rgb; \ - row2[0] = rgb; row2[1] = rgb; row2[2] = rgb; row2[3] = rgb; \ - row3[0] = rgb; row3[1] = rgb; row3[2] = rgb; row3[3] = rgb; \ - row0 += 4; row1 += 4; row2 += 4; row3 += 4; - - if (csy < 0 || csy >= height) - { - for (int cdx = 0; cdx < dest_w; cdx += 4) - { - FILL_PIXEL(0) - } - } - else - { - unsigned int* __restrict src = &image[csy*width+src_x]; - - int cdx = 0; - int csx = src_x; - - while (csx < 0 && cdx < dest_w) - { - FILL_PIXEL(0) - - src++; - csx++; - cdx += 4; - } - - if (overlay) - { - while (csx < width && cdx < dest_w) - { - unsigned int p = *src; - p &= ~0x03030303; - p >>= 2; - unsigned int r = (((p>>16)&0xff)>>3)<<11; - unsigned int g = (((p>> 8)&0xff)>>2)<<5; - unsigned int b = (((p>> 0)&0xff)>>3); - unsigned int rgb = r|g|b; - FILL_PIXEL(rgb) - - src++; - csx++; - cdx += 4; - } - } - else - { - while (csx < width && cdx < dest_w) - { - unsigned int p = *src; - unsigned int r = (((p>>16)&0xff)>>3)<<11; - unsigned int g = (((p>> 8)&0xff)>>2)<<5; - unsigned int b = (((p>> 0)&0xff)>>3); - unsigned int rgb = r|g|b; - FILL_PIXEL(rgb) - - src++; - csx++; - cdx += 4; - } - } - - while (cdx < dest_w) - { - FILL_PIXEL(0) - - src++; - csx++; - cdx += 4; - } - } - -#undef FILL_PIXEL - - csy++; - } - } - - void blit_8x(GdkImage* img, int src_x, int src_y, int dest_x, int dest_y, int dest_w, int dest_h, bool overlay) - { - unsigned short* pixels = (unsigned short*)img->mem; - int pitch = img->bpl/sizeof(unsigned short); - - // Clip rectangle. - // Clip destination rectangle. Source clipping is handled per pixel. - if (dest_x < 0) - { - dest_w += dest_x; - dest_x = 0; - } - if (dest_y < 0) - { - dest_h += dest_y; - dest_y = 0; - } - if (dest_x + dest_w > img->width-8) - dest_w = (img->width-8) - dest_x; - if (dest_y + dest_h > img->height-8) - dest_h = (img->height-8) - dest_y; - - int csy = src_y; - for (int cdy = dest_y; cdy < dest_y+dest_h; cdy += 8) - { - unsigned short* __restrict row0 = &pixels[cdy*pitch+dest_x]; - unsigned short* __restrict row1 = row0 + pitch; - unsigned short* __restrict row2 = row1 + pitch; - unsigned short* __restrict row3 = row2 + pitch; - unsigned short* __restrict row4 = row3 + pitch; - unsigned short* __restrict row5 = row4 + pitch; - unsigned short* __restrict row6 = row5 + pitch; - unsigned short* __restrict row7 = row6 + pitch; - -#define FILL_PIXEL(rgb) \ - row0[0] = rgb; row0[1] = rgb; row0[2] = rgb; row0[3] = rgb; row0[4] = rgb; row0[5] = rgb; row0[6] = rgb; row0[7] = rgb; \ - row1[0] = rgb; row1[1] = rgb; row1[2] = rgb; row1[3] = rgb; row1[4] = rgb; row1[5] = rgb; row1[6] = rgb; row1[7] = rgb; \ - row2[0] = rgb; row2[1] = rgb; row2[2] = rgb; row2[3] = rgb; row2[4] = rgb; row2[5] = rgb; row2[6] = rgb; row2[7] = rgb; \ - row3[0] = rgb; row3[1] = rgb; row3[2] = rgb; row3[3] = rgb; row3[4] = rgb; row3[5] = rgb; row3[6] = rgb; row3[7] = rgb; \ - row4[0] = rgb; row4[1] = rgb; row4[2] = rgb; row4[3] = rgb; row4[4] = rgb; row4[5] = rgb; row4[6] = rgb; row4[7] = rgb; \ - row5[0] = rgb; row5[1] = rgb; row5[2] = rgb; row5[3] = rgb; row5[4] = rgb; row5[5] = rgb; row5[6] = rgb; row5[7] = rgb; \ - row6[0] = rgb; row6[1] = rgb; row6[2] = rgb; row6[3] = rgb; row6[4] = rgb; row6[5] = rgb; row6[6] = rgb; row6[7] = rgb; \ - row7[0] = rgb; row7[1] = rgb; row7[2] = rgb; row7[3] = rgb; row7[4] = rgb; row7[5] = rgb; row7[6] = rgb; row7[7] = rgb; \ - row0 += 8; row1 += 8; row2 += 8; row3 += 8; row4 += 8; row5 += 8; row6 += 8; row7 += 8; - - if (csy < 0 || csy >= height) - { - for (int cdx = 0; cdx < dest_w; cdx += 8) - { - FILL_PIXEL(0) - } - } - else - { - unsigned int* __restrict src = &image[csy*width+src_x]; - - int cdx = 0; - int csx = src_x; - - while (csx < 0 && cdx < dest_w) - { - FILL_PIXEL(0) - - src++; - csx++; - cdx += 8; - } - - if (overlay) - { - while (csx < width && cdx < dest_w) - { - unsigned int p = *src; - p &= ~0x03030303; - p >>= 2; - unsigned int r = (((p>>16)&0xff)>>3)<<11; - unsigned int g = (((p>> 8)&0xff)>>2)<<5; - unsigned int b = (((p>> 0)&0xff)>>3); - unsigned int rgb = r|g|b; - FILL_PIXEL(rgb) - - src++; - csx++; - cdx += 8; - } - } - else - { - while (csx < width && cdx < dest_w) - { - unsigned int p = *src; - unsigned int r = (((p>>16)&0xff)>>3)<<11; - unsigned int g = (((p>> 8)&0xff)>>2)<<5; - unsigned int b = (((p>> 0)&0xff)>>3); - unsigned int rgb = r|g|b; - FILL_PIXEL(rgb) - - src++; - csx++; - cdx += 8; - } - } - - while (cdx < dest_w) - { - unsigned int rgb = 0; - FILL_PIXEL(rgb) - - src++; - csx++; - cdx += 8; - } - } - -#undef FILL_PIXEL - - csy++; - } - } - - //--------------------------------------------------------------------------------------------- - // Videopaint - // - // This code currently attempts to track a green object in the webcam and treat it as a - // mouse cursor, using the detected size to control the brush size. - - void downsize_video(unsigned int* dest_pixels, GstBuffer* buf, int vwidth, int vheight) - { - if (vwidth != VIDEO_WIDTH*8 || vheight != VIDEO_HEIGHT*8 || buf->size != vwidth*vheight*sizeof(unsigned short)) - { - printf("Invalid Gst video buffer size %d (%dx%d)\n", buf->size, vwidth, vheight); - return; - } - - unsigned int* source_pixels = (unsigned int*)buf->data; - - for (int y = 0; y < VIDEO_HEIGHT; y++) - { - unsigned int* __restrict src = &source_pixels[(y*4)*vwidth]; - unsigned int* __restrict dest = &dest_pixels[y*VIDEO_WIDTH]; - for (int x = 0; x < VIDEO_WIDTH; x++) - { - *dest = *src; - src += 4; - dest++; - } - } - } - - void videopaint_motion(GstBuffer* buf, int vwidth, int vheight) - { - downsize_video(image_video[1], buf, vwidth, vheight); - - unsigned int* pixels0 = image_video[0]; - unsigned int* pixels1 = image_video[1]; - double cx = 0, cy = 0, cnt = 0; - for (int y = 0; y < VIDEO_HEIGHT; y++) - { - unsigned int* __restrict row = &pixels1[y*VIDEO_WIDTH]; - unsigned int* destrow = &pixels0[y*VIDEO_WIDTH]; - for (int x = 0; x < VIDEO_WIDTH; x++) - { - // Convert YUYV to HSV - Color c = Color::yuv_to_hsv(*row); - // Threshold green - if ((c.r > 80) && (c.r < 150) && (c.g > 100)) { - destrow[0] = 0xffff; - cnt++; - cx += (80-x); - cy += y; - } else { - destrow[0] = 0; - } - row++; - destrow++; - } - } - - if (cnt > 0) - { - cx /= cnt; - cy /= cnt; - // The mouse coordinates are scaled somewhat, as the nature of the video processing causes the blob to leave - // the screen partially and become smaller (and less significant) towards the edges. - videopaint_pos = Pos( - map_range(cx, 0, VIDEO_WIDTH, -0.2f, 1.2f), - map_range(cy, 0, VIDEO_HEIGHT, -0.2f, 1.2f)); - // todo- estimate size - videopaint_pressure = map_range(cnt, 0, (VIDEO_WIDTH*VIDEO_HEIGHT)/8, 0, 255); - // Mark mouse pixel in red. - int rx = int(cx); - int ry = int(cy); - unsigned short red = Color(255,0,0,0).get_r5g6b5(); - for (int x = -3; x <= 3; x++) - for (int y = -3; y <= 3; y++) - image_video[0][ry+y*VIDEO_WIDTH+rx+x] = red; - } - } - - void blit_videopaint(GdkImage* img) - { - unsigned short* pixels = (unsigned short*)img->mem; - int pitch = img->bpl/sizeof(unsigned short); - - for (int y = 0; y < VIDEO_HEIGHT; y++) - { - unsigned int* __restrict src = &image_video[0][y*VIDEO_WIDTH]; - unsigned short* __restrict dest = &pixels[y*pitch]; - for (int x = 0; x < VIDEO_WIDTH; x++) - { - unsigned int p = *src++; - unsigned int r = (((p>>16)&0xff)>>3)<<11; - unsigned int g = (((p>> 8)&0xff)>>2)<<5; - unsigned int b = (((p>> 0)&0xff)>>3); - unsigned int rgb = r|g|b; - *dest++ = rgb; - } - } - } - - //--------------------------------------------------------------------------------------------- - // Reference image - // - // The reference image is a snapshot taken by the webcam that can transparently displayed over the canvas. - // Note that painting currently cannot take place while the reference image is shown. - - void set_reference_buffer(GstBuffer* buf, int vwidth, int vheight) - { - if (vwidth != REFERENCE_WIDTH || vheight != REFERENCE_HEIGHT || buf->size != vwidth*vheight*sizeof(unsigned short)) - { - printf("Invalid Gst reference buffer size %d\n", buf->size); - return; - } - memcpy(image_reference, buf->data, min(buf->size, REFERENCE_WIDTH*REFERENCE_HEIGHT*sizeof(unsigned short))); - } - - void render_reference_overlay() - { - // Uses image_backup to blend over the canvas without affecting the contents of the canvas. - // Scales up from whatever REFERENCE_WIDTH/REFERENCE_HEIGHT are to the canvas size. - int dx = (1<<16) * REFERENCE_WIDTH / width; - int dy = (1<<16) * REFERENCE_HEIGHT / height; - int ry = 0; - for (int y = 0; y < height; y++, ry += dy) - { - int rx = 0; - for (int x = 0; x < width; x++, rx += dx) - { - Color r = Color::create_from_r5g6b5(image_reference[(ry>>16)*REFERENCE_WIDTH+(rx>>16)]); - r = Color::create_from_yuv(r.r, r.g, r.b); - Color b = Color::create_from_a8r8g8b8(image_backup[y*width+x]); - image[y*width+x] = Color::create_from_lerp(r, b, 192).get_a8r8g8b8(); - } - } - } - - //--------------------------------------------------------------------------------------------- - // Overlay - // - // These functions basically just temporarily darken the entire canvas so that a PyGTK overlay - // like the brush controls can be drawn on top, and look like it has a translucent black background. - - void render_overlay() - { - // Since the image is backed up in image_backup, it's ok to destroy the contents of image since - // clear_overlay will just restore it from image_backup. - for (int y = 0; y < height; y++) - for (int x = 0; x < width; x++) - { - unsigned int i = image_backup[y*width+x]; - i &= ~0x03030303; - i >>= 2; - image[y*width+x] = i; - } - } - - void clear_overlay() - { - memcpy(image, image_backup, width*height*sizeof(unsigned int)); - } - - //--------------------------------------------------------------------------------------------- - // Load & Save - - void upgrade_drw_header(DRW_Header* hdr, DRW_Command* cmds) - { - if (hdr->version == DRW_Header::ID) // Paying for old bug - hdr->version = 1002; - - if (hdr->version < DRW_VERSION) - { - for(int i = 0; i < hdr->ncommands; i++) - { - DRW_Command* cmd = &cmds[i]; - if (hdr->version < 1001) - { - if (cmd->type == DrawCommand::TYPE_DRAW) - { - cmd->x = int(round(cmd->x * 1024.0f / 2047.0f + 512.0f)); - cmd->x = int(round(cmd->y * 1024.0f / 2047.0f + 512.0f)); - } - } - - if (hdr->version < 1002) - { - if (cmd->type == DrawCommand::TYPE_SIZECHANGE) - { - int type = (cmd->brushtype << 2) | cmd->brushcontrol; - switch(type) - { - case 0: cmd->brushtype = BrushType::BRUSHTYPE_HARD; cmd->brushcontrol = Brush::BRUSHCONTROL_VARIABLEOPACITY; break; - case 2: cmd->brushtype = BrushType::BRUSHTYPE_SOFT; cmd->brushcontrol = Brush::BRUSHCONTROL_VARIABLEOPACITY; break; - case 4: cmd->brushtype = BrushType::BRUSHTYPE_HARD; cmd->brushcontrol = 0; break; - case 6: cmd->brushtype = BrushType::BRUSHTYPE_SOFT; cmd->brushcontrol = 0; break; - } - cmd->size -= (1 << 6); - } - } - } - hdr->version = DRW_VERSION; - } - } - - bool load(const char* filename) - { - FILE* drwfile = fopen(filename, "rb"); - if (!drwfile) - return false; - - int r; - - DRW_Header header; - r = fread(&header, 1, sizeof(DRW_Header), drwfile); - - // Backward compatible code for early versions when there was no header and the filesize is used - // to determine the number of commands. - if (header.id != DRW_Header::ID) - { - header.colorsversion_initial = 0; - fseek(drwfile, 0, SEEK_END); - header.ncommands = ftell(drwfile) / 4; - fseek(drwfile, 0, SEEK_SET); - } - - DRW_Command* cmds = (DRW_Command*)malloc(header.ncommands*sizeof(DRW_Command)); - r = fread(cmds, 1, header.ncommands*sizeof(DRW_Command), drwfile); - - fclose(drwfile); - - upgrade_drw_header(&header, cmds); - - clear(); - convert_from_drw(cmds, 0, header.ncommands); - - free(cmds); - - return true; - } - - bool save(const char* filename) - { - FILE* drwfile = fopen(filename, "wb"); - if (!drwfile) - return false; - - int r; - - DRW_Header header; - header.id = DRW_Header::ID; - header.version = DRW_VERSION; - header.colorsversion_initial = DRW_VERSION; - header.colorsversion_saved = DRW_VERSION; - header.strokes = 0; - header.time = 0; - header.timessaved = 0; - header.ncommands = commands.size(); - r = fwrite(&header, 1, sizeof(DRW_Header), drwfile); - - DRW_Command* cmds; - convert_to_drw(&cmds, 0, commands.size()); - - r = fwrite(cmds, sizeof(DRW_Command), commands.size(), drwfile); - free(cmds); - - fclose(drwfile); - - return true; - } - - void convert_from_drw(DRW_Command* cmds, int start, int ncommands) - { - commands.resize(start+ncommands); - for (int i = 0; i < ncommands; i++) - { - DRW_Command* drw = &cmds[i]; - DrawCommand* cmd = &commands[start+i]; - - cmd->type = drw->type; - cmd->pos.x = (drw->x-512.0f) / 1024.0f; - cmd->pos.y = (drw->y-512.0f) / 1024.0f; - cmd->pressure = drw->alpha; - - cmd->color = Color::create_from_a8r8g8b8(drw->col); - cmd->flipx = drw->flipx; - cmd->flipy = drw->flipy; - - cmd->brush_control = drw->brushcontrol; - cmd->brush_type = drw->brushtype; - cmd->size = drw->size / float(1 << 15); - cmd->opacity = drw->opacity / 255.0f; - } - } - - void convert_to_drw(DRW_Command** cmds, int start, int ncommands) - { - *cmds = (DRW_Command*)malloc(sizeof(DRW_Command) * ncommands); - - for (int i = 0; i < ncommands; i++) - { - DRW_Command* drw = &(*cmds)[i]; - DrawCommand* cmd = &commands[start+i]; - - drw->type = cmd->type; - - if (cmd->type == DrawCommand::TYPE_DRAW) - { - drw->x = int((cmd->pos.x*1024)+512); - drw->y = int((cmd->pos.y*1024)+512); - drw->alpha = cmd->pressure; - } - else if (cmd->type == DrawCommand::TYPE_DRAWEND) - { - drw->alpha = cmd->pressure; - } - else if (cmd->type == DrawCommand::TYPE_COLORCHANGE) - { - drw->flipx = cmd->flipx; - drw->flipy = cmd->flipy; - drw->col = cmd->color.get_a8r8g8b8(); - } - else if (cmd->type == DrawCommand::TYPE_SIZECHANGE) - { - drw->brushcontrol = cmd->brush_control; - drw->brushtype = cmd->brush_type; - drw->size = int(cmd->size * float(1<<15)); - drw->opacity = int(cmd->opacity * 255.0f); - } - } - } - - DrawCommandBuffer send_drw_commands(int start, int ncommands) - { - DrawCommandBuffer buf; - buf.ncommands = ncommands; - convert_to_drw((DRW_Command**)&buf.cmds, start, ncommands); - return buf; - } - - void receive_drw_commands(const DrawCommandBuffer& buf, int start) - { - convert_from_drw((DRW_Command*)buf.cmds, start, buf.ncommands); - } -}; - -#endif - diff --git a/src/colorsc.h b/src/colorsc.h deleted file mode 100644 index 543a2ce..0000000 --- a/src/colorsc.h +++ /dev/null @@ -1,205 +0,0 @@ -/* - Copyright 2008 by Jens Andersson and Wade Brainerd. - This file is part of Colors! XO. - - Colors is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Colors is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Colors. If not, see <http://www.gnu.org/licenses/>. -*/ -#ifndef _COLORSC_H_ -#define _COLORSC_H_ - -#include <python2.5/Python.h> - -#include <vector> -#include <algorithm> -using namespace std; - -#include <cmath> -#include <float.h> - -// todo- Include the real GTK headers when installed. -#include "gtk_types.h" - -static const float PI = 3.14159f; - -inline float sgn(float a) { if (a>0) return 1; if (a<0) return -1; return 0; } - -inline float sqr(float a) { return a*a; } - -inline float clamp(float a, float mn, float mx) { return max(mn, min(mx, a)); } - -inline float to_rad(float degrees) { return degrees * PI/180.0f; } -inline float to_deg(float rads) { return rads * 180.0f/PI; } - -// Maps an incoming value in a given f0-t0 range to a new value in the f1-t1 range, optionally clamping to f1-t1. -inline float map_range(float a, float f0, float t0, float f1, float t1, bool clmp=true) -{ - float r = (a-f0)/(t0-f0); - if (clmp) r = clamp(r, 0.0f, 1.0f); - return f1+r*(t1-f1); -} - -// Scales a value by an 8bit scale factor from 0-255. The MSB of the scale factor is added to it, which means that -// scaling by 255 is an identity. -inline int fixed_scale(int value, int scale) -{ - scale += scale >> 7; - return (value * scale) >> 8; -} - -inline unsigned short endian_swap(unsigned short v) -{ - return (v>>8) | (v<<8); -} - -struct Pos -{ - float x, y; - Pos() : x(0), y(0) {} - Pos(float x, float y) : x(x), y(y) {} - Pos operator+(const Pos& b) const { return Pos(x+b.x, y+b.y); } - Pos operator-(const Pos& b) const { return Pos(x-b.x, y-b.y); } - Pos operator*(const Pos& b) const { return Pos(x*b.x, y*b.y); } - Pos operator/(const Pos& b) const { return Pos(x/b.x, y/b.y); } - Pos operator*(float b) const { return Pos(x*b, y*b); } - Pos operator/(float b) const { return Pos(x/b, y/b); } - static Pos create_from_min(const Pos& a, const Pos& b) { return Pos(min(a.x,b.x), min(a.y,b.y)); } - static Pos create_from_max(const Pos& a, const Pos& b) { return Pos(max(a.x,b.x), max(a.y,b.y)); } - static Pos create_from_angle(float a, float r) { return Pos(cosf(a*PI/180.0f)*r, sinf(a*PI/180.0f)*r); } - static Pos create_from_rotation(const Pos& a, const Pos& center, float t) - { - return Pos( - (a.x-center.x)*cosf(t) - (a.y-center.y)*sinf(t) + center.x, - (a.y-center.y)*cosf(t) + (a.x-center.x)*sinf(t) + center.y); - } -}; - -struct Color -{ - unsigned char r, g, b, a; - Color() : r(0), g(0), b(0), a(0) {} - Color(int r, int g, int b, int a) : r(r), g(g), b(b), a(a) {} - unsigned int get_a8r8g8b8() { return (a<<24) | (r<<16) | (g<<8) | (b<<0); } - static Color create_from_a8r8g8b8(unsigned int v) - { - Color c; - c.a = (v>>24) & 0xff; - c.r = (v>>16) & 0xff; - c.g = (v>> 8) & 0xff; - c.b = (v>> 0) & 0xff; - return c; - } - unsigned int get_a8b8g8r8() { return (a<<24) | (b<<16) | (g<<8) | (r<<0); } - static Color create_from_a8b8g8r8(unsigned int v) - { - Color c; - c.a = (v>>24) & 0xff; - c.b = (v>>16) & 0xff; - c.g = (v>> 8) & 0xff; - c.r = (v>> 0) & 0xff; - return c; - } - unsigned int get_r5g6b5() { return ((r>>3)<<11) | ((g>>2)<<5) | (b>>3); } - static Color create_from_r5g6b5(unsigned short v) - { - Color c; - c.r = ((v>>11)&0x1f)<<3; - c.g = ((v>> 5)&0x1f)<<3; - c.b = ((v>> 0)&0x1f)<<3; - c.a = 255; - return c; - } - unsigned int get_b5g6r5() { return ((b>>3)<<11) | ((g>>2)<<5) | (r>>3); } - static Color create_from_float(float r, float g, float b, float a) - { - Color c; - c.r = int(r*255.0f); - c.g = int(g*255.0f); - c.b = int(b*255.0f); - c.a = int(a*255.0f); - return c; - } - static Color create_from_blend(const Color& a, const Color& b) - { - return create_from_lerp(a, b, a.a); - } - static Color create_from_lerp(const Color& a, const Color& b, unsigned int l) - { - unsigned int il = 255-l; - l += l >> 7; - il += il >> 7; - Color c; - c.r = ((a.r * l) + (b.r * il)) >> 8; - c.g = ((a.g * l) + (b.g * il)) >> 8; - c.b = ((a.b * l) + (b.b * il)) >> 8; - c.a = ((a.a * l) + (b.a * il)) >> 8; - return c; - } - static Color create_from_yuv(unsigned char y, unsigned char u, unsigned char v) - { - Color c; - c.r = (unsigned char)max(0.0f, min(255.0f, 1.164f*(y-16) + 1.596f*(v-128))); - c.g = (unsigned char)max(0.0f, min(255.0f, 1.164f*(y-16) - 0.813f*(v-128) - 0.391f*(u-128))); - c.b = (unsigned char)max(0.0f, min(255.0f, 1.164f*(y-16) + 2.018f*(u-128))); - return c; - } - - static Color yuv_to_hsv(unsigned int yuv) - { - Color c, d; - unsigned char y,u,v,val,delta,vmin; - float hue, sat; - // v4l2src is sending YUYV, meaning, 4 bytes per 2 pixels. - // pixel 1 gets the first 8 bit y and both 8 bit U and V. - // pixel 2 gets the other y and u and v. we are only using pixel 1. - y = ((yuv>>24)&0xFF); - u = ((yuv>>16)&0xFF); - v = (yuv&0xFF); - // for now, yuv->first. TODO: go straight from yuv to hsv - d = create_from_yuv(y, u, v); - - val = max(max(d.r, d.g), d.b); - vmin = min(min(d.r, d.g), d.b); - delta = val-vmin; - if (delta == 0) { - hue = 0.0; - sat = 0.0; - } else if (val == d.r) { - hue = 42.5*(d.g-d.b)/delta; - sat = 255.0*delta/val; - } else if (val == d.g) { - hue = 42.5*(d.b-d.r)/delta + 85.0; - sat = 255.0*delta/val; - } else { - hue = 42.5*(d.r-d.g)/delta + 170.0; - sat = 255.0*delta/val; - } - if (hue < 0.0) hue += 255.0; - if (hue > 255.0) hue -= 255.0; - c.r = (unsigned char)max(0.0f, min(255.0f, hue)); - c.g = (unsigned char)max(0.0f, min(255.0f, sat)); - c.b = (unsigned char)max((unsigned char)0, min((unsigned char)255, val)); - return c; - } - -}; - -// Structure for passing byte data to and from Python. -struct ByteBuffer -{ - int size; - void* data; -}; - -#endif - diff --git a/src/colorsc.i b/src/colorsc.i deleted file mode 100644 index a1e3471..0000000 --- a/src/colorsc.i +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright 2008 by Jens Andersson and Wade Brainerd. - This file is part of Colors! XO. - - Colors is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Colors is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Colors. If not, see <http://www.gnu.org/licenses/>. -*/ -%module colorsc - -%{ -#include "canvas.h" -#include "palette.h" -%} - -// Testing facility. -%typemap(in) void* { - $1 = $input; -} - -// Pass a gst.Buffer as a GstBuffer*. -%typemap(in) GstBuffer* { - // todo- Error checking would be nice. - PyGObject* pygo = (PyGObject*)$input; - GstBuffer* buf = (GstBuffer*)pygo->obj; - $1 = buf; -} - -// Pass a gtk.gdk.Image as a GdkImage*. -%typemap(in) GdkImage* { - // todo- Error checking would be nice. - PyGObject* pygo = (PyGObject*)$input; - GdkImage* img = (GdkImage*)pygo->obj; - $1 = img; -} - -// Return SurfaceA8R8G8B8 as Python string. -%typemap(out) SurfaceA8R8G8B8 { - $result = PyString_FromStringAndSize((const char*)$1.pixels, $1.stride*$1.height); -} - -// Return ByteBuffer as Python string. -%typemap(out) ByteBuffer { - $result = PyString_FromStringAndSize((const char*)$1.data, $1.size); -} - -%include "colorsc.h" -%include "canvas.h" -%include "palette.h" - diff --git a/src/colorsc_wrap.cxx b/src/colorsc_wrap.cxx deleted file mode 100644 index 972c583..0000000 --- a/src/colorsc_wrap.cxx +++ /dev/null @@ -1,12605 +0,0 @@ -/* ---------------------------------------------------------------------------- - * This file was automatically generated by SWIG (http://www.swig.org). - * Version 1.3.33 - * - * This file is not intended to be easily readable and contains a number of - * coding conventions designed to improve portability and efficiency. Do not make - * changes to this file unless you know what you are doing--modify the SWIG - * interface file instead. - * ----------------------------------------------------------------------------- */ - -#define SWIGPYTHON -#define SWIG_PYTHON_DIRECTOR_NO_VTABLE - -#ifdef __cplusplus -template<typename T> class SwigValueWrapper { - T *tt; -public: - SwigValueWrapper() : tt(0) { } - SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { } - SwigValueWrapper(const T& t) : tt(new T(t)) { } - ~SwigValueWrapper() { delete tt; } - SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } - operator T&() const { return *tt; } - T *operator&() { return tt; } -private: - SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs); -}; - -template <typename T> T SwigValueInit() { - return T(); -} -#endif - -/* ----------------------------------------------------------------------------- - * This section contains generic SWIG labels for method/variable - * declarations/attributes, and other compiler dependent labels. - * ----------------------------------------------------------------------------- */ - -/* template workaround for compilers that cannot correctly implement the C++ standard */ -#ifndef SWIGTEMPLATEDISAMBIGUATOR -# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) -# define SWIGTEMPLATEDISAMBIGUATOR template -# elif defined(__HP_aCC) -/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ -/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ -# define SWIGTEMPLATEDISAMBIGUATOR template -# else -# define SWIGTEMPLATEDISAMBIGUATOR -# endif -#endif - -/* inline attribute */ -#ifndef SWIGINLINE -# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) -# define SWIGINLINE inline -# else -# define SWIGINLINE -# endif -#endif - -/* attribute recognised by some compilers to avoid 'unused' warnings */ -#ifndef SWIGUNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -# elif defined(__ICC) -# define SWIGUNUSED __attribute__ ((__unused__)) -# else -# define SWIGUNUSED -# endif -#endif - -#ifndef SWIGUNUSEDPARM -# ifdef __cplusplus -# define SWIGUNUSEDPARM(p) -# else -# define SWIGUNUSEDPARM(p) p SWIGUNUSED -# endif -#endif - -/* internal SWIG method */ -#ifndef SWIGINTERN -# define SWIGINTERN static SWIGUNUSED -#endif - -/* internal inline SWIG method */ -#ifndef SWIGINTERNINLINE -# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE -#endif - -/* exporting methods */ -#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY -# endif -#endif - -#ifndef SWIGEXPORT -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# if defined(STATIC_LINKED) -# define SWIGEXPORT -# else -# define SWIGEXPORT __declspec(dllexport) -# endif -# else -# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) -# define SWIGEXPORT __attribute__ ((visibility("default"))) -# else -# define SWIGEXPORT -# endif -# endif -#endif - -/* calling conventions for Windows */ -#ifndef SWIGSTDCALL -# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# define SWIGSTDCALL __stdcall -# else -# define SWIGSTDCALL -# endif -#endif - -/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ -#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) -# define _CRT_SECURE_NO_DEPRECATE -#endif - -/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ -#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) -# define _SCL_SECURE_NO_DEPRECATE -#endif - - - -/* Python.h has to appear first */ -#include <Python.h> - -/* ----------------------------------------------------------------------------- - * swigrun.swg - * - * This file contains generic CAPI SWIG runtime support for pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -/* This should only be incremented when either the layout of swig_type_info changes, - or for whatever reason, the runtime changes incompatibly */ -#define SWIG_RUNTIME_VERSION "3" - -/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ -#ifdef SWIG_TYPE_TABLE -# define SWIG_QUOTE_STRING(x) #x -# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) -# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) -#else -# define SWIG_TYPE_TABLE_NAME -#endif - -/* - You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for - creating a static or dynamic library from the swig runtime code. - In 99.9% of the cases, swig just needs to declare them as 'static'. - - But only do this if is strictly necessary, ie, if you have problems - with your compiler or so. -*/ - -#ifndef SWIGRUNTIME -# define SWIGRUNTIME SWIGINTERN -#endif - -#ifndef SWIGRUNTIMEINLINE -# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE -#endif - -/* Generic buffer size */ -#ifndef SWIG_BUFFER_SIZE -# define SWIG_BUFFER_SIZE 1024 -#endif - -/* Flags for pointer conversions */ -#define SWIG_POINTER_DISOWN 0x1 - -/* Flags for new pointer objects */ -#define SWIG_POINTER_OWN 0x1 - - -/* - Flags/methods for returning states. - - The swig conversion methods, as ConvertPtr, return and integer - that tells if the conversion was successful or not. And if not, - an error code can be returned (see swigerrors.swg for the codes). - - Use the following macros/flags to set or process the returning - states. - - In old swig versions, you usually write code as: - - if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { - // success code - } else { - //fail code - } - - Now you can be more explicit as: - - int res = SWIG_ConvertPtr(obj,vptr,ty.flags); - if (SWIG_IsOK(res)) { - // success code - } else { - // fail code - } - - that seems to be the same, but now you can also do - - Type *ptr; - int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); - if (SWIG_IsOK(res)) { - // success code - if (SWIG_IsNewObj(res) { - ... - delete *ptr; - } else { - ... - } - } else { - // fail code - } - - I.e., now SWIG_ConvertPtr can return new objects and you can - identify the case and take care of the deallocation. Of course that - requires also to SWIG_ConvertPtr to return new result values, as - - int SWIG_ConvertPtr(obj, ptr,...) { - if (<obj is ok>) { - if (<need new object>) { - *ptr = <ptr to new allocated object>; - return SWIG_NEWOBJ; - } else { - *ptr = <ptr to old object>; - return SWIG_OLDOBJ; - } - } else { - return SWIG_BADOBJ; - } - } - - Of course, returning the plain '0(success)/-1(fail)' still works, but you can be - more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the - swig errors code. - - Finally, if the SWIG_CASTRANK_MODE is enabled, the result code - allows to return the 'cast rank', for example, if you have this - - int food(double) - int fooi(int); - - and you call - - food(1) // cast rank '1' (1 -> 1.0) - fooi(1) // cast rank '0' - - just use the SWIG_AddCast()/SWIG_CheckState() - - - */ -#define SWIG_OK (0) -#define SWIG_ERROR (-1) -#define SWIG_IsOK(r) (r >= 0) -#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) - -/* The CastRankLimit says how many bits are used for the cast rank */ -#define SWIG_CASTRANKLIMIT (1 << 8) -/* The NewMask denotes the object was created (using new/malloc) */ -#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) -/* The TmpMask is for in/out typemaps that use temporal objects */ -#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) -/* Simple returning values */ -#define SWIG_BADOBJ (SWIG_ERROR) -#define SWIG_OLDOBJ (SWIG_OK) -#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) -#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) -/* Check, add and del mask methods */ -#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) -#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) -#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) -#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) -#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) -#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - - -/* Cast-Rank Mode */ -#if defined(SWIG_CASTRANK_MODE) -# ifndef SWIG_TypeRank -# define SWIG_TypeRank unsigned long -# endif -# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ -# define SWIG_MAXCASTRANK (2) -# endif -# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) -# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) -SWIGINTERNINLINE int SWIG_AddCast(int r) { - return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; -} -SWIGINTERNINLINE int SWIG_CheckState(int r) { - return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; -} -#else /* no cast-rank mode */ -# define SWIG_AddCast -# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) -#endif - - - - -#include <string.h> - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void *(*swig_converter_func)(void *); -typedef struct swig_type_info *(*swig_dycast_func)(void **); - -/* Structure to store inforomation on one type */ -typedef struct swig_type_info { - const char *name; /* mangled name of this type */ - const char *str; /* human readable name of this type */ - swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ - struct swig_cast_info *cast; /* linked list of types that can cast into this type */ - void *clientdata; /* language specific type data */ - int owndata; /* flag if the structure owns the clientdata */ -} swig_type_info; - -/* Structure to store a type and conversion function used for casting */ -typedef struct swig_cast_info { - swig_type_info *type; /* pointer to type that is equivalent to this type */ - swig_converter_func converter; /* function to cast the void pointers */ - struct swig_cast_info *next; /* pointer to next cast in linked list */ - struct swig_cast_info *prev; /* pointer to the previous cast */ -} swig_cast_info; - -/* Structure used to store module information - * Each module generates one structure like this, and the runtime collects - * all of these structures and stores them in a circularly linked list.*/ -typedef struct swig_module_info { - swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ - size_t size; /* Number of types in this module */ - struct swig_module_info *next; /* Pointer to next element in circularly linked list */ - swig_type_info **type_initial; /* Array of initially generated type structures */ - swig_cast_info **cast_initial; /* Array of initially generated casting structures */ - void *clientdata; /* Language specific module data */ -} swig_module_info; - -/* - Compare two type names skipping the space characters, therefore - "char*" == "char *" and "Class<int>" == "Class<int >", etc. - - Return 0 when the two name types are equivalent, as in - strncmp, but skipping ' '. -*/ -SWIGRUNTIME int -SWIG_TypeNameComp(const char *f1, const char *l1, - const char *f2, const char *l2) { - for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { - while ((*f1 == ' ') && (f1 != l1)) ++f1; - while ((*f2 == ' ') && (f2 != l2)) ++f2; - if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; - } - return (int)((l1 - f1) - (l2 - f2)); -} - -/* - Check type equivalence in a name list like <name1>|<name2>|... - Return 0 if not equal, 1 if equal -*/ -SWIGRUNTIME int -SWIG_TypeEquiv(const char *nb, const char *tb) { - int equiv = 0; - const char* te = tb + strlen(tb); - const char* ne = nb; - while (!equiv && *ne) { - for (nb = ne; *ne; ++ne) { - if (*ne == '|') break; - } - equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; - if (*ne) ++ne; - } - return equiv; -} - -/* - Check type equivalence in a name list like <name1>|<name2>|... - Return 0 if equal, -1 if nb < tb, 1 if nb > tb -*/ -SWIGRUNTIME int -SWIG_TypeCompare(const char *nb, const char *tb) { - int equiv = 0; - const char* te = tb + strlen(tb); - const char* ne = nb; - while (!equiv && *ne) { - for (nb = ne; *ne; ++ne) { - if (*ne == '|') break; - } - equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; - if (*ne) ++ne; - } - return equiv; -} - - -/* think of this as a c++ template<> or a scheme macro */ -#define SWIG_TypeCheck_Template(comparison, ty) \ - if (ty) { \ - swig_cast_info *iter = ty->cast; \ - while (iter) { \ - if (comparison) { \ - if (iter == ty->cast) return iter; \ - /* Move iter to the top of the linked list */ \ - iter->prev->next = iter->next; \ - if (iter->next) \ - iter->next->prev = iter->prev; \ - iter->next = ty->cast; \ - iter->prev = 0; \ - if (ty->cast) ty->cast->prev = iter; \ - ty->cast = iter; \ - return iter; \ - } \ - iter = iter->next; \ - } \ - } \ - return 0 - -/* - Check the typename -*/ -SWIGRUNTIME swig_cast_info * -SWIG_TypeCheck(const char *c, swig_type_info *ty) { - SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); -} - -/* Same as previous function, except strcmp is replaced with a pointer comparison */ -SWIGRUNTIME swig_cast_info * -SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { - SWIG_TypeCheck_Template(iter->type == from, into); -} - -/* - Cast a pointer up an inheritance hierarchy -*/ -SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); -} - -/* - Dynamic pointer casting. Down an inheritance hierarchy -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { - swig_type_info *lastty = ty; - if (!ty || !ty->dcast) return ty; - while (ty && (ty->dcast)) { - ty = (*ty->dcast)(ptr); - if (ty) lastty = ty; - } - return lastty; -} - -/* - Return the name associated with this type -*/ -SWIGRUNTIMEINLINE const char * -SWIG_TypeName(const swig_type_info *ty) { - return ty->name; -} - -/* - Return the pretty name associated with this type, - that is an unmangled type name in a form presentable to the user. -*/ -SWIGRUNTIME const char * -SWIG_TypePrettyName(const swig_type_info *type) { - /* The "str" field contains the equivalent pretty names of the - type, separated by vertical-bar characters. We choose - to print the last name, as it is often (?) the most - specific. */ - if (!type) return NULL; - if (type->str != NULL) { - const char *last_name = type->str; - const char *s; - for (s = type->str; *s; s++) - if (*s == '|') last_name = s+1; - return last_name; - } - else - return type->name; -} - -/* - Set the clientdata field for a type -*/ -SWIGRUNTIME void -SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { - swig_cast_info *cast = ti->cast; - /* if (ti->clientdata == clientdata) return; */ - ti->clientdata = clientdata; - - while (cast) { - if (!cast->converter) { - swig_type_info *tc = cast->type; - if (!tc->clientdata) { - SWIG_TypeClientData(tc, clientdata); - } - } - cast = cast->next; - } -} -SWIGRUNTIME void -SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { - SWIG_TypeClientData(ti, clientdata); - ti->owndata = 1; -} - -/* - Search for a swig_type_info structure only by mangled name - Search is a O(log #types) - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_MangledTypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - swig_module_info *iter = start; - do { - if (iter->size) { - register size_t l = 0; - register size_t r = iter->size - 1; - do { - /* since l+r >= 0, we can (>> 1) instead (/ 2) */ - register size_t i = (l + r) >> 1; - const char *iname = iter->types[i]->name; - if (iname) { - register int compare = strcmp(name, iname); - if (compare == 0) { - return iter->types[i]; - } else if (compare < 0) { - if (i) { - r = i - 1; - } else { - break; - } - } else if (compare > 0) { - l = i + 1; - } - } else { - break; /* should never happen */ - } - } while (l <= r); - } - iter = iter->next; - } while (iter != end); - return 0; -} - -/* - Search for a swig_type_info structure for either a mangled name or a human readable name. - It first searches the mangled names of the types, which is a O(log #types) - If a type is not found it then searches the human readable names, which is O(#types). - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - /* STEP 1: Search the name field using binary search */ - swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); - if (ret) { - return ret; - } else { - /* STEP 2: If the type hasn't been found, do a complete search - of the str field (the human readable name) */ - swig_module_info *iter = start; - do { - register size_t i = 0; - for (; i < iter->size; ++i) { - if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) - return iter->types[i]; - } - iter = iter->next; - } while (iter != end); - } - - /* neither found a match */ - return 0; -} - -/* - Pack binary data into a string -*/ -SWIGRUNTIME char * -SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - register const unsigned char *u = (unsigned char *) ptr; - register const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - register unsigned char uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} - -/* - Unpack binary data from a string -*/ -SWIGRUNTIME const char * -SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - register unsigned char *u = (unsigned char *) ptr; - register const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - register char d = *(c++); - register unsigned char uu; - if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); - else - return (char *) 0; - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); - else - return (char *) 0; - *u = uu; - } - return c; -} - -/* - Pack 'void *' into a string buffer. -*/ -SWIGRUNTIME char * -SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { - char *r = buff; - if ((2*sizeof(void *) + 2) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,&ptr,sizeof(void *)); - if (strlen(name) + 1 > (bsz - (r - buff))) return 0; - strcpy(r,name); - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - *ptr = (void *) 0; - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sizeof(void *)); -} - -SWIGRUNTIME char * -SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { - char *r = buff; - size_t lname = (name ? strlen(name) : 0); - if ((2*sz + 2 + lname) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,ptr,sz); - if (lname) { - strncpy(r,name,lname+1); - } else { - *r = 0; - } - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - memset(ptr,0,sz); - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sz); -} - -#ifdef __cplusplus -} -#endif - -/* Errors in SWIG */ -#define SWIG_UnknownError -1 -#define SWIG_IOError -2 -#define SWIG_RuntimeError -3 -#define SWIG_IndexError -4 -#define SWIG_TypeError -5 -#define SWIG_DivisionByZero -6 -#define SWIG_OverflowError -7 -#define SWIG_SyntaxError -8 -#define SWIG_ValueError -9 -#define SWIG_SystemError -10 -#define SWIG_AttributeError -11 -#define SWIG_MemoryError -12 -#define SWIG_NullReferenceError -13 - - - - -/* Add PyOS_snprintf for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 -# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) -# define PyOS_snprintf _snprintf -# else -# define PyOS_snprintf snprintf -# endif -#endif - -/* A crude PyString_FromFormat implementation for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 - -#ifndef SWIG_PYBUFFER_SIZE -# define SWIG_PYBUFFER_SIZE 1024 -#endif - -static PyObject * -PyString_FromFormat(const char *fmt, ...) { - va_list ap; - char buf[SWIG_PYBUFFER_SIZE * 2]; - int res; - va_start(ap, fmt); - res = vsnprintf(buf, sizeof(buf), fmt, ap); - va_end(ap); - return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf); -} -#endif - -/* Add PyObject_Del for old Pythons */ -#if PY_VERSION_HEX < 0x01060000 -# define PyObject_Del(op) PyMem_DEL((op)) -#endif -#ifndef PyObject_DEL -# define PyObject_DEL PyObject_Del -#endif - -/* A crude PyExc_StopIteration exception for old Pythons */ -#if PY_VERSION_HEX < 0x02020000 -# ifndef PyExc_StopIteration -# define PyExc_StopIteration PyExc_RuntimeError -# endif -# ifndef PyObject_GenericGetAttr -# define PyObject_GenericGetAttr 0 -# endif -#endif -/* Py_NotImplemented is defined in 2.1 and up. */ -#if PY_VERSION_HEX < 0x02010000 -# ifndef Py_NotImplemented -# define Py_NotImplemented PyExc_RuntimeError -# endif -#endif - - -/* A crude PyString_AsStringAndSize implementation for old Pythons */ -#if PY_VERSION_HEX < 0x02010000 -# ifndef PyString_AsStringAndSize -# define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;} -# endif -#endif - -/* PySequence_Size for old Pythons */ -#if PY_VERSION_HEX < 0x02000000 -# ifndef PySequence_Size -# define PySequence_Size PySequence_Length -# endif -#endif - - -/* PyBool_FromLong for old Pythons */ -#if PY_VERSION_HEX < 0x02030000 -static -PyObject *PyBool_FromLong(long ok) -{ - PyObject *result = ok ? Py_True : Py_False; - Py_INCREF(result); - return result; -} -#endif - -/* Py_ssize_t for old Pythons */ -/* This code is as recommended by: */ -/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ -#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) -typedef int Py_ssize_t; -# define PY_SSIZE_T_MAX INT_MAX -# define PY_SSIZE_T_MIN INT_MIN -#endif - -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - -SWIGRUNTIME PyObject* -SWIG_Python_ErrorType(int code) { - PyObject* type = 0; - switch(code) { - case SWIG_MemoryError: - type = PyExc_MemoryError; - break; - case SWIG_IOError: - type = PyExc_IOError; - break; - case SWIG_RuntimeError: - type = PyExc_RuntimeError; - break; - case SWIG_IndexError: - type = PyExc_IndexError; - break; - case SWIG_TypeError: - type = PyExc_TypeError; - break; - case SWIG_DivisionByZero: - type = PyExc_ZeroDivisionError; - break; - case SWIG_OverflowError: - type = PyExc_OverflowError; - break; - case SWIG_SyntaxError: - type = PyExc_SyntaxError; - break; - case SWIG_ValueError: - type = PyExc_ValueError; - break; - case SWIG_SystemError: - type = PyExc_SystemError; - break; - case SWIG_AttributeError: - type = PyExc_AttributeError; - break; - default: - type = PyExc_RuntimeError; - } - return type; -} - - -SWIGRUNTIME void -SWIG_Python_AddErrorMsg(const char* mesg) -{ - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - - if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); - if (value) { - PyObject *old_str = PyObject_Str(value); - PyErr_Clear(); - Py_XINCREF(type); - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); - Py_DECREF(old_str); - Py_DECREF(value); - } else { - PyErr_Format(PyExc_RuntimeError, mesg); - } -} - - - -#if defined(SWIG_PYTHON_NO_THREADS) -# if defined(SWIG_PYTHON_THREADS) -# undef SWIG_PYTHON_THREADS -# endif -#endif -#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ -# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) -# if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */ -# define SWIG_PYTHON_USE_GIL -# endif -# endif -# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ -# ifndef SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() -# endif -# ifdef __cplusplus /* C++ code */ - class SWIG_Python_Thread_Block { - bool status; - PyGILState_STATE state; - public: - void end() { if (status) { PyGILState_Release(state); status = false;} } - SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} - ~SWIG_Python_Thread_Block() { end(); } - }; - class SWIG_Python_Thread_Allow { - bool status; - PyThreadState *save; - public: - void end() { if (status) { PyEval_RestoreThread(save); status = false; }} - SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} - ~SWIG_Python_Thread_Allow() { end(); } - }; -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block -# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow -# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() -# else /* C code */ -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() -# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() -# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) -# endif -# else /* Old thread way, not implemented, user must provide it */ -# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) -# define SWIG_PYTHON_INITIALIZE_THREADS -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_END_BLOCK) -# define SWIG_PYTHON_THREAD_END_BLOCK -# endif -# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# endif -# if !defined(SWIG_PYTHON_THREAD_END_ALLOW) -# define SWIG_PYTHON_THREAD_END_ALLOW -# endif -# endif -#else /* No thread support */ -# define SWIG_PYTHON_INITIALIZE_THREADS -# define SWIG_PYTHON_THREAD_BEGIN_BLOCK -# define SWIG_PYTHON_THREAD_END_BLOCK -# define SWIG_PYTHON_THREAD_BEGIN_ALLOW -# define SWIG_PYTHON_THREAD_END_ALLOW -#endif - -/* ----------------------------------------------------------------------------- - * Python API portion that goes into the runtime - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#if 0 -} /* cc-mode */ -#endif -#endif - -/* ----------------------------------------------------------------------------- - * Constant declarations - * ----------------------------------------------------------------------------- */ - -/* Constant Types */ -#define SWIG_PY_POINTER 4 -#define SWIG_PY_BINARY 5 - -/* Constant information structure */ -typedef struct swig_const_info { - int type; - char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_const_info; - -#ifdef __cplusplus -#if 0 -{ /* cc-mode */ -#endif -} -#endif - - -/* ----------------------------------------------------------------------------- - * See the LICENSE file for information on copyright, usage and redistribution - * of SWIG, and the README file for authors - http://www.swig.org/release.html. - * - * pyrun.swg - * - * This file contains the runtime support for Python modules - * and includes code for managing global variables and pointer - * type checking. - * - * ----------------------------------------------------------------------------- */ - -/* Common SWIG API */ - -/* for raw pointers */ -#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) -#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) -#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) -#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(ptr, type, flags) -#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) -#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) -#define swig_owntype int - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Python_GetModule() -#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) -#define SWIG_NewClientData(obj) PySwigClientData_New(obj) - -#define SWIG_SetErrorObj SWIG_Python_SetErrorObj -#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg -#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) -#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) -#define SWIG_fail goto fail - - -/* Runtime API implementation */ - -/* Error manipulation */ - -SWIGINTERN void -SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetObject(errtype, obj); - Py_DECREF(obj); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -SWIGINTERN void -SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { - SWIG_PYTHON_THREAD_BEGIN_BLOCK; - PyErr_SetString(errtype, (char *) msg); - SWIG_PYTHON_THREAD_END_BLOCK; -} - -#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) - -/* Set a constant value */ - -SWIGINTERN void -SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { - PyDict_SetItemString(d, (char*) name, obj); - Py_DECREF(obj); -} - -/* Append a value to the result obj */ - -SWIGINTERN PyObject* -SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { -#if !defined(SWIG_PYTHON_OUTPUT_TUPLE) - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyList_Check(result)) { - PyObject *o2 = result; - result = PyList_New(1); - PyList_SetItem(result, 0, o2); - } - PyList_Append(result,obj); - Py_DECREF(obj); - } - return result; -#else - PyObject* o2; - PyObject* o3; - if (!result) { - result = obj; - } else if (result == Py_None) { - Py_DECREF(result); - result = obj; - } else { - if (!PyTuple_Check(result)) { - o2 = result; - result = PyTuple_New(1); - PyTuple_SET_ITEM(result, 0, o2); - } - o3 = PyTuple_New(1); - PyTuple_SET_ITEM(o3, 0, obj); - o2 = result; - result = PySequence_Concat(o2, o3); - Py_DECREF(o2); - Py_DECREF(o3); - } - return result; -#endif -} - -/* Unpack the argument tuple */ - -SWIGINTERN int -SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) -{ - if (!args) { - if (!min && !max) { - return 1; - } else { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", - name, (min == max ? "" : "at least "), (int)min); - return 0; - } - } - if (!PyTuple_Check(args)) { - PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); - return 0; - } else { - register Py_ssize_t l = PyTuple_GET_SIZE(args); - if (l < min) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at least "), (int)min, (int)l); - return 0; - } else if (l > max) { - PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", - name, (min == max ? "" : "at most "), (int)max, (int)l); - return 0; - } else { - register int i; - for (i = 0; i < l; ++i) { - objs[i] = PyTuple_GET_ITEM(args, i); - } - for (; l < max; ++l) { - objs[l] = 0; - } - return i + 1; - } - } -} - -/* A functor is a function object with one single object argument */ -#if PY_VERSION_HEX >= 0x02020000 -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); -#else -#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj); -#endif - -/* - Helper for static pointer initialization for both C and C++ code, for example - static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); -*/ -#ifdef __cplusplus -#define SWIG_STATIC_POINTER(var) var -#else -#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var -#endif - -/* ----------------------------------------------------------------------------- - * Pointer declarations - * ----------------------------------------------------------------------------- */ - -/* Flags for new pointer objects */ -#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) -#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) - -#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) - -#ifdef __cplusplus -extern "C" { -#if 0 -} /* cc-mode */ -#endif -#endif - -/* How to access Py_None */ -#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) -# ifndef SWIG_PYTHON_NO_BUILD_NONE -# ifndef SWIG_PYTHON_BUILD_NONE -# define SWIG_PYTHON_BUILD_NONE -# endif -# endif -#endif - -#ifdef SWIG_PYTHON_BUILD_NONE -# ifdef Py_None -# undef Py_None -# define Py_None SWIG_Py_None() -# endif -SWIGRUNTIMEINLINE PyObject * -_SWIG_Py_None(void) -{ - PyObject *none = Py_BuildValue((char*)""); - Py_DECREF(none); - return none; -} -SWIGRUNTIME PyObject * -SWIG_Py_None(void) -{ - static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None(); - return none; -} -#endif - -/* The python void return value */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Py_Void(void) -{ - PyObject *none = Py_None; - Py_INCREF(none); - return none; -} - -/* PySwigClientData */ - -typedef struct { - PyObject *klass; - PyObject *newraw; - PyObject *newargs; - PyObject *destroy; - int delargs; - int implicitconv; -} PySwigClientData; - -SWIGRUNTIMEINLINE int -SWIG_Python_CheckImplicit(swig_type_info *ty) -{ - PySwigClientData *data = (PySwigClientData *)ty->clientdata; - return data ? data->implicitconv : 0; -} - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_ExceptionType(swig_type_info *desc) { - PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0; - PyObject *klass = data ? data->klass : 0; - return (klass ? klass : PyExc_RuntimeError); -} - - -SWIGRUNTIME PySwigClientData * -PySwigClientData_New(PyObject* obj) -{ - if (!obj) { - return 0; - } else { - PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData)); - /* the klass element */ - data->klass = obj; - Py_INCREF(data->klass); - /* the newraw method and newargs arguments used to create a new raw instance */ - if (PyClass_Check(obj)) { - data->newraw = 0; - data->newargs = obj; - Py_INCREF(obj); - } else { -#if (PY_VERSION_HEX < 0x02020000) - data->newraw = 0; -#else - data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__"); -#endif - if (data->newraw) { - Py_INCREF(data->newraw); - data->newargs = PyTuple_New(1); - PyTuple_SetItem(data->newargs, 0, obj); - } else { - data->newargs = obj; - } - Py_INCREF(data->newargs); - } - /* the destroy method, aka as the C++ delete method */ - data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__"); - if (PyErr_Occurred()) { - PyErr_Clear(); - data->destroy = 0; - } - if (data->destroy) { - int flags; - Py_INCREF(data->destroy); - flags = PyCFunction_GET_FLAGS(data->destroy); -#ifdef METH_O - data->delargs = !(flags & (METH_O)); -#else - data->delargs = 0; -#endif - } else { - data->delargs = 0; - } - data->implicitconv = 0; - return data; - } -} - -SWIGRUNTIME void -PySwigClientData_Del(PySwigClientData* data) -{ - Py_XDECREF(data->newraw); - Py_XDECREF(data->newargs); - Py_XDECREF(data->destroy); -} - -/* =============== PySwigObject =====================*/ - -typedef struct { - PyObject_HEAD - void *ptr; - swig_type_info *ty; - int own; - PyObject *next; -} PySwigObject; - -SWIGRUNTIME PyObject * -PySwigObject_long(PySwigObject *v) -{ - return PyLong_FromVoidPtr(v->ptr); -} - -SWIGRUNTIME PyObject * -PySwigObject_format(const char* fmt, PySwigObject *v) -{ - PyObject *res = NULL; - PyObject *args = PyTuple_New(1); - if (args) { - if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) { - PyObject *ofmt = PyString_FromString(fmt); - if (ofmt) { - res = PyString_Format(ofmt,args); - Py_DECREF(ofmt); - } - Py_DECREF(args); - } - } - return res; -} - -SWIGRUNTIME PyObject * -PySwigObject_oct(PySwigObject *v) -{ - return PySwigObject_format("%o",v); -} - -SWIGRUNTIME PyObject * -PySwigObject_hex(PySwigObject *v) -{ - return PySwigObject_format("%x",v); -} - -SWIGRUNTIME PyObject * -#ifdef METH_NOARGS -PySwigObject_repr(PySwigObject *v) -#else -PySwigObject_repr(PySwigObject *v, PyObject *args) -#endif -{ - const char *name = SWIG_TypePrettyName(v->ty); - PyObject *hex = PySwigObject_hex(v); - PyObject *repr = PyString_FromFormat("<Swig Object of type '%s' at 0x%s>", name, PyString_AsString(hex)); - Py_DECREF(hex); - if (v->next) { -#ifdef METH_NOARGS - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next); -#else - PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args); -#endif - PyString_ConcatAndDel(&repr,nrep); - } - return repr; -} - -SWIGRUNTIME int -PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) -{ -#ifdef METH_NOARGS - PyObject *repr = PySwigObject_repr(v); -#else - PyObject *repr = PySwigObject_repr(v, NULL); -#endif - if (repr) { - fputs(PyString_AsString(repr), fp); - Py_DECREF(repr); - return 0; - } else { - return 1; - } -} - -SWIGRUNTIME PyObject * -PySwigObject_str(PySwigObject *v) -{ - char result[SWIG_BUFFER_SIZE]; - return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? - PyString_FromString(result) : 0; -} - -SWIGRUNTIME int -PySwigObject_compare(PySwigObject *v, PySwigObject *w) -{ - void *i = v->ptr; - void *j = w->ptr; - return (i < j) ? -1 : ((i > j) ? 1 : 0); -} - -SWIGRUNTIME PyTypeObject* _PySwigObject_type(void); - -SWIGRUNTIME PyTypeObject* -PySwigObject_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type(); - return type; -} - -SWIGRUNTIMEINLINE int -PySwigObject_Check(PyObject *op) { - return ((op)->ob_type == PySwigObject_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0); -} - -SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own); - -SWIGRUNTIME void -PySwigObject_dealloc(PyObject *v) -{ - PySwigObject *sobj = (PySwigObject *) v; - PyObject *next = sobj->next; - if (sobj->own) { - swig_type_info *ty = sobj->ty; - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; - PyObject *destroy = data ? data->destroy : 0; - if (destroy) { - /* destroy is always a VARARGS method */ - PyObject *res; - if (data->delargs) { - /* we need to create a temporal object to carry the destroy operation */ - PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0); - res = SWIG_Python_CallFunctor(destroy, tmp); - Py_DECREF(tmp); - } else { - PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); - PyObject *mself = PyCFunction_GET_SELF(destroy); - res = ((*meth)(mself, v)); - } - Py_XDECREF(res); - } else { - const char *name = SWIG_TypePrettyName(ty); -#if !defined(SWIG_PYTHON_SILENT_MEMLEAK) - printf("swig/python detected a memory leak of type '%s', no destructor found.\n", name); -#endif - } - } - Py_XDECREF(next); - PyObject_DEL(v); -} - -SWIGRUNTIME PyObject* -PySwigObject_append(PyObject* v, PyObject* next) -{ - PySwigObject *sobj = (PySwigObject *) v; -#ifndef METH_O - PyObject *tmp = 0; - if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; - next = tmp; -#endif - if (!PySwigObject_Check(next)) { - return NULL; - } - sobj->next = next; - Py_INCREF(next); - return SWIG_Py_Void(); -} - -SWIGRUNTIME PyObject* -#ifdef METH_NOARGS -PySwigObject_next(PyObject* v) -#else -PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif -{ - PySwigObject *sobj = (PySwigObject *) v; - if (sobj->next) { - Py_INCREF(sobj->next); - return sobj->next; - } else { - return SWIG_Py_Void(); - } -} - -SWIGINTERN PyObject* -#ifdef METH_NOARGS -PySwigObject_disown(PyObject *v) -#else -PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif -{ - PySwigObject *sobj = (PySwigObject *)v; - sobj->own = 0; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -#ifdef METH_NOARGS -PySwigObject_acquire(PyObject *v) -#else -PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) -#endif -{ - PySwigObject *sobj = (PySwigObject *)v; - sobj->own = SWIG_POINTER_OWN; - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject* -PySwigObject_own(PyObject *v, PyObject *args) -{ - PyObject *val = 0; -#if (PY_VERSION_HEX < 0x02020000) - if (!PyArg_ParseTuple(args,(char *)"|O:own",&val)) -#else - if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) -#endif - { - return NULL; - } - else - { - PySwigObject *sobj = (PySwigObject *)v; - PyObject *obj = PyBool_FromLong(sobj->own); - if (val) { -#ifdef METH_NOARGS - if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v); - } else { - PySwigObject_disown(v); - } -#else - if (PyObject_IsTrue(val)) { - PySwigObject_acquire(v,args); - } else { - PySwigObject_disown(v,args); - } -#endif - } - return obj; - } -} - -#ifdef METH_O -static PyMethodDef -swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_O, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_NOARGS, (char *)"returns object representation"}, - {0, 0, 0, 0} -}; -#else -static PyMethodDef -swigobject_methods[] = { - {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, - {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, - {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, - {(char *)"append", (PyCFunction)PySwigObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, - {(char *)"next", (PyCFunction)PySwigObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, - {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_VARARGS, (char *)"returns object representation"}, - {0, 0, 0, 0} -}; -#endif - -#if PY_VERSION_HEX < 0x02020000 -SWIGINTERN PyObject * -PySwigObject_getattr(PySwigObject *sobj,char *name) -{ - return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); -} -#endif - -SWIGRUNTIME PyTypeObject* -_PySwigObject_type(void) { - static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; - - static PyNumberMethods PySwigObject_as_number = { - (binaryfunc)0, /*nb_add*/ - (binaryfunc)0, /*nb_subtract*/ - (binaryfunc)0, /*nb_multiply*/ - (binaryfunc)0, /*nb_divide*/ - (binaryfunc)0, /*nb_remainder*/ - (binaryfunc)0, /*nb_divmod*/ - (ternaryfunc)0,/*nb_power*/ - (unaryfunc)0, /*nb_negative*/ - (unaryfunc)0, /*nb_positive*/ - (unaryfunc)0, /*nb_absolute*/ - (inquiry)0, /*nb_nonzero*/ - 0, /*nb_invert*/ - 0, /*nb_lshift*/ - 0, /*nb_rshift*/ - 0, /*nb_and*/ - 0, /*nb_xor*/ - 0, /*nb_or*/ - (coercion)0, /*nb_coerce*/ - (unaryfunc)PySwigObject_long, /*nb_int*/ - (unaryfunc)PySwigObject_long, /*nb_long*/ - (unaryfunc)0, /*nb_float*/ - (unaryfunc)PySwigObject_oct, /*nb_oct*/ - (unaryfunc)PySwigObject_hex, /*nb_hex*/ -#if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ -#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ -#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */ - 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ -#endif - }; - - static PyTypeObject pyswigobject_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp - = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - (char *)"PySwigObject", /* tp_name */ - sizeof(PySwigObject), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)PySwigObject_dealloc, /* tp_dealloc */ - (printfunc)PySwigObject_print, /* tp_print */ -#if PY_VERSION_HEX < 0x02020000 - (getattrfunc)PySwigObject_getattr, /* tp_getattr */ -#else - (getattrfunc)0, /* tp_getattr */ -#endif - (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigObject_compare, /* tp_compare */ - (reprfunc)PySwigObject_repr, /* tp_repr */ - &PySwigObject_as_number, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigObject_str, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigobject_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 - 0, /* tp_iter */ - 0, /* tp_iternext */ - swigobject_methods, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 - 0, /* tp_del */ -#endif -#ifdef COUNT_ALLOCS - 0,0,0,0 /* tp_alloc -> tp_next */ -#endif - }; - pyswigobject_type = tmp; - pyswigobject_type.ob_type = &PyType_Type; - type_init = 1; - } - return &pyswigobject_type; -} - -SWIGRUNTIME PyObject * -PySwigObject_New(void *ptr, swig_type_info *ty, int own) -{ - PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type()); - if (sobj) { - sobj->ptr = ptr; - sobj->ty = ty; - sobj->own = own; - sobj->next = 0; - } - return (PyObject *)sobj; -} - -/* ----------------------------------------------------------------------------- - * Implements a simple Swig Packed type, and use it instead of string - * ----------------------------------------------------------------------------- */ - -typedef struct { - PyObject_HEAD - void *pack; - swig_type_info *ty; - size_t size; -} PySwigPacked; - -SWIGRUNTIME int -PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) -{ - char result[SWIG_BUFFER_SIZE]; - fputs("<Swig Packed ", fp); - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { - fputs("at ", fp); - fputs(result, fp); - } - fputs(v->ty->name,fp); - fputs(">", fp); - return 0; -} - -SWIGRUNTIME PyObject * -PySwigPacked_repr(PySwigPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { - return PyString_FromFormat("<Swig Packed at %s%s>", result, v->ty->name); - } else { - return PyString_FromFormat("<Swig Packed %s>", v->ty->name); - } -} - -SWIGRUNTIME PyObject * -PySwigPacked_str(PySwigPacked *v) -{ - char result[SWIG_BUFFER_SIZE]; - if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ - return PyString_FromFormat("%s%s", result, v->ty->name); - } else { - return PyString_FromString(v->ty->name); - } -} - -SWIGRUNTIME int -PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w) -{ - size_t i = v->size; - size_t j = w->size; - int s = (i < j) ? -1 : ((i > j) ? 1 : 0); - return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); -} - -SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void); - -SWIGRUNTIME PyTypeObject* -PySwigPacked_type(void) { - static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type(); - return type; -} - -SWIGRUNTIMEINLINE int -PySwigPacked_Check(PyObject *op) { - return ((op)->ob_type == _PySwigPacked_type()) - || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0); -} - -SWIGRUNTIME void -PySwigPacked_dealloc(PyObject *v) -{ - if (PySwigPacked_Check(v)) { - PySwigPacked *sobj = (PySwigPacked *) v; - free(sobj->pack); - } - PyObject_DEL(v); -} - -SWIGRUNTIME PyTypeObject* -_PySwigPacked_type(void) { - static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; - static PyTypeObject pyswigpacked_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp - = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ - (char *)"PySwigPacked", /* tp_name */ - sizeof(PySwigPacked), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)PySwigPacked_dealloc, /* tp_dealloc */ - (printfunc)PySwigPacked_print, /* tp_print */ - (getattrfunc)0, /* tp_getattr */ - (setattrfunc)0, /* tp_setattr */ - (cmpfunc)PySwigPacked_compare, /* tp_compare */ - (reprfunc)PySwigPacked_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - (hashfunc)0, /* tp_hash */ - (ternaryfunc)0, /* tp_call */ - (reprfunc)PySwigPacked_str, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - swigpacked_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 - 0, /* tp_iter */ - 0, /* tp_iternext */ - 0, /* tp_methods */ - 0, /* tp_members */ - 0, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - 0, /* tp_init */ - 0, /* tp_alloc */ - 0, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 - 0, /* tp_del */ -#endif -#ifdef COUNT_ALLOCS - 0,0,0,0 /* tp_alloc -> tp_next */ -#endif - }; - pyswigpacked_type = tmp; - pyswigpacked_type.ob_type = &PyType_Type; - type_init = 1; - } - return &pyswigpacked_type; -} - -SWIGRUNTIME PyObject * -PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty) -{ - PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type()); - if (sobj) { - void *pack = malloc(size); - if (pack) { - memcpy(pack, ptr, size); - sobj->pack = pack; - sobj->ty = ty; - sobj->size = size; - } else { - PyObject_DEL((PyObject *) sobj); - sobj = 0; - } - } - return (PyObject *) sobj; -} - -SWIGRUNTIME swig_type_info * -PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size) -{ - if (PySwigPacked_Check(obj)) { - PySwigPacked *sobj = (PySwigPacked *)obj; - if (sobj->size != size) return 0; - memcpy(ptr, sobj->pack, size); - return sobj->ty; - } else { - return 0; - } -} - -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -SWIGRUNTIMEINLINE PyObject * -_SWIG_This(void) -{ - return PyString_FromString("this"); -} - -SWIGRUNTIME PyObject * -SWIG_This(void) -{ - static PyObject *SWIG_STATIC_POINTER(swig_this) = _SWIG_This(); - return swig_this; -} - -/* #define SWIG_PYTHON_SLOW_GETSET_THIS */ - -SWIGRUNTIME PySwigObject * -SWIG_Python_GetSwigThis(PyObject *pyobj) -{ - if (PySwigObject_Check(pyobj)) { - return (PySwigObject *) pyobj; - } else { - PyObject *obj = 0; -#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) - if (PyInstance_Check(pyobj)) { - obj = _PyInstance_Lookup(pyobj, SWIG_This()); - } else { - PyObject **dictptr = _PyObject_GetDictPtr(pyobj); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; - } else { -#ifdef PyWeakref_CheckProxy - if (PyWeakref_CheckProxy(pyobj)) { - PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); - return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; - } -#endif - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } - } - } -#else - obj = PyObject_GetAttr(pyobj,SWIG_This()); - if (obj) { - Py_DECREF(obj); - } else { - if (PyErr_Occurred()) PyErr_Clear(); - return 0; - } -#endif - if (obj && !PySwigObject_Check(obj)) { - /* a PyObject is called 'this', try to get the 'real this' - PySwigObject from it */ - return SWIG_Python_GetSwigThis(obj); - } - return (PySwigObject *)obj; - } -} - -/* Acquire a pointer value */ - -SWIGRUNTIME int -SWIG_Python_AcquirePtr(PyObject *obj, int own) { - if (own) { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); - if (sobj) { - int oldown = sobj->own; - sobj->own = own; - return oldown; - } - } - return 0; -} - -/* Convert a pointer value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { - if (!obj) return SWIG_ERROR; - if (obj == Py_None) { - if (ptr) *ptr = 0; - return SWIG_OK; - } else { - PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); - while (sobj) { - void *vptr = sobj->ptr; - if (ty) { - swig_type_info *to = sobj->ty; - if (to == ty) { - /* no type cast needed */ - if (ptr) *ptr = vptr; - break; - } else { - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) { - sobj = (PySwigObject *)sobj->next; - } else { - if (ptr) *ptr = SWIG_TypeCast(tc,vptr); - break; - } - } - } else { - if (ptr) *ptr = vptr; - break; - } - } - if (sobj) { - if (own) *own = sobj->own; - if (flags & SWIG_POINTER_DISOWN) { - sobj->own = 0; - } - return SWIG_OK; - } else { - int res = SWIG_ERROR; - if (flags & SWIG_POINTER_IMPLICIT_CONV) { - PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; - if (data && !data->implicitconv) { - PyObject *klass = data->klass; - if (klass) { - PyObject *impconv; - data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ - impconv = SWIG_Python_CallFunctor(klass, obj); - data->implicitconv = 0; - if (PyErr_Occurred()) { - PyErr_Clear(); - impconv = 0; - } - if (impconv) { - PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv); - if (iobj) { - void *vptr; - res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); - if (SWIG_IsOK(res)) { - if (ptr) { - *ptr = vptr; - /* transfer the ownership to 'ptr' */ - iobj->own = 0; - res = SWIG_AddCast(res); - res = SWIG_AddNewMask(res); - } else { - res = SWIG_AddCast(res); - } - } - } - Py_DECREF(impconv); - } - } - } - } - return res; - } - } -} - -/* Convert a function ptr value */ - -SWIGRUNTIME int -SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { - if (!PyCFunction_Check(obj)) { - return SWIG_ConvertPtr(obj, ptr, ty, 0); - } else { - void *vptr = 0; - - /* here we get the method pointer for callbacks */ - const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); - const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; - if (desc) { - desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; - if (!desc) return SWIG_ERROR; - } - if (ty) { - swig_cast_info *tc = SWIG_TypeCheck(desc,ty); - if (!tc) return SWIG_ERROR; - *ptr = SWIG_TypeCast(tc,vptr); - } else { - *ptr = vptr; - } - return SWIG_OK; - } -} - -/* Convert a packed value value */ - -SWIGRUNTIME int -SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { - swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz); - if (!to) return SWIG_ERROR; - if (ty) { - if (to != ty) { - /* check type cast? */ - swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); - if (!tc) return SWIG_ERROR; - } - } - return SWIG_OK; -} - -/* ----------------------------------------------------------------------------- - * Create a new pointer object - * ----------------------------------------------------------------------------- */ - -/* - Create a new instance object, whitout calling __init__, and set the - 'this' attribute. -*/ - -SWIGRUNTIME PyObject* -SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this) -{ -#if (PY_VERSION_HEX >= 0x02020000) - PyObject *inst = 0; - PyObject *newraw = data->newraw; - if (newraw) { - inst = PyObject_Call(newraw, data->newargs, NULL); - if (inst) { -#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - PyObject **dictptr = _PyObject_GetDictPtr(inst); - if (dictptr != NULL) { - PyObject *dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - PyDict_SetItem(dict, SWIG_This(), swig_this); - } - } -#else - PyObject *key = SWIG_This(); - PyObject_SetAttr(inst, key, swig_this); -#endif - } - } else { - PyObject *dict = PyDict_New(); - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); - } - return inst; -#else -#if (PY_VERSION_HEX >= 0x02010000) - PyObject *inst; - PyObject *dict = PyDict_New(); - PyDict_SetItem(dict, SWIG_This(), swig_this); - inst = PyInstance_NewRaw(data->newargs, dict); - Py_DECREF(dict); - return (PyObject *) inst; -#else - PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); - if (inst == NULL) { - return NULL; - } - inst->in_class = (PyClassObject *)data->newargs; - Py_INCREF(inst->in_class); - inst->in_dict = PyDict_New(); - if (inst->in_dict == NULL) { - Py_DECREF(inst); - return NULL; - } -#ifdef Py_TPFLAGS_HAVE_WEAKREFS - inst->in_weakreflist = NULL; -#endif -#ifdef Py_TPFLAGS_GC - PyObject_GC_Init(inst); -#endif - PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this); - return (PyObject *) inst; -#endif -#endif -} - -SWIGRUNTIME void -SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) -{ - PyObject *dict; -#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS) - PyObject **dictptr = _PyObject_GetDictPtr(inst); - if (dictptr != NULL) { - dict = *dictptr; - if (dict == NULL) { - dict = PyDict_New(); - *dictptr = dict; - } - PyDict_SetItem(dict, SWIG_This(), swig_this); - return; - } -#endif - dict = PyObject_GetAttrString(inst, (char*)"__dict__"); - PyDict_SetItem(dict, SWIG_This(), swig_this); - Py_DECREF(dict); -} - - -SWIGINTERN PyObject * -SWIG_Python_InitShadowInstance(PyObject *args) { - PyObject *obj[2]; - if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) { - return NULL; - } else { - PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]); - if (sthis) { - PySwigObject_append((PyObject*) sthis, obj[1]); - } else { - SWIG_Python_SetSwigThis(obj[0], obj[1]); - } - return SWIG_Py_Void(); - } -} - -/* Create a new pointer object */ - -SWIGRUNTIME PyObject * -SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) { - if (!ptr) { - return SWIG_Py_Void(); - } else { - int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; - PyObject *robj = PySwigObject_New(ptr, type, own); - PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0; - if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { - PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); - if (inst) { - Py_DECREF(robj); - robj = inst; - } - } - return robj; - } -} - -/* Create a new packed object */ - -SWIGRUNTIMEINLINE PyObject * -SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { - return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); -} - -/* -----------------------------------------------------------------------------* - * Get type list - * -----------------------------------------------------------------------------*/ - -#ifdef SWIG_LINK_RUNTIME -void *SWIG_ReturnGlobalTypeList(void *); -#endif - -SWIGRUNTIME swig_module_info * -SWIG_Python_GetModule(void) { - static void *type_pointer = (void *)0; - /* first check if module already created */ - if (!type_pointer) { -#ifdef SWIG_LINK_RUNTIME - type_pointer = SWIG_ReturnGlobalTypeList((void *)0); -#else - type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, - (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); - if (PyErr_Occurred()) { - PyErr_Clear(); - type_pointer = (void *)0; - } -#endif - } - return (swig_module_info *) type_pointer; -} - -#if PY_MAJOR_VERSION < 2 -/* PyModule_AddObject function was introduced in Python 2.0. The following function - is copied out of Python/modsupport.c in python version 2.3.4 */ -SWIGINTERN int -PyModule_AddObject(PyObject *m, char *name, PyObject *o) -{ - PyObject *dict; - if (!PyModule_Check(m)) { - PyErr_SetString(PyExc_TypeError, - "PyModule_AddObject() needs module as first arg"); - return SWIG_ERROR; - } - if (!o) { - PyErr_SetString(PyExc_TypeError, - "PyModule_AddObject() needs non-NULL value"); - return SWIG_ERROR; - } - - dict = PyModule_GetDict(m); - if (dict == NULL) { - /* Internal error -- modules must have a dict! */ - PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", - PyModule_GetName(m)); - return SWIG_ERROR; - } - if (PyDict_SetItemString(dict, name, o)) - return SWIG_ERROR; - Py_DECREF(o); - return SWIG_OK; -} -#endif - -SWIGRUNTIME void -SWIG_Python_DestroyModule(void *vptr) -{ - swig_module_info *swig_module = (swig_module_info *) vptr; - swig_type_info **types = swig_module->types; - size_t i; - for (i =0; i < swig_module->size; ++i) { - swig_type_info *ty = types[i]; - if (ty->owndata) { - PySwigClientData *data = (PySwigClientData *) ty->clientdata; - if (data) PySwigClientData_Del(data); - } - } - Py_DECREF(SWIG_This()); -} - -SWIGRUNTIME void -SWIG_Python_SetModule(swig_module_info *swig_module) { - static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */ - - PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, - swig_empty_runtime_method_table); - PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); - if (pointer && module) { - PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); - } else { - Py_XDECREF(pointer); - } -} - -/* The python cached type query */ -SWIGRUNTIME PyObject * -SWIG_Python_TypeCache(void) { - static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New(); - return cache; -} - -SWIGRUNTIME swig_type_info * -SWIG_Python_TypeQuery(const char *type) -{ - PyObject *cache = SWIG_Python_TypeCache(); - PyObject *key = PyString_FromString(type); - PyObject *obj = PyDict_GetItem(cache, key); - swig_type_info *descriptor; - if (obj) { - descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); - } else { - swig_module_info *swig_module = SWIG_Python_GetModule(); - descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); - if (descriptor) { - obj = PyCObject_FromVoidPtr(descriptor, NULL); - PyDict_SetItem(cache, key, obj); - Py_DECREF(obj); - } - } - Py_DECREF(key); - return descriptor; -} - -/* - For backward compatibility only -*/ -#define SWIG_POINTER_EXCEPTION 0 -#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) -#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) - -SWIGRUNTIME int -SWIG_Python_AddErrMesg(const char* mesg, int infront) -{ - if (PyErr_Occurred()) { - PyObject *type = 0; - PyObject *value = 0; - PyObject *traceback = 0; - PyErr_Fetch(&type, &value, &traceback); - if (value) { - PyObject *old_str = PyObject_Str(value); - Py_XINCREF(type); - PyErr_Clear(); - if (infront) { - PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str)); - } else { - PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); - } - Py_DECREF(old_str); - } - return 1; - } else { - return 0; - } -} - -SWIGRUNTIME int -SWIG_Python_ArgFail(int argnum) -{ - if (PyErr_Occurred()) { - /* add information about failing argument */ - char mesg[256]; - PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); - return SWIG_Python_AddErrMesg(mesg, 1); - } else { - return 0; - } -} - -SWIGRUNTIMEINLINE const char * -PySwigObject_GetDesc(PyObject *self) -{ - PySwigObject *v = (PySwigObject *)self; - swig_type_info *ty = v ? v->ty : 0; - return ty ? ty->str : (char*)""; -} - -SWIGRUNTIME void -SWIG_Python_TypeError(const char *type, PyObject *obj) -{ - if (type) { -#if defined(SWIG_COBJECT_TYPES) - if (obj && PySwigObject_Check(obj)) { - const char *otype = (const char *) PySwigObject_GetDesc(obj); - if (otype) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received", - type, otype); - return; - } - } else -#endif - { - const char *otype = (obj ? obj->ob_type->tp_name : 0); - if (otype) { - PyObject *str = PyObject_Str(obj); - const char *cstr = str ? PyString_AsString(str) : 0; - if (cstr) { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", - type, otype, cstr); - } else { - PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", - type, otype); - } - Py_XDECREF(str); - return; - } - } - PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); - } else { - PyErr_Format(PyExc_TypeError, "unexpected type is received"); - } -} - - -/* Convert a pointer value, signal an exception on a type mismatch */ -SWIGRUNTIME void * -SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) { - void *result; - if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { - PyErr_Clear(); - if (flags & SWIG_POINTER_EXCEPTION) { - SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); - SWIG_Python_ArgFail(argnum); - } - } - return result; -} - - -#ifdef __cplusplus -#if 0 -{ /* cc-mode */ -#endif -} -#endif - - - -#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) - -#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else - - - -/* -------- TYPES TABLE (BEGIN) -------- */ - -#define SWIGTYPE_p_Brush swig_types[0] -#define SWIGTYPE_p_BrushPreview swig_types[1] -#define SWIGTYPE_p_BrushType swig_types[2] -#define SWIGTYPE_p_ByteBuffer swig_types[3] -#define SWIGTYPE_p_Canvas swig_types[4] -#define SWIGTYPE_p_Color swig_types[5] -#define SWIGTYPE_p_DRW_Command swig_types[6] -#define SWIGTYPE_p_DRW_Header swig_types[7] -#define SWIGTYPE_p_DrawCommand swig_types[8] -#define SWIGTYPE_p_DrawCommandBuffer swig_types[9] -#define SWIGTYPE_p_GdkImage swig_types[10] -#define SWIGTYPE_p_GstBuffer swig_types[11] -#define SWIGTYPE_p_Palette swig_types[12] -#define SWIGTYPE_p_Pos swig_types[13] -#define SWIGTYPE_p_SurfaceA8R8G8B8 swig_types[14] -#define SWIGTYPE_p_a_BrushType__BRUSH_TABLE_HEIGHT__unsigned_char swig_types[15] -#define SWIGTYPE_p_a_BrushType__DIST_TABLE_WIDTH__unsigned_char swig_types[16] -#define SWIGTYPE_p_char swig_types[17] -#define SWIGTYPE_p_float swig_types[18] -#define SWIGTYPE_p_p_DRW_Command swig_types[19] -#define SWIGTYPE_p_p_unsigned_int swig_types[20] -#define SWIGTYPE_p_uint32_t swig_types[21] -#define SWIGTYPE_p_unsigned_char swig_types[22] -#define SWIGTYPE_p_unsigned_int swig_types[23] -#define SWIGTYPE_p_unsigned_short swig_types[24] -#define SWIGTYPE_p_vectorTDrawCommand_t swig_types[25] -#define SWIGTYPE_p_void swig_types[26] -static swig_type_info *swig_types[28]; -static swig_module_info swig_module = {swig_types, 27, 0, 0, 0, 0}; -#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) -#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) - -/* -------- TYPES TABLE (END) -------- */ - -#if (PY_VERSION_HEX <= 0x02000000) -# if !defined(SWIG_PYTHON_CLASSIC) -# error "This python version requires swig to be run with the '-classic' option" -# endif -#endif - -/*----------------------------------------------- - @(target):= _colorsc.so - ------------------------------------------------*/ -#define SWIG_init init_colorsc - -#define SWIG_name "_colorsc" - -#define SWIGVERSION 0x010333 -#define SWIG_VERSION SWIGVERSION - - -#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) -#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) - - -#include <stdexcept> - - -namespace swig { - class PyObject_ptr { - protected: - PyObject *_obj; - - public: - PyObject_ptr() :_obj(0) - { - } - - PyObject_ptr(const PyObject_ptr& item) : _obj(item._obj) - { - Py_XINCREF(_obj); - } - - PyObject_ptr(PyObject *obj, bool initial_ref = true) :_obj(obj) - { - if (initial_ref) Py_XINCREF(_obj); - } - - PyObject_ptr & operator=(const PyObject_ptr& item) - { - Py_XINCREF(item._obj); - Py_XDECREF(_obj); - _obj = item._obj; - return *this; - } - - ~PyObject_ptr() - { - Py_XDECREF(_obj); - } - - operator PyObject *() const - { - return _obj; - } - - PyObject *operator->() const - { - return _obj; - } - }; -} - - -namespace swig { - struct PyObject_var : PyObject_ptr { - PyObject_var(PyObject* obj = 0) : PyObject_ptr(obj, false) { } - - PyObject_var & operator = (PyObject* obj) - { - Py_XDECREF(_obj); - _obj = obj; - return *this; - } - }; -} - - -#include "canvas.h" -#include "palette.h" - - - #define SWIG_From_double PyFloat_FromDouble - - -SWIGINTERNINLINE PyObject * -SWIG_From_float (float value) -{ - return SWIG_From_double (value); -} - - -#include <float.h> - - -SWIGINTERN int -SWIG_AsVal_double (PyObject *obj, double *val) -{ - int res = SWIG_TypeError; - if (PyFloat_Check(obj)) { - if (val) *val = PyFloat_AsDouble(obj); - return SWIG_OK; - } else if (PyInt_Check(obj)) { - if (val) *val = PyInt_AsLong(obj); - return SWIG_OK; - } else if (PyLong_Check(obj)) { - double v = PyLong_AsDouble(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - double d = PyFloat_AsDouble(obj); - if (!PyErr_Occurred()) { - if (val) *val = d; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - long v = PyLong_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_AddCast(SWIG_OK)); - } else { - PyErr_Clear(); - } - } - } -#endif - return res; -} - - -SWIGINTERN int -SWIG_AsVal_float (PyObject * obj, float *val) -{ - double v; - int res = SWIG_AsVal_double (obj, &v); - if (SWIG_IsOK(res)) { - if ((v < -FLT_MAX || v > FLT_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< float >(v); - } - } - return res; -} - - -#include <math.h> - - -SWIGINTERNINLINE int -SWIG_CanCastAsInteger(double *d, double min, double max) { - double x = *d; - if ((min <= x && x <= max)) { - double fx = floor(x); - double cx = ceil(x); - double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ - if ((errno == EDOM) || (errno == ERANGE)) { - errno = 0; - } else { - double summ, reps, diff; - if (rd < x) { - diff = x - rd; - } else if (rd > x) { - diff = rd - x; - } else { - return 1; - } - summ = rd + x; - reps = diff/summ; - if (reps < 8*DBL_EPSILON) { - *d = rd; - return 1; - } - } - } - return 0; -} - - -SWIGINTERN int -SWIG_AsVal_long (PyObject *obj, long* val) -{ - if (PyInt_Check(obj)) { - if (val) *val = PyInt_AsLong(obj); - return SWIG_OK; - } else if (PyLong_Check(obj)) { - long v = PyLong_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - long v = PyInt_AsLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { - if (val) *val = (long)(d); - return res; - } - } - } -#endif - return SWIG_TypeError; -} - - -SWIGINTERN int -SWIG_AsVal_bool (PyObject *obj, bool *val) -{ - int r = PyObject_IsTrue(obj); - if (r == -1) - return SWIG_ERROR; - if (val) *val = r ? true : false; - return SWIG_OK; -} - - -#include <limits.h> -#if !defined(SWIG_NO_LLONG_MAX) -# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) -# define LLONG_MAX __LONG_LONG_MAX__ -# define LLONG_MIN (-LLONG_MAX - 1LL) -# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) -# endif -#endif - - -SWIGINTERN int -SWIG_AsVal_int (PyObject * obj, int *val) -{ - long v; - int res = SWIG_AsVal_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v < INT_MIN || v > INT_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< int >(v); - } - } - return res; -} - - - #define SWIG_From_long PyInt_FromLong - - -SWIGINTERNINLINE PyObject * -SWIG_From_int (int value) -{ - return SWIG_From_long (value); -} - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) -{ - if (PyInt_Check(obj)) { - long v = PyInt_AsLong(obj); - if (v >= 0) { - if (val) *val = v; - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else if (PyLong_Check(obj)) { - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_OK; - } else { - PyErr_Clear(); - } - } -#ifdef SWIG_PYTHON_CAST_MODE - { - int dispatch = 0; - unsigned long v = PyLong_AsUnsignedLong(obj); - if (!PyErr_Occurred()) { - if (val) *val = v; - return SWIG_AddCast(SWIG_OK); - } else { - PyErr_Clear(); - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { - if (val) *val = (unsigned long)(d); - return res; - } - } - } -#endif - return SWIG_TypeError; -} - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val) -{ - unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v > USHRT_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< unsigned short >(v); - } - } - return res; -} - - -SWIGINTERNINLINE PyObject* -SWIG_From_unsigned_SS_long (unsigned long value) -{ - return (value > LONG_MAX) ? - PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value)); -} - - -SWIGINTERNINLINE PyObject * -SWIG_From_unsigned_SS_short (unsigned short value) -{ - return SWIG_From_unsigned_SS_long (value); -} - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_char (PyObject * obj, unsigned char *val) -{ - unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v > UCHAR_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< unsigned char >(v); - } - } - return res; -} - - -SWIGINTERNINLINE PyObject * -SWIG_From_unsigned_SS_char (unsigned char value) -{ - return SWIG_From_unsigned_SS_long (value); -} - - -SWIGINTERNINLINE PyObject * -SWIG_From_unsigned_SS_int (unsigned int value) -{ - return SWIG_From_unsigned_SS_long (value); -} - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val) -{ - unsigned long v; - int res = SWIG_AsVal_unsigned_SS_long (obj, &v); - if (SWIG_IsOK(res)) { - if ((v > UINT_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< unsigned int >(v); - } - } - return res; -} - - -SWIGINTERN swig_type_info* -SWIG_pchar_descriptor(void) -{ - static int init = 0; - static swig_type_info* info = 0; - if (!init) { - info = SWIG_TypeQuery("_p_char"); - init = 1; - } - return info; -} - - -SWIGINTERN int -SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) -{ - if (PyString_Check(obj)) { - char *cstr; Py_ssize_t len; - PyString_AsStringAndSize(obj, &cstr, &len); - if (cptr) { - if (alloc) { - /* - In python the user should not be able to modify the inner - string representation. To warranty that, if you define - SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string - buffer is always returned. - - The default behavior is just to return the pointer value, - so, be careful. - */ -#if defined(SWIG_PYTHON_SAFE_CSTRINGS) - if (*alloc != SWIG_OLDOBJ) -#else - if (*alloc == SWIG_NEWOBJ) -#endif - { - *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1))); - *alloc = SWIG_NEWOBJ; - } - else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } else { - *cptr = PyString_AsString(obj); - } - } - if (psize) *psize = len + 1; - return SWIG_OK; - } else { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - void* vptr = 0; - if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = (char *) vptr; - if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} - - - - - -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - return pchar_descriptor ? - SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void(); - } else { - return PyString_FromStringAndSize(carray, static_cast< int >(size)); - } - } else { - return SWIG_Py_Void(); - } -} - - -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtr(const char *cptr) -{ - return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); -} - - -SWIGINTERNINLINE PyObject* - SWIG_From_bool (bool value) -{ - return PyBool_FromLong(value ? 1 : 0); -} - -#ifdef __cplusplus -extern "C" { -#endif -SWIGINTERN int Swig_var_PI_set(PyObject *) { - SWIG_Error(SWIG_AttributeError,"Variable PI is read-only."); - return 1; -} - - -SWIGINTERN PyObject *Swig_var_PI_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_From_float(static_cast< float >(PI)); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_sgn(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float arg1 ; - float result; - float val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:sgn",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_float(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "sgn" "', argument " "1"" of type '" "float""'"); - } - arg1 = static_cast< float >(val1); - result = (float)sgn(arg1); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float arg1 ; - float result; - float val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:sqr",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_float(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "sqr" "', argument " "1"" of type '" "float""'"); - } - arg1 = static_cast< float >(val1); - result = (float)sqr(arg1); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_clamp(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float arg1 ; - float arg2 ; - float arg3 ; - float result; - float val1 ; - int ecode1 = 0 ; - float val2 ; - int ecode2 = 0 ; - float val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:clamp",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_float(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "clamp" "', argument " "1"" of type '" "float""'"); - } - arg1 = static_cast< float >(val1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "clamp" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "clamp" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - result = (float)clamp(arg1,arg2,arg3); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_to_rad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float arg1 ; - float result; - float val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:to_rad",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_float(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "to_rad" "', argument " "1"" of type '" "float""'"); - } - arg1 = static_cast< float >(val1); - result = (float)to_rad(arg1); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_to_deg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float arg1 ; - float result; - float val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:to_deg",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_float(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "to_deg" "', argument " "1"" of type '" "float""'"); - } - arg1 = static_cast< float >(val1); - result = (float)to_deg(arg1); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_map_range__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float arg1 ; - float arg2 ; - float arg3 ; - float arg4 ; - float arg5 ; - bool arg6 ; - float result; - float val1 ; - int ecode1 = 0 ; - float val2 ; - int ecode2 = 0 ; - float val3 ; - int ecode3 = 0 ; - float val4 ; - int ecode4 = 0 ; - float val5 ; - int ecode5 = 0 ; - bool val6 ; - int ecode6 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOO:map_range",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; - ecode1 = SWIG_AsVal_float(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "map_range" "', argument " "1"" of type '" "float""'"); - } - arg1 = static_cast< float >(val1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "map_range" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "map_range" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - ecode4 = SWIG_AsVal_float(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "map_range" "', argument " "4"" of type '" "float""'"); - } - arg4 = static_cast< float >(val4); - ecode5 = SWIG_AsVal_float(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "map_range" "', argument " "5"" of type '" "float""'"); - } - arg5 = static_cast< float >(val5); - ecode6 = SWIG_AsVal_bool(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "map_range" "', argument " "6"" of type '" "bool""'"); - } - arg6 = static_cast< bool >(val6); - result = (float)map_range(arg1,arg2,arg3,arg4,arg5,arg6); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_map_range__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float arg1 ; - float arg2 ; - float arg3 ; - float arg4 ; - float arg5 ; - float result; - float val1 ; - int ecode1 = 0 ; - float val2 ; - int ecode2 = 0 ; - float val3 ; - int ecode3 = 0 ; - float val4 ; - int ecode4 = 0 ; - float val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:map_range",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - ecode1 = SWIG_AsVal_float(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "map_range" "', argument " "1"" of type '" "float""'"); - } - arg1 = static_cast< float >(val1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "map_range" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "map_range" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - ecode4 = SWIG_AsVal_float(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "map_range" "', argument " "4"" of type '" "float""'"); - } - arg4 = static_cast< float >(val4); - ecode5 = SWIG_AsVal_float(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "map_range" "', argument " "5"" of type '" "float""'"); - } - arg5 = static_cast< float >(val5); - result = (float)map_range(arg1,arg2,arg3,arg4,arg5); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_map_range(PyObject *self, PyObject *args) { - int argc; - PyObject *argv[7]; - int ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = (int)PyObject_Length(args); - for (ii = 0; (ii < argc) && (ii < 6); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 5) { - int _v; - { - int res = SWIG_AsVal_float(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_float(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_float(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_float(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_float(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_map_range__SWIG_1(self, args); - } - } - } - } - } - } - if (argc == 6) { - int _v; - { - int res = SWIG_AsVal_float(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_float(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_float(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_float(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_float(argv[4], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_bool(argv[5], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_map_range__SWIG_0(self, args); - } - } - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'map_range'.\n Possible C/C++ prototypes are:\n"" map_range(float,float,float,float,float,bool)\n"" map_range(float,float,float,float,float)\n"); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_fixed_scale(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int result; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:fixed_scale",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "fixed_scale" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "fixed_scale" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (int)fixed_scale(arg1,arg2); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_endian_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - unsigned short arg1 ; - unsigned short result; - unsigned short val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:endian_swap",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_unsigned_SS_short(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "endian_swap" "', argument " "1"" of type '" "unsigned short""'"); - } - arg1 = static_cast< unsigned short >(val1); - result = (unsigned short)endian_swap(arg1); - resultobj = SWIG_From_unsigned_SS_short(static_cast< unsigned short >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Pos_x_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Pos *arg1 = (Pos *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Pos_x_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Pos_x_set" "', argument " "1"" of type '" "Pos *""'"); - } - arg1 = reinterpret_cast< Pos * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Pos_x_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->x = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Pos_x_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Pos *arg1 = (Pos *) 0 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Pos_x_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Pos_x_get" "', argument " "1"" of type '" "Pos *""'"); - } - arg1 = reinterpret_cast< Pos * >(argp1); - result = (float) ((arg1)->x); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Pos_y_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Pos *arg1 = (Pos *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Pos_y_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Pos_y_set" "', argument " "1"" of type '" "Pos *""'"); - } - arg1 = reinterpret_cast< Pos * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Pos_y_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->y = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Pos_y_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Pos *arg1 = (Pos *) 0 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Pos_y_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Pos_y_get" "', argument " "1"" of type '" "Pos *""'"); - } - arg1 = reinterpret_cast< Pos * >(argp1); - result = (float) ((arg1)->y); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Pos__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Pos *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_Pos")) SWIG_fail; - result = (Pos *)new Pos(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pos, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Pos__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float arg1 ; - float arg2 ; - Pos *result = 0 ; - float val1 ; - int ecode1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_Pos",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_float(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Pos" "', argument " "1"" of type '" "float""'"); - } - arg1 = static_cast< float >(val1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Pos" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - result = (Pos *)new Pos(arg1,arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pos, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Pos(PyObject *self, PyObject *args) { - int argc; - PyObject *argv[3]; - int ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = (int)PyObject_Length(args); - for (ii = 0; (ii < argc) && (ii < 2); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_Pos__SWIG_0(self, args); - } - if (argc == 2) { - int _v; - { - int res = SWIG_AsVal_float(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_float(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_Pos__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_Pos'.\n Possible C/C++ prototypes are:\n"" Pos()\n"" Pos(float,float)\n"); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Pos___add__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Pos *arg1 = (Pos *) 0 ; - Pos *arg2 = 0 ; - Pos result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Pos___add__",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Pos___add__" "', argument " "1"" of type '" "Pos const *""'"); - } - arg1 = reinterpret_cast< Pos * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Pos___add__" "', argument " "2"" of type '" "Pos const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Pos___add__" "', argument " "2"" of type '" "Pos const &""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - result = ((Pos const *)arg1)->operator +((Pos const &)*arg2); - resultobj = SWIG_NewPointerObj((new Pos(static_cast< const Pos& >(result))), SWIGTYPE_p_Pos, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Pos___sub__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Pos *arg1 = (Pos *) 0 ; - Pos *arg2 = 0 ; - Pos result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Pos___sub__",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Pos___sub__" "', argument " "1"" of type '" "Pos const *""'"); - } - arg1 = reinterpret_cast< Pos * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Pos___sub__" "', argument " "2"" of type '" "Pos const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Pos___sub__" "', argument " "2"" of type '" "Pos const &""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - result = ((Pos const *)arg1)->operator -((Pos const &)*arg2); - resultobj = SWIG_NewPointerObj((new Pos(static_cast< const Pos& >(result))), SWIGTYPE_p_Pos, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Pos___mul____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Pos *arg1 = (Pos *) 0 ; - Pos *arg2 = 0 ; - Pos result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Pos___mul__",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Pos___mul__" "', argument " "1"" of type '" "Pos const *""'"); - } - arg1 = reinterpret_cast< Pos * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Pos___mul__" "', argument " "2"" of type '" "Pos const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Pos___mul__" "', argument " "2"" of type '" "Pos const &""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - result = ((Pos const *)arg1)->operator *((Pos const &)*arg2); - resultobj = SWIG_NewPointerObj((new Pos(static_cast< const Pos& >(result))), SWIGTYPE_p_Pos, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Pos___div____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Pos *arg1 = (Pos *) 0 ; - Pos *arg2 = 0 ; - Pos result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Pos___div__",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Pos___div__" "', argument " "1"" of type '" "Pos const *""'"); - } - arg1 = reinterpret_cast< Pos * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Pos___div__" "', argument " "2"" of type '" "Pos const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Pos___div__" "', argument " "2"" of type '" "Pos const &""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - result = ((Pos const *)arg1)->operator /((Pos const &)*arg2); - resultobj = SWIG_NewPointerObj((new Pos(static_cast< const Pos& >(result))), SWIGTYPE_p_Pos, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Pos___mul____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Pos *arg1 = (Pos *) 0 ; - float arg2 ; - Pos result; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Pos___mul__",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Pos___mul__" "', argument " "1"" of type '" "Pos const *""'"); - } - arg1 = reinterpret_cast< Pos * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Pos___mul__" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - result = ((Pos const *)arg1)->operator *(arg2); - resultobj = SWIG_NewPointerObj((new Pos(static_cast< const Pos& >(result))), SWIGTYPE_p_Pos, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Pos___mul__(PyObject *self, PyObject *args) { - int argc; - PyObject *argv[3]; - int ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = (int)PyObject_Length(args); - for (ii = 0; (ii < argc) && (ii < 2); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Pos, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_Pos, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Pos___mul____SWIG_0(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Pos, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_float(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_Pos___mul____SWIG_1(self, args); - } - } - } - -fail: - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; -} - - -SWIGINTERN PyObject *_wrap_Pos___div____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Pos *arg1 = (Pos *) 0 ; - float arg2 ; - Pos result; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Pos___div__",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Pos___div__" "', argument " "1"" of type '" "Pos const *""'"); - } - arg1 = reinterpret_cast< Pos * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Pos___div__" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - result = ((Pos const *)arg1)->operator /(arg2); - resultobj = SWIG_NewPointerObj((new Pos(static_cast< const Pos& >(result))), SWIGTYPE_p_Pos, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Pos___div__(PyObject *self, PyObject *args) { - int argc; - PyObject *argv[3]; - int ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = (int)PyObject_Length(args); - for (ii = 0; (ii < argc) && (ii < 2); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Pos, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_Pos, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_Pos___div____SWIG_0(self, args); - } - } - } - if (argc == 2) { - int _v; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Pos, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_float(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_Pos___div____SWIG_1(self, args); - } - } - } - -fail: - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; -} - - -SWIGINTERN PyObject *_wrap_Pos_create_from_min(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Pos *arg1 = 0 ; - Pos *arg2 = 0 ; - Pos result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Pos_create_from_min",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Pos_create_from_min" "', argument " "1"" of type '" "Pos const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Pos_create_from_min" "', argument " "1"" of type '" "Pos const &""'"); - } - arg1 = reinterpret_cast< Pos * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Pos_create_from_min" "', argument " "2"" of type '" "Pos const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Pos_create_from_min" "', argument " "2"" of type '" "Pos const &""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - result = Pos::create_from_min((Pos const &)*arg1,(Pos const &)*arg2); - resultobj = SWIG_NewPointerObj((new Pos(static_cast< const Pos& >(result))), SWIGTYPE_p_Pos, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Pos_create_from_max(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Pos *arg1 = 0 ; - Pos *arg2 = 0 ; - Pos result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Pos_create_from_max",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Pos_create_from_max" "', argument " "1"" of type '" "Pos const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Pos_create_from_max" "', argument " "1"" of type '" "Pos const &""'"); - } - arg1 = reinterpret_cast< Pos * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Pos_create_from_max" "', argument " "2"" of type '" "Pos const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Pos_create_from_max" "', argument " "2"" of type '" "Pos const &""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - result = Pos::create_from_max((Pos const &)*arg1,(Pos const &)*arg2); - resultobj = SWIG_NewPointerObj((new Pos(static_cast< const Pos& >(result))), SWIGTYPE_p_Pos, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Pos_create_from_angle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float arg1 ; - float arg2 ; - Pos result; - float val1 ; - int ecode1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Pos_create_from_angle",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_float(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Pos_create_from_angle" "', argument " "1"" of type '" "float""'"); - } - arg1 = static_cast< float >(val1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Pos_create_from_angle" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - result = Pos::create_from_angle(arg1,arg2); - resultobj = SWIG_NewPointerObj((new Pos(static_cast< const Pos& >(result))), SWIGTYPE_p_Pos, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Pos_create_from_rotation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Pos *arg1 = 0 ; - Pos *arg2 = 0 ; - float arg3 ; - Pos result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - float val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Pos_create_from_rotation",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Pos_create_from_rotation" "', argument " "1"" of type '" "Pos const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Pos_create_from_rotation" "', argument " "1"" of type '" "Pos const &""'"); - } - arg1 = reinterpret_cast< Pos * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Pos_create_from_rotation" "', argument " "2"" of type '" "Pos const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Pos_create_from_rotation" "', argument " "2"" of type '" "Pos const &""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Pos_create_from_rotation" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - result = Pos::create_from_rotation((Pos const &)*arg1,(Pos const &)*arg2,arg3); - resultobj = SWIG_NewPointerObj((new Pos(static_cast< const Pos& >(result))), SWIGTYPE_p_Pos, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_Pos(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Pos *arg1 = (Pos *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_Pos",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Pos, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Pos" "', argument " "1"" of type '" "Pos *""'"); - } - arg1 = reinterpret_cast< Pos * >(argp1); - delete arg1; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Pos_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_Pos, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_Color_r_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Color *arg1 = (Color *) 0 ; - unsigned char arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Color_r_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Color, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Color_r_set" "', argument " "1"" of type '" "Color *""'"); - } - arg1 = reinterpret_cast< Color * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Color_r_set" "', argument " "2"" of type '" "unsigned char""'"); - } - arg2 = static_cast< unsigned char >(val2); - if (arg1) (arg1)->r = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_r_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Color *arg1 = (Color *) 0 ; - unsigned char result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Color_r_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Color, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Color_r_get" "', argument " "1"" of type '" "Color *""'"); - } - arg1 = reinterpret_cast< Color * >(argp1); - result = (unsigned char) ((arg1)->r); - resultobj = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_g_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Color *arg1 = (Color *) 0 ; - unsigned char arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Color_g_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Color, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Color_g_set" "', argument " "1"" of type '" "Color *""'"); - } - arg1 = reinterpret_cast< Color * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Color_g_set" "', argument " "2"" of type '" "unsigned char""'"); - } - arg2 = static_cast< unsigned char >(val2); - if (arg1) (arg1)->g = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_g_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Color *arg1 = (Color *) 0 ; - unsigned char result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Color_g_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Color, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Color_g_get" "', argument " "1"" of type '" "Color *""'"); - } - arg1 = reinterpret_cast< Color * >(argp1); - result = (unsigned char) ((arg1)->g); - resultobj = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_b_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Color *arg1 = (Color *) 0 ; - unsigned char arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Color_b_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Color, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Color_b_set" "', argument " "1"" of type '" "Color *""'"); - } - arg1 = reinterpret_cast< Color * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Color_b_set" "', argument " "2"" of type '" "unsigned char""'"); - } - arg2 = static_cast< unsigned char >(val2); - if (arg1) (arg1)->b = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_b_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Color *arg1 = (Color *) 0 ; - unsigned char result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Color_b_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Color, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Color_b_get" "', argument " "1"" of type '" "Color *""'"); - } - arg1 = reinterpret_cast< Color * >(argp1); - result = (unsigned char) ((arg1)->b); - resultobj = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_a_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Color *arg1 = (Color *) 0 ; - unsigned char arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Color_a_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Color, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Color_a_set" "', argument " "1"" of type '" "Color *""'"); - } - arg1 = reinterpret_cast< Color * >(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Color_a_set" "', argument " "2"" of type '" "unsigned char""'"); - } - arg2 = static_cast< unsigned char >(val2); - if (arg1) (arg1)->a = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_a_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Color *arg1 = (Color *) 0 ; - unsigned char result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Color_a_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Color, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Color_a_get" "', argument " "1"" of type '" "Color *""'"); - } - arg1 = reinterpret_cast< Color * >(argp1); - result = (unsigned char) ((arg1)->a); - resultobj = SWIG_From_unsigned_SS_char(static_cast< unsigned char >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Color__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Color *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_Color")) SWIG_fail; - result = (Color *)new Color(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Color, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Color__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - int arg3 ; - int arg4 ; - Color *result = 0 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:new_Color",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Color" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Color" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_Color" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_Color" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - result = (Color *)new Color(arg1,arg2,arg3,arg4); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Color, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Color(PyObject *self, PyObject *args) { - int argc; - PyObject *argv[5]; - int ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = (int)PyObject_Length(args); - for (ii = 0; (ii < argc) && (ii < 4); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_Color__SWIG_0(self, args); - } - if (argc == 4) { - int _v; - { - int res = SWIG_AsVal_int(argv[0], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_int(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_Color__SWIG_1(self, args); - } - } - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_Color'.\n Possible C/C++ prototypes are:\n"" Color()\n"" Color(int,int,int,int)\n"); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_get_a8r8g8b8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Color *arg1 = (Color *) 0 ; - unsigned int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Color_get_a8r8g8b8",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Color, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Color_get_a8r8g8b8" "', argument " "1"" of type '" "Color *""'"); - } - arg1 = reinterpret_cast< Color * >(argp1); - result = (unsigned int)(arg1)->get_a8r8g8b8(); - resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_create_from_a8r8g8b8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - unsigned int arg1 ; - Color result; - unsigned int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Color_create_from_a8r8g8b8",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Color_create_from_a8r8g8b8" "', argument " "1"" of type '" "unsigned int""'"); - } - arg1 = static_cast< unsigned int >(val1); - result = Color::create_from_a8r8g8b8(arg1); - resultobj = SWIG_NewPointerObj((new Color(static_cast< const Color& >(result))), SWIGTYPE_p_Color, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_get_a8b8g8r8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Color *arg1 = (Color *) 0 ; - unsigned int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Color_get_a8b8g8r8",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Color, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Color_get_a8b8g8r8" "', argument " "1"" of type '" "Color *""'"); - } - arg1 = reinterpret_cast< Color * >(argp1); - result = (unsigned int)(arg1)->get_a8b8g8r8(); - resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_create_from_a8b8g8r8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - unsigned int arg1 ; - Color result; - unsigned int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Color_create_from_a8b8g8r8",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Color_create_from_a8b8g8r8" "', argument " "1"" of type '" "unsigned int""'"); - } - arg1 = static_cast< unsigned int >(val1); - result = Color::create_from_a8b8g8r8(arg1); - resultobj = SWIG_NewPointerObj((new Color(static_cast< const Color& >(result))), SWIGTYPE_p_Color, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_get_r5g6b5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Color *arg1 = (Color *) 0 ; - unsigned int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Color_get_r5g6b5",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Color, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Color_get_r5g6b5" "', argument " "1"" of type '" "Color *""'"); - } - arg1 = reinterpret_cast< Color * >(argp1); - result = (unsigned int)(arg1)->get_r5g6b5(); - resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_create_from_r5g6b5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - unsigned short arg1 ; - Color result; - unsigned short val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Color_create_from_r5g6b5",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_unsigned_SS_short(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Color_create_from_r5g6b5" "', argument " "1"" of type '" "unsigned short""'"); - } - arg1 = static_cast< unsigned short >(val1); - result = Color::create_from_r5g6b5(arg1); - resultobj = SWIG_NewPointerObj((new Color(static_cast< const Color& >(result))), SWIGTYPE_p_Color, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_get_b5g6r5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Color *arg1 = (Color *) 0 ; - unsigned int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Color_get_b5g6r5",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Color, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Color_get_b5g6r5" "', argument " "1"" of type '" "Color *""'"); - } - arg1 = reinterpret_cast< Color * >(argp1); - result = (unsigned int)(arg1)->get_b5g6r5(); - resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_create_from_float(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - float arg1 ; - float arg2 ; - float arg3 ; - float arg4 ; - Color result; - float val1 ; - int ecode1 = 0 ; - float val2 ; - int ecode2 = 0 ; - float val3 ; - int ecode3 = 0 ; - float val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Color_create_from_float",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_float(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Color_create_from_float" "', argument " "1"" of type '" "float""'"); - } - arg1 = static_cast< float >(val1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Color_create_from_float" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Color_create_from_float" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - ecode4 = SWIG_AsVal_float(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Color_create_from_float" "', argument " "4"" of type '" "float""'"); - } - arg4 = static_cast< float >(val4); - result = Color::create_from_float(arg1,arg2,arg3,arg4); - resultobj = SWIG_NewPointerObj((new Color(static_cast< const Color& >(result))), SWIGTYPE_p_Color, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_create_from_blend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Color *arg1 = 0 ; - Color *arg2 = 0 ; - Color result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Color_create_from_blend",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_Color, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Color_create_from_blend" "', argument " "1"" of type '" "Color const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Color_create_from_blend" "', argument " "1"" of type '" "Color const &""'"); - } - arg1 = reinterpret_cast< Color * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Color, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Color_create_from_blend" "', argument " "2"" of type '" "Color const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Color_create_from_blend" "', argument " "2"" of type '" "Color const &""'"); - } - arg2 = reinterpret_cast< Color * >(argp2); - result = Color::create_from_blend((Color const &)*arg1,(Color const &)*arg2); - resultobj = SWIG_NewPointerObj((new Color(static_cast< const Color& >(result))), SWIGTYPE_p_Color, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_create_from_lerp(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Color *arg1 = 0 ; - Color *arg2 = 0 ; - unsigned int arg3 ; - Color result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - unsigned int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Color_create_from_lerp",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_Color, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Color_create_from_lerp" "', argument " "1"" of type '" "Color const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Color_create_from_lerp" "', argument " "1"" of type '" "Color const &""'"); - } - arg1 = reinterpret_cast< Color * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Color, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Color_create_from_lerp" "', argument " "2"" of type '" "Color const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Color_create_from_lerp" "', argument " "2"" of type '" "Color const &""'"); - } - arg2 = reinterpret_cast< Color * >(argp2); - ecode3 = SWIG_AsVal_unsigned_SS_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Color_create_from_lerp" "', argument " "3"" of type '" "unsigned int""'"); - } - arg3 = static_cast< unsigned int >(val3); - result = Color::create_from_lerp((Color const &)*arg1,(Color const &)*arg2,arg3); - resultobj = SWIG_NewPointerObj((new Color(static_cast< const Color& >(result))), SWIGTYPE_p_Color, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_create_from_yuv(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - unsigned char arg1 ; - unsigned char arg2 ; - unsigned char arg3 ; - Color result; - unsigned char val1 ; - int ecode1 = 0 ; - unsigned char val2 ; - int ecode2 = 0 ; - unsigned char val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Color_create_from_yuv",&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_unsigned_SS_char(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Color_create_from_yuv" "', argument " "1"" of type '" "unsigned char""'"); - } - arg1 = static_cast< unsigned char >(val1); - ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Color_create_from_yuv" "', argument " "2"" of type '" "unsigned char""'"); - } - arg2 = static_cast< unsigned char >(val2); - ecode3 = SWIG_AsVal_unsigned_SS_char(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Color_create_from_yuv" "', argument " "3"" of type '" "unsigned char""'"); - } - arg3 = static_cast< unsigned char >(val3); - result = Color::create_from_yuv(arg1,arg2,arg3); - resultobj = SWIG_NewPointerObj((new Color(static_cast< const Color& >(result))), SWIGTYPE_p_Color, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Color_yuv_to_hsv(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - unsigned int arg1 ; - Color result; - unsigned int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Color_yuv_to_hsv",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Color_yuv_to_hsv" "', argument " "1"" of type '" "unsigned int""'"); - } - arg1 = static_cast< unsigned int >(val1); - result = Color::yuv_to_hsv(arg1); - resultobj = SWIG_NewPointerObj((new Color(static_cast< const Color& >(result))), SWIGTYPE_p_Color, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_Color(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Color *arg1 = (Color *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_Color",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Color, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Color" "', argument " "1"" of type '" "Color *""'"); - } - arg1 = reinterpret_cast< Color * >(argp1); - delete arg1; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Color_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_Color, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_ByteBuffer_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ByteBuffer *arg1 = (ByteBuffer *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ByteBuffer_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ByteBuffer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteBuffer_size_set" "', argument " "1"" of type '" "ByteBuffer *""'"); - } - arg1 = reinterpret_cast< ByteBuffer * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ByteBuffer_size_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->size = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteBuffer_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ByteBuffer *arg1 = (ByteBuffer *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ByteBuffer_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ByteBuffer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteBuffer_size_get" "', argument " "1"" of type '" "ByteBuffer *""'"); - } - arg1 = reinterpret_cast< ByteBuffer * >(argp1); - result = (int) ((arg1)->size); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteBuffer_data_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ByteBuffer *arg1 = (ByteBuffer *) 0 ; - void *arg2 = (void *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:ByteBuffer_data_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ByteBuffer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteBuffer_data_set" "', argument " "1"" of type '" "ByteBuffer *""'"); - } - arg1 = reinterpret_cast< ByteBuffer * >(argp1); - { - arg2 = obj1; - } - if (arg1) (arg1)->data = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_ByteBuffer_data_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ByteBuffer *arg1 = (ByteBuffer *) 0 ; - void *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:ByteBuffer_data_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ByteBuffer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ByteBuffer_data_get" "', argument " "1"" of type '" "ByteBuffer *""'"); - } - arg1 = reinterpret_cast< ByteBuffer * >(argp1); - result = (void *) ((arg1)->data); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_ByteBuffer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ByteBuffer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_ByteBuffer")) SWIG_fail; - result = (ByteBuffer *)new ByteBuffer(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ByteBuffer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_ByteBuffer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - ByteBuffer *arg1 = (ByteBuffer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_ByteBuffer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ByteBuffer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ByteBuffer" "', argument " "1"" of type '" "ByteBuffer *""'"); - } - arg1 = reinterpret_cast< ByteBuffer * >(argp1); - delete arg1; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *ByteBuffer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_ByteBuffer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_SurfaceA8R8G8B8_width_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - SurfaceA8R8G8B8 *arg1 = (SurfaceA8R8G8B8 *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SurfaceA8R8G8B8_width_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SurfaceA8R8G8B8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SurfaceA8R8G8B8_width_set" "', argument " "1"" of type '" "SurfaceA8R8G8B8 *""'"); - } - arg1 = reinterpret_cast< SurfaceA8R8G8B8 * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SurfaceA8R8G8B8_width_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->width = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SurfaceA8R8G8B8_width_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - SurfaceA8R8G8B8 *arg1 = (SurfaceA8R8G8B8 *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:SurfaceA8R8G8B8_width_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SurfaceA8R8G8B8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SurfaceA8R8G8B8_width_get" "', argument " "1"" of type '" "SurfaceA8R8G8B8 *""'"); - } - arg1 = reinterpret_cast< SurfaceA8R8G8B8 * >(argp1); - result = (int) ((arg1)->width); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SurfaceA8R8G8B8_height_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - SurfaceA8R8G8B8 *arg1 = (SurfaceA8R8G8B8 *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SurfaceA8R8G8B8_height_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SurfaceA8R8G8B8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SurfaceA8R8G8B8_height_set" "', argument " "1"" of type '" "SurfaceA8R8G8B8 *""'"); - } - arg1 = reinterpret_cast< SurfaceA8R8G8B8 * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SurfaceA8R8G8B8_height_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->height = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SurfaceA8R8G8B8_height_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - SurfaceA8R8G8B8 *arg1 = (SurfaceA8R8G8B8 *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:SurfaceA8R8G8B8_height_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SurfaceA8R8G8B8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SurfaceA8R8G8B8_height_get" "', argument " "1"" of type '" "SurfaceA8R8G8B8 *""'"); - } - arg1 = reinterpret_cast< SurfaceA8R8G8B8 * >(argp1); - result = (int) ((arg1)->height); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SurfaceA8R8G8B8_stride_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - SurfaceA8R8G8B8 *arg1 = (SurfaceA8R8G8B8 *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SurfaceA8R8G8B8_stride_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SurfaceA8R8G8B8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SurfaceA8R8G8B8_stride_set" "', argument " "1"" of type '" "SurfaceA8R8G8B8 *""'"); - } - arg1 = reinterpret_cast< SurfaceA8R8G8B8 * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SurfaceA8R8G8B8_stride_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->stride = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SurfaceA8R8G8B8_stride_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - SurfaceA8R8G8B8 *arg1 = (SurfaceA8R8G8B8 *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:SurfaceA8R8G8B8_stride_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SurfaceA8R8G8B8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SurfaceA8R8G8B8_stride_get" "', argument " "1"" of type '" "SurfaceA8R8G8B8 *""'"); - } - arg1 = reinterpret_cast< SurfaceA8R8G8B8 * >(argp1); - result = (int) ((arg1)->stride); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SurfaceA8R8G8B8_pixels_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - SurfaceA8R8G8B8 *arg1 = (SurfaceA8R8G8B8 *) 0 ; - unsigned int *arg2 = (unsigned int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:SurfaceA8R8G8B8_pixels_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SurfaceA8R8G8B8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SurfaceA8R8G8B8_pixels_set" "', argument " "1"" of type '" "SurfaceA8R8G8B8 *""'"); - } - arg1 = reinterpret_cast< SurfaceA8R8G8B8 * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_int, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SurfaceA8R8G8B8_pixels_set" "', argument " "2"" of type '" "unsigned int *""'"); - } - arg2 = reinterpret_cast< unsigned int * >(argp2); - if (arg1) (arg1)->pixels = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_SurfaceA8R8G8B8_pixels_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - SurfaceA8R8G8B8 *arg1 = (SurfaceA8R8G8B8 *) 0 ; - unsigned int *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:SurfaceA8R8G8B8_pixels_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SurfaceA8R8G8B8, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SurfaceA8R8G8B8_pixels_get" "', argument " "1"" of type '" "SurfaceA8R8G8B8 *""'"); - } - arg1 = reinterpret_cast< SurfaceA8R8G8B8 * >(argp1); - result = (unsigned int *) ((arg1)->pixels); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_SurfaceA8R8G8B8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - SurfaceA8R8G8B8 *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_SurfaceA8R8G8B8")) SWIG_fail; - result = (SurfaceA8R8G8B8 *)new SurfaceA8R8G8B8(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SurfaceA8R8G8B8, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_SurfaceA8R8G8B8(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - SurfaceA8R8G8B8 *arg1 = (SurfaceA8R8G8B8 *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_SurfaceA8R8G8B8",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SurfaceA8R8G8B8, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SurfaceA8R8G8B8" "', argument " "1"" of type '" "SurfaceA8R8G8B8 *""'"); - } - arg1 = reinterpret_cast< SurfaceA8R8G8B8 * >(argp1); - delete arg1; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *SurfaceA8R8G8B8_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_SurfaceA8R8G8B8, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_new_DrawCommandBuffer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommandBuffer *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_DrawCommandBuffer")) SWIG_fail; - result = (DrawCommandBuffer *)new DrawCommandBuffer(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DrawCommandBuffer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_DrawCommandBuffer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int arg2 ; - DrawCommandBuffer *result = 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_DrawCommandBuffer",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_DrawCommandBuffer" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_DrawCommandBuffer" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (DrawCommandBuffer *)new DrawCommandBuffer((char const *)arg1,arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DrawCommandBuffer, SWIG_POINTER_NEW | 0 ); - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_DrawCommandBuffer__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommandBuffer *arg1 = 0 ; - DrawCommandBuffer *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_DrawCommandBuffer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_DrawCommandBuffer, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_DrawCommandBuffer" "', argument " "1"" of type '" "DrawCommandBuffer const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_DrawCommandBuffer" "', argument " "1"" of type '" "DrawCommandBuffer const &""'"); - } - arg1 = reinterpret_cast< DrawCommandBuffer * >(argp1); - result = (DrawCommandBuffer *)new DrawCommandBuffer((DrawCommandBuffer const &)*arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DrawCommandBuffer, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_DrawCommandBuffer(PyObject *self, PyObject *args) { - int argc; - PyObject *argv[3]; - int ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = (int)PyObject_Length(args); - for (ii = 0; (ii < argc) && (ii < 2); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_DrawCommandBuffer__SWIG_0(self, args); - } - if (argc == 1) { - int _v; - int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_DrawCommandBuffer, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_DrawCommandBuffer__SWIG_2(self, args); - } - } - if (argc == 2) { - int _v; - int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_int(argv[1], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_new_DrawCommandBuffer__SWIG_1(self, args); - } - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_DrawCommandBuffer'.\n Possible C/C++ prototypes are:\n"" DrawCommandBuffer()\n"" DrawCommandBuffer(char const *,int)\n"" DrawCommandBuffer(DrawCommandBuffer const &)\n"); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_DrawCommandBuffer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommandBuffer *arg1 = (DrawCommandBuffer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_DrawCommandBuffer",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommandBuffer, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_DrawCommandBuffer" "', argument " "1"" of type '" "DrawCommandBuffer *""'"); - } - arg1 = reinterpret_cast< DrawCommandBuffer * >(argp1); - delete arg1; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommandBuffer_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommandBuffer *arg1 = (DrawCommandBuffer *) 0 ; - DrawCommandBuffer *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DrawCommandBuffer_append",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommandBuffer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommandBuffer_append" "', argument " "1"" of type '" "DrawCommandBuffer *""'"); - } - arg1 = reinterpret_cast< DrawCommandBuffer * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_DrawCommandBuffer, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DrawCommandBuffer_append" "', argument " "2"" of type '" "DrawCommandBuffer const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DrawCommandBuffer_append" "', argument " "2"" of type '" "DrawCommandBuffer const &""'"); - } - arg2 = reinterpret_cast< DrawCommandBuffer * >(argp2); - (arg1)->append((DrawCommandBuffer const &)*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommandBuffer_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommandBuffer *arg1 = (DrawCommandBuffer *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommandBuffer_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommandBuffer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommandBuffer_clear" "', argument " "1"" of type '" "DrawCommandBuffer *""'"); - } - arg1 = reinterpret_cast< DrawCommandBuffer * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommandBuffer_get_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommandBuffer *arg1 = (DrawCommandBuffer *) 0 ; - ByteBuffer result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommandBuffer_get_bytes",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommandBuffer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommandBuffer_get_bytes" "', argument " "1"" of type '" "DrawCommandBuffer *""'"); - } - arg1 = reinterpret_cast< DrawCommandBuffer * >(argp1); - result = (arg1)->get_bytes(); - { - resultobj = PyString_FromStringAndSize((const char*)(&result)->data, (&result)->size); - } - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommandBuffer_cmds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommandBuffer *arg1 = (DrawCommandBuffer *) 0 ; - char *arg2 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DrawCommandBuffer_cmds_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommandBuffer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommandBuffer_cmds_set" "', argument " "1"" of type '" "DrawCommandBuffer *""'"); - } - arg1 = reinterpret_cast< DrawCommandBuffer * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DrawCommandBuffer_cmds_set" "', argument " "2"" of type '" "char *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - if (arg1->cmds) delete[] arg1->cmds; - if (arg2) { - size_t size = strlen(reinterpret_cast< const char * >(arg2)) + 1; - arg1->cmds = (char *)reinterpret_cast< char* >(memcpy((new char[size]), reinterpret_cast< const char * >(arg2), sizeof(char)*(size))); - } else { - arg1->cmds = 0; - } - resultobj = SWIG_Py_Void(); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommandBuffer_cmds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommandBuffer *arg1 = (DrawCommandBuffer *) 0 ; - char *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommandBuffer_cmds_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommandBuffer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommandBuffer_cmds_get" "', argument " "1"" of type '" "DrawCommandBuffer *""'"); - } - arg1 = reinterpret_cast< DrawCommandBuffer * >(argp1); - result = (char *) ((arg1)->cmds); - resultobj = SWIG_FromCharPtr((const char *)result); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommandBuffer_ncommands_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommandBuffer *arg1 = (DrawCommandBuffer *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DrawCommandBuffer_ncommands_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommandBuffer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommandBuffer_ncommands_set" "', argument " "1"" of type '" "DrawCommandBuffer *""'"); - } - arg1 = reinterpret_cast< DrawCommandBuffer * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DrawCommandBuffer_ncommands_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->ncommands = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommandBuffer_ncommands_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommandBuffer *arg1 = (DrawCommandBuffer *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommandBuffer_ncommands_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommandBuffer, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommandBuffer_ncommands_get" "', argument " "1"" of type '" "DrawCommandBuffer *""'"); - } - arg1 = reinterpret_cast< DrawCommandBuffer * >(argp1); - result = (int) ((arg1)->ncommands); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommandBuffer_create_from_string(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int arg2 ; - DrawCommandBuffer result; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DrawCommandBuffer_create_from_string",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommandBuffer_create_from_string" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DrawCommandBuffer_create_from_string" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = DrawCommandBuffer::create_from_string((char const *)arg1,arg2); - resultobj = SWIG_NewPointerObj((new DrawCommandBuffer(static_cast< const DrawCommandBuffer& >(result))), SWIGTYPE_p_DrawCommandBuffer, SWIG_POINTER_OWN | 0 ); - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return resultobj; -fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - return NULL; -} - - -SWIGINTERN PyObject *DrawCommandBuffer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_DrawCommandBuffer, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_DrawCommand_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DrawCommand_type_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_type_set" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DrawCommand_type_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->type = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommand_type_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_type_get" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - result = (int) ((arg1)->type); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_pos_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - Pos *arg2 = (Pos *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DrawCommand_pos_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_pos_set" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DrawCommand_pos_set" "', argument " "2"" of type '" "Pos *""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - if (arg1) (arg1)->pos = *arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_pos_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - Pos *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommand_pos_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_pos_get" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - result = (Pos *)& ((arg1)->pos); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pos, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_color_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - Color *arg2 = (Color *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DrawCommand_color_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_color_set" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Color, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DrawCommand_color_set" "', argument " "2"" of type '" "Color *""'"); - } - arg2 = reinterpret_cast< Color * >(argp2); - if (arg1) (arg1)->color = *arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_color_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - Color *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommand_color_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_color_get" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - result = (Color *)& ((arg1)->color); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Color, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_pressure_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DrawCommand_pressure_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_pressure_set" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DrawCommand_pressure_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->pressure = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_pressure_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommand_pressure_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_pressure_get" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - result = (int) ((arg1)->pressure); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_flipx_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DrawCommand_flipx_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_flipx_set" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DrawCommand_flipx_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->flipx = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_flipx_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - bool result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommand_flipx_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_flipx_get" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - result = (bool) ((arg1)->flipx); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_flipy_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DrawCommand_flipy_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_flipy_set" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DrawCommand_flipy_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->flipy = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_flipy_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - bool result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommand_flipy_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_flipy_get" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - result = (bool) ((arg1)->flipy); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_is_text_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DrawCommand_is_text_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_is_text_set" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DrawCommand_is_text_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->is_text = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_is_text_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - bool result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommand_is_text_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_is_text_get" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - result = (bool) ((arg1)->is_text); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_text_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - uint32_t arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DrawCommand_text_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_text_set" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - { - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_uint32_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DrawCommand_text_set" "', argument " "2"" of type '" "uint32_t""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DrawCommand_text_set" "', argument " "2"" of type '" "uint32_t""'"); - } else { - uint32_t * temp = reinterpret_cast< uint32_t * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - if (arg1) (arg1)->text = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_text_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - uint32_t result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommand_text_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_text_get" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - result = ((arg1)->text); - resultobj = SWIG_NewPointerObj((new uint32_t(static_cast< const uint32_t& >(result))), SWIGTYPE_p_uint32_t, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_brush_control_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DrawCommand_brush_control_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_brush_control_set" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DrawCommand_brush_control_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->brush_control = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_brush_control_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommand_brush_control_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_brush_control_get" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - result = (int) ((arg1)->brush_control); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_brush_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DrawCommand_brush_type_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_brush_type_set" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DrawCommand_brush_type_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->brush_type = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_brush_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommand_brush_type_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_brush_type_get" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - result = (int) ((arg1)->brush_type); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DrawCommand_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_size_set" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DrawCommand_size_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->size = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommand_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_size_get" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - result = (float) ((arg1)->size); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_opacity_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DrawCommand_opacity_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_opacity_set" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DrawCommand_opacity_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->opacity = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_opacity_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommand_opacity_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_opacity_get" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - result = (float) ((arg1)->opacity); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_DrawCommand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_DrawCommand")) SWIG_fail; - result = (DrawCommand *)new DrawCommand(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DrawCommand, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_create_color_change(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Color *arg1 = 0 ; - DrawCommand result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommand_create_color_change",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_Color, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_create_color_change" "', argument " "1"" of type '" "Color const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DrawCommand_create_color_change" "', argument " "1"" of type '" "Color const &""'"); - } - arg1 = reinterpret_cast< Color * >(argp1); - result = DrawCommand::create_color_change((Color const &)*arg1); - resultobj = SWIG_NewPointerObj((new DrawCommand(static_cast< const DrawCommand& >(result))), SWIGTYPE_p_DrawCommand, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_create_draw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Pos *arg1 = 0 ; - int arg2 ; - DrawCommand result; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:DrawCommand_create_draw",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DrawCommand_create_draw" "', argument " "1"" of type '" "Pos const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DrawCommand_create_draw" "', argument " "1"" of type '" "Pos const &""'"); - } - arg1 = reinterpret_cast< Pos * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DrawCommand_create_draw" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = DrawCommand::create_draw((Pos const &)*arg1,arg2); - resultobj = SWIG_NewPointerObj((new DrawCommand(static_cast< const DrawCommand& >(result))), SWIGTYPE_p_DrawCommand, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_create_end_draw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - DrawCommand result; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommand_create_end_draw",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "DrawCommand_create_end_draw" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - result = DrawCommand::create_end_draw(arg1); - resultobj = SWIG_NewPointerObj((new DrawCommand(static_cast< const DrawCommand& >(result))), SWIGTYPE_p_DrawCommand, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_create_size_change(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - float arg3 ; - float arg4 ; - DrawCommand result; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - float val3 ; - int ecode3 = 0 ; - float val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:DrawCommand_create_size_change",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "DrawCommand_create_size_change" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DrawCommand_create_size_change" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DrawCommand_create_size_change" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - ecode4 = SWIG_AsVal_float(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "DrawCommand_create_size_change" "', argument " "4"" of type '" "float""'"); - } - arg4 = static_cast< float >(val4); - result = DrawCommand::create_size_change(arg1,arg2,arg3,arg4); - resultobj = SWIG_NewPointerObj((new DrawCommand(static_cast< const DrawCommand& >(result))), SWIGTYPE_p_DrawCommand, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_DrawCommand_create_flip(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - bool arg1 ; - DrawCommand result; - bool val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:DrawCommand_create_flip",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_bool(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "DrawCommand_create_flip" "', argument " "1"" of type '" "bool""'"); - } - arg1 = static_cast< bool >(val1); - result = DrawCommand::create_flip(arg1); - resultobj = SWIG_NewPointerObj((new DrawCommand(static_cast< const DrawCommand& >(result))), SWIGTYPE_p_DrawCommand, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_DrawCommand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - DrawCommand *arg1 = (DrawCommand *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_DrawCommand",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DrawCommand, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_DrawCommand" "', argument " "1"" of type '" "DrawCommand *""'"); - } - arg1 = reinterpret_cast< DrawCommand * >(argp1); - delete arg1; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *DrawCommand_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_DrawCommand, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN int Swig_var_BrushType_distance_tbl_set(PyObject *_val) { - { - unsigned char (*inp)[BrushType::DIST_TABLE_WIDTH] = 0; - int res = SWIG_ConvertPtr(_val, SWIG_as_voidptrptr(&inp), SWIGTYPE_p_a_BrushType__DIST_TABLE_WIDTH__unsigned_char, 0 ); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in variable '""BrushType::distance_tbl""' of type '""unsigned char [BrushType::DIST_TABLE_WIDTH][BrushType::DIST_TABLE_WIDTH]""'"); - } else if (inp) { - size_t ii = 0; - for (; ii < (size_t)BrushType::DIST_TABLE_WIDTH; ++ii) { - if (inp[ii]) { - size_t jj = 0; - for (; jj < (size_t)BrushType::DIST_TABLE_WIDTH; ++jj) BrushType::distance_tbl[ii][jj] = inp[ii][jj]; - } else { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""BrushType::distance_tbl""' of type '""unsigned char [BrushType::DIST_TABLE_WIDTH][BrushType::DIST_TABLE_WIDTH]""'"); - } - } - } else { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""BrushType::distance_tbl""' of type '""unsigned char [BrushType::DIST_TABLE_WIDTH][BrushType::DIST_TABLE_WIDTH]""'"); - } - } - return 0; -fail: - return 1; -} - - -SWIGINTERN PyObject *Swig_var_BrushType_distance_tbl_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(BrushType::distance_tbl), SWIGTYPE_p_a_BrushType__DIST_TABLE_WIDTH__unsigned_char, 0 ); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_BrushType_distance_tbl_get(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(args)) { - return Swig_var_BrushType_distance_tbl_get(); -} - - -SWIGINTERN PyObject *_wrap_BrushType_distance_tbl_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *value; - int res; - - if (!PyArg_ParseTuple(args,(char *)"O:set",&value)) return NULL; - res = Swig_var_BrushType_distance_tbl_set(value); - return !res ? SWIG_Py_Void() : NULL; -} - - -SWIGINTERN PyObject *_wrap_BrushType_intensity_tbl_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - BrushType *arg1 = (BrushType *) 0 ; - unsigned char (*arg2)[BrushType::BRUSH_TABLE_HEIGHT] ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:BrushType_intensity_tbl_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BrushType, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BrushType_intensity_tbl_set" "', argument " "1"" of type '" "BrushType *""'"); - } - arg1 = reinterpret_cast< BrushType * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_a_BrushType__BRUSH_TABLE_HEIGHT__unsigned_char, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "BrushType_intensity_tbl_set" "', argument " "2"" of type '" "unsigned char [BrushType::BRUSH_TABLE_WIDTH][BrushType::BRUSH_TABLE_HEIGHT]""'"); - } - arg2 = reinterpret_cast< unsigned char (*)[BrushType::BRUSH_TABLE_HEIGHT] >(argp2); - { - if (arg2) { - size_t ii = 0; - for (; ii < (size_t)BrushType::BRUSH_TABLE_WIDTH; ++ii) { - if (arg2[ii]) { - size_t jj = 0; - for (; jj < (size_t)BrushType::BRUSH_TABLE_HEIGHT; ++jj) arg1->intensity_tbl[ii][jj] = arg2[ii][jj]; - } else { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""intensity_tbl""' of type '""unsigned char [BrushType::BRUSH_TABLE_WIDTH][BrushType::BRUSH_TABLE_HEIGHT]""'"); - } - } - } else { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""intensity_tbl""' of type '""unsigned char [BrushType::BRUSH_TABLE_WIDTH][BrushType::BRUSH_TABLE_HEIGHT]""'"); - } - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BrushType_intensity_tbl_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - BrushType *arg1 = (BrushType *) 0 ; - unsigned char (*result)[BrushType::BRUSH_TABLE_HEIGHT] = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:BrushType_intensity_tbl_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BrushType, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BrushType_intensity_tbl_get" "', argument " "1"" of type '" "BrushType *""'"); - } - arg1 = reinterpret_cast< BrushType * >(argp1); - result = (unsigned char (*)[BrushType::BRUSH_TABLE_HEIGHT])(unsigned char (*)[BrushType::BRUSH_TABLE_HEIGHT]) ((arg1)->intensity_tbl); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_a_BrushType__BRUSH_TABLE_HEIGHT__unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BrushType_create_distance_table(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - - if (!PyArg_ParseTuple(args,(char *)":BrushType_create_distance_table")) SWIG_fail; - BrushType::create_distance_table(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BrushType_smooth_step(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - BrushType *arg1 = (BrushType *) 0 ; - float arg2 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:BrushType_smooth_step",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BrushType, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BrushType_smooth_step" "', argument " "1"" of type '" "BrushType *""'"); - } - arg1 = reinterpret_cast< BrushType * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BrushType_smooth_step" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - result = (float)(arg1)->smooth_step(arg2); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BrushType_create_brush(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - BrushType *arg1 = (BrushType *) 0 ; - float arg2 ; - float arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - float val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:BrushType_create_brush",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BrushType, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BrushType_create_brush" "', argument " "1"" of type '" "BrushType *""'"); - } - arg1 = reinterpret_cast< BrushType * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BrushType_create_brush" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "BrushType_create_brush" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - (arg1)->create_brush(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BrushType_create_hard_brush(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - BrushType *arg1 = (BrushType *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:BrushType_create_hard_brush",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BrushType, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BrushType_create_hard_brush" "', argument " "1"" of type '" "BrushType *""'"); - } - arg1 = reinterpret_cast< BrushType * >(argp1); - (arg1)->create_hard_brush(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BrushType_create_soft_brush(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - BrushType *arg1 = (BrushType *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:BrushType_create_soft_brush",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BrushType, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BrushType_create_soft_brush" "', argument " "1"" of type '" "BrushType *""'"); - } - arg1 = reinterpret_cast< BrushType * >(argp1); - (arg1)->create_soft_brush(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BrushType_create_cursor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - BrushType *arg1 = (BrushType *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:BrushType_create_cursor",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BrushType, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BrushType_create_cursor" "', argument " "1"" of type '" "BrushType *""'"); - } - arg1 = reinterpret_cast< BrushType * >(argp1); - (arg1)->create_cursor(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_BrushType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - BrushType *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_BrushType")) SWIG_fail; - result = (BrushType *)new BrushType(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BrushType, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_BrushType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - BrushType *arg1 = (BrushType *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_BrushType",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BrushType, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_BrushType" "', argument " "1"" of type '" "BrushType *""'"); - } - arg1 = reinterpret_cast< BrushType * >(argp1); - delete arg1; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *BrushType_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_BrushType, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN int Swig_var_Brush_brush_type_set(PyObject *_val) { - { - BrushType *inp = 0; - int res = SWIG_ConvertPtr(_val, SWIG_as_voidptrptr(&inp), SWIGTYPE_p_BrushType, 0 ); - if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in variable '""Brush::brush_type""' of type '""BrushType [BrushType::NUM_BRUSHES]""'"); - } else if (inp) { - size_t ii = 0; - for (; ii < (size_t)BrushType::NUM_BRUSHES; ++ii) Brush::brush_type[ii] = inp[ii]; - } else { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""Brush::brush_type""' of type '""BrushType [BrushType::NUM_BRUSHES]""'"); - } - } - return 0; -fail: - return 1; -} - - -SWIGINTERN PyObject *Swig_var_Brush_brush_type_get(void) { - PyObject *pyobj = 0; - - pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(Brush::brush_type), SWIGTYPE_p_BrushType, 0 ); - return pyobj; -} - - -SWIGINTERN PyObject *_wrap_Brush_brush_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(args)) { - return Swig_var_Brush_brush_type_get(); -} - - -SWIGINTERN PyObject *_wrap_Brush_brush_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *value; - int res; - - if (!PyArg_ParseTuple(args,(char *)"O:set",&value)) return NULL; - res = Swig_var_Brush_brush_type_set(value); - return !res ? SWIG_Py_Void() : NULL; -} - - -SWIGINTERN PyObject *_wrap_Brush_color_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Brush *arg1 = (Brush *) 0 ; - Color *arg2 = (Color *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Brush_color_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Brush, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Brush_color_set" "', argument " "1"" of type '" "Brush *""'"); - } - arg1 = reinterpret_cast< Brush * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Color, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Brush_color_set" "', argument " "2"" of type '" "Color *""'"); - } - arg2 = reinterpret_cast< Color * >(argp2); - if (arg1) (arg1)->color = *arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Brush_color_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Brush *arg1 = (Brush *) 0 ; - Color *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Brush_color_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Brush, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Brush_color_get" "', argument " "1"" of type '" "Brush *""'"); - } - arg1 = reinterpret_cast< Brush * >(argp1); - result = (Color *)& ((arg1)->color); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Color, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Brush_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Brush *arg1 = (Brush *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Brush_type_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Brush, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Brush_type_set" "', argument " "1"" of type '" "Brush *""'"); - } - arg1 = reinterpret_cast< Brush * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Brush_type_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->type = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Brush_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Brush *arg1 = (Brush *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Brush_type_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Brush, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Brush_type_get" "', argument " "1"" of type '" "Brush *""'"); - } - arg1 = reinterpret_cast< Brush * >(argp1); - result = (int) ((arg1)->type); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Brush_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Brush *arg1 = (Brush *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Brush_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Brush, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Brush_size_set" "', argument " "1"" of type '" "Brush *""'"); - } - arg1 = reinterpret_cast< Brush * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Brush_size_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->size = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Brush_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Brush *arg1 = (Brush *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Brush_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Brush, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Brush_size_get" "', argument " "1"" of type '" "Brush *""'"); - } - arg1 = reinterpret_cast< Brush * >(argp1); - result = (int) ((arg1)->size); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Brush_control_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Brush *arg1 = (Brush *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Brush_control_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Brush, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Brush_control_set" "', argument " "1"" of type '" "Brush *""'"); - } - arg1 = reinterpret_cast< Brush * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Brush_control_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->control = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Brush_control_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Brush *arg1 = (Brush *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Brush_control_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Brush, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Brush_control_get" "', argument " "1"" of type '" "Brush *""'"); - } - arg1 = reinterpret_cast< Brush * >(argp1); - result = (int) ((arg1)->control); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Brush_opacity_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Brush *arg1 = (Brush *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Brush_opacity_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Brush, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Brush_opacity_set" "', argument " "1"" of type '" "Brush *""'"); - } - arg1 = reinterpret_cast< Brush * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Brush_opacity_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->opacity = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Brush_opacity_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Brush *arg1 = (Brush *) 0 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Brush_opacity_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Brush, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Brush_opacity_get" "', argument " "1"" of type '" "Brush *""'"); - } - arg1 = reinterpret_cast< Brush * >(argp1); - result = (float) ((arg1)->opacity); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Brush__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Brush *result = 0 ; - - if (!PyArg_ParseTuple(args,(char *)":new_Brush")) SWIG_fail; - result = (Brush *)new Brush(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Brush, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Brush__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Brush *arg1 = 0 ; - Brush *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_Brush",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_Brush, 0 | 0); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Brush" "', argument " "1"" of type '" "Brush const &""'"); - } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Brush" "', argument " "1"" of type '" "Brush const &""'"); - } - arg1 = reinterpret_cast< Brush * >(argp1); - result = (Brush *)new Brush((Brush const &)*arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Brush, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Brush(PyObject *self, PyObject *args) { - int argc; - PyObject *argv[2]; - int ii; - - if (!PyTuple_Check(args)) SWIG_fail; - argc = (int)PyObject_Length(args); - for (ii = 0; (ii < argc) && (ii < 1); ii++) { - argv[ii] = PyTuple_GET_ITEM(args,ii); - } - if (argc == 0) { - return _wrap_new_Brush__SWIG_0(self, args); - } - if (argc == 1) { - int _v; - int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_Brush, 0); - _v = SWIG_CheckState(res); - if (_v) { - return _wrap_new_Brush__SWIG_1(self, args); - } - } - -fail: - SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_Brush'.\n Possible C/C++ prototypes are:\n"" Brush()\n"" Brush(Brush const &)\n"); - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_Brush(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Brush *arg1 = (Brush *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_Brush",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Brush, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Brush" "', argument " "1"" of type '" "Brush *""'"); - } - arg1 = reinterpret_cast< Brush * >(argp1); - delete arg1; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Brush_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_Brush, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_Canvas_commands_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - vector<DrawCommand > *arg2 = (vector<DrawCommand > *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_commands_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_commands_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_vectorTDrawCommand_t, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_commands_set" "', argument " "2"" of type '" "vector<DrawCommand > *""'"); - } - arg2 = reinterpret_cast< vector<DrawCommand > * >(argp2); - if (arg1) (arg1)->commands = *arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_commands_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - vector<DrawCommand > *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_commands_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_commands_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (vector<DrawCommand > *)& ((arg1)->commands); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_vectorTDrawCommand_t, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_width_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_width_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_width_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_width_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->width = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_width_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_width_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_width_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (int) ((arg1)->width); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_height_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_height_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_height_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_height_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->height = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_height_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_height_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_height_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (int) ((arg1)->height); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_image_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - unsigned int *arg2 = (unsigned int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_image_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_image_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_int, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_image_set" "', argument " "2"" of type '" "unsigned int *""'"); - } - arg2 = reinterpret_cast< unsigned int * >(argp2); - if (arg1) (arg1)->image = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_image_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - unsigned int *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_image_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_image_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (unsigned int *) ((arg1)->image); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_image_backup_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - unsigned int *arg2 = (unsigned int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_image_backup_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_image_backup_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_int, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_image_backup_set" "', argument " "2"" of type '" "unsigned int *""'"); - } - arg2 = reinterpret_cast< unsigned int * >(argp2); - if (arg1) (arg1)->image_backup = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_image_backup_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - unsigned int *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_image_backup_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_image_backup_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (unsigned int *) ((arg1)->image_backup); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_alpha_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - unsigned char *arg2 = (unsigned char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_alpha_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_alpha_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_alpha_set" "', argument " "2"" of type '" "unsigned char *""'"); - } - arg2 = reinterpret_cast< unsigned char * >(argp2); - if (arg1) (arg1)->alpha = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_alpha_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - unsigned char *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_alpha_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_alpha_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (unsigned char *) ((arg1)->alpha); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_char, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_image_shared_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - unsigned int *arg2 = (unsigned int *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_image_shared_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_image_shared_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_int, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_image_shared_set" "', argument " "2"" of type '" "unsigned int *""'"); - } - arg2 = reinterpret_cast< unsigned int * >(argp2); - if (arg1) (arg1)->image_shared = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_image_shared_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - unsigned int *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_image_shared_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_image_shared_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (unsigned int *) ((arg1)->image_shared); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_image_reference_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - unsigned short *arg2 = (unsigned short *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_image_reference_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_image_reference_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_short, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_image_reference_set" "', argument " "2"" of type '" "unsigned short *""'"); - } - arg2 = reinterpret_cast< unsigned short * >(argp2); - if (arg1) (arg1)->image_reference = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_image_reference_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - unsigned short *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_image_reference_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_image_reference_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (unsigned short *) ((arg1)->image_reference); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_unsigned_short, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_image_video_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - unsigned int **arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_image_video_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_image_video_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_unsigned_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_image_video_set" "', argument " "2"" of type '" "unsigned int *[2]""'"); - } - arg2 = reinterpret_cast< unsigned int ** >(argp2); - { - if (arg2) { - size_t ii = 0; - for (; ii < (size_t)2; ++ii) arg1->image_video[ii] = arg2[ii]; - } else { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""image_video""' of type '""unsigned int *[2]""'"); - } - } - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_image_video_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - unsigned int **result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_image_video_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_image_video_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (unsigned int **)(unsigned int **) ((arg1)->image_video); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_unsigned_int, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_video_idx_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_video_idx_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_video_idx_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_video_idx_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->video_idx = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_video_idx_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_video_idx_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_video_idx_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (int) ((arg1)->video_idx); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_videopaint_pos_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Pos *arg2 = (Pos *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_videopaint_pos_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_videopaint_pos_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_videopaint_pos_set" "', argument " "2"" of type '" "Pos *""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - if (arg1) (arg1)->videopaint_pos = *arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_videopaint_pos_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Pos *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_videopaint_pos_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_videopaint_pos_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (Pos *)& ((arg1)->videopaint_pos); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pos, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_videopaint_pressure_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_videopaint_pressure_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_videopaint_pressure_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_videopaint_pressure_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->videopaint_pressure = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_videopaint_pressure_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_videopaint_pressure_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_videopaint_pressure_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (float) ((arg1)->videopaint_pressure); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_brush_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Brush *arg2 = (Brush *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_brush_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_brush_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Brush, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_brush_set" "', argument " "2"" of type '" "Brush *""'"); - } - arg2 = reinterpret_cast< Brush * >(argp2); - if (arg1) (arg1)->brush = *arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_brush_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Brush *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_brush_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_brush_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (Brush *)& ((arg1)->brush); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Brush, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_lastpos_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Pos *arg2 = (Pos *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_lastpos_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_lastpos_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_lastpos_set" "', argument " "2"" of type '" "Pos *""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - if (arg1) (arg1)->lastpos = *arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_lastpos_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Pos *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_lastpos_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_lastpos_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (Pos *)& ((arg1)->lastpos); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pos, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_lastorgpos_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Pos *arg2 = (Pos *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_lastorgpos_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_lastorgpos_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_lastorgpos_set" "', argument " "2"" of type '" "Pos *""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - if (arg1) (arg1)->lastorgpos = *arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_lastorgpos_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Pos *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_lastorgpos_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_lastorgpos_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (Pos *)& ((arg1)->lastorgpos); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pos, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_lastpressure_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_lastpressure_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_lastpressure_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_lastpressure_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->lastpressure = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_lastpressure_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_lastpressure_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_lastpressure_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (float) ((arg1)->lastpressure); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_dirtymin_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Pos *arg2 = (Pos *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_dirtymin_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_dirtymin_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_dirtymin_set" "', argument " "2"" of type '" "Pos *""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - if (arg1) (arg1)->dirtymin = *arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_dirtymin_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Pos *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_dirtymin_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_dirtymin_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (Pos *)& ((arg1)->dirtymin); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pos, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_dirtymax_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Pos *arg2 = (Pos *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_dirtymax_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_dirtymax_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_dirtymax_set" "', argument " "2"" of type '" "Pos *""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - if (arg1) (arg1)->dirtymax = *arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_dirtymax_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Pos *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_dirtymax_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_dirtymax_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (Pos *)& ((arg1)->dirtymax); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pos, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_strokemin_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Pos *arg2 = (Pos *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_strokemin_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_strokemin_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_strokemin_set" "', argument " "2"" of type '" "Pos *""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - if (arg1) (arg1)->strokemin = *arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_strokemin_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Pos *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_strokemin_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_strokemin_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (Pos *)& ((arg1)->strokemin); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pos, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_strokemax_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Pos *arg2 = (Pos *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_strokemax_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_strokemax_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_strokemax_set" "', argument " "2"" of type '" "Pos *""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - if (arg1) (arg1)->strokemax = *arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_strokemax_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Pos *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_strokemax_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_strokemax_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (Pos *)& ((arg1)->strokemax); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pos, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_stroke_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_stroke_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_stroke_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_stroke_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->stroke = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_stroke_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - bool result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_stroke_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_stroke_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (bool) ((arg1)->stroke); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_idle_while_drawing_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_idle_while_drawing_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_idle_while_drawing_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_idle_while_drawing_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->idle_while_drawing = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_idle_while_drawing_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_idle_while_drawing_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_idle_while_drawing_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (int) ((arg1)->idle_while_drawing); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_drawtype_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_drawtype_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_drawtype_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_drawtype_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->drawtype = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_drawtype_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_drawtype_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_drawtype_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (int) ((arg1)->drawtype); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_playing_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_playing_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_playing_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_playing_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->playing = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_playing_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - bool result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_playing_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_playing_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (bool) ((arg1)->playing); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_playback_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_playback_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_playback_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_playback_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->playback = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_playback_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_playback_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_playback_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (int) ((arg1)->playback); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_playback_speed_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_playback_speed_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_playback_speed_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_playback_speed_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->playback_speed = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_playback_speed_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_playback_speed_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_playback_speed_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (int) ((arg1)->playback_speed); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_modified_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_modified_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_modified_set" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_modified_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->modified = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_modified_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - bool result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_modified_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_modified_get" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (bool) ((arg1)->modified); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Canvas(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - int arg2 ; - Canvas *result = 0 ; - int val1 ; - int ecode1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:new_Canvas",&obj0,&obj1)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Canvas" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Canvas" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (Canvas *)new Canvas(arg1,arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Canvas, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_Canvas(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_Canvas",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Canvas" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - delete arg1; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_clear",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_clear" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - (arg1)->clear(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_resize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int arg2 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Canvas_resize",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_resize" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_resize" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Canvas_resize" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - (arg1)->resize(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_reset_brush(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_reset_brush",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_reset_brush" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - (arg1)->reset_brush(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_save_shared_image(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_save_shared_image",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_save_shared_image" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - (arg1)->save_shared_image(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_restore_shared_image(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_restore_shared_image",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_restore_shared_image" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - (arg1)->restore_shared_image(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_clear_image(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_clear_image",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_clear_image" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - (arg1)->clear_image(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_get_variable_brush_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - float arg2 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_get_variable_brush_size",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_get_variable_brush_size" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_get_variable_brush_size" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - result = (float)(arg1)->get_variable_brush_size(arg2); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_command_draw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Pos *arg2 = 0 ; - int arg3 ; - bool arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - bool val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Canvas_command_draw",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_command_draw" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_command_draw" "', argument " "2"" of type '" "Pos const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Canvas_command_draw" "', argument " "2"" of type '" "Pos const &""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Canvas_command_draw" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_bool(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Canvas_command_draw" "', argument " "4"" of type '" "bool""'"); - } - arg4 = static_cast< bool >(val4); - (arg1)->command_draw((Pos const &)*arg2,arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_command_enddraw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_command_enddraw",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_command_enddraw" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - (arg1)->command_enddraw(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_reset_dirty_rect(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_reset_dirty_rect",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_reset_dirty_rect" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - (arg1)->reset_dirty_rect(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_draw_brush(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Pos *arg2 = 0 ; - int arg3 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Canvas_draw_brush",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_draw_brush" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_draw_brush" "', argument " "2"" of type '" "Pos const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Canvas_draw_brush" "', argument " "2"" of type '" "Pos const &""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Canvas_draw_brush" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Canvas_draw_brush" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - (arg1)->draw_brush((Pos const &)*arg2,arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_pickup_color(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - Pos *arg2 = 0 ; - Color result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_pickup_color",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_pickup_color" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_pickup_color" "', argument " "2"" of type '" "Pos const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Canvas_pickup_color" "', argument " "2"" of type '" "Pos const &""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - result = (arg1)->pickup_color((Pos const &)*arg2); - resultobj = SWIG_NewPointerObj((new Color(static_cast< const Color& >(result))), SWIGTYPE_p_Color, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_add_command(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - DrawCommand *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_add_command",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_add_command" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_DrawCommand, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_add_command" "', argument " "2"" of type '" "DrawCommand const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Canvas_add_command" "', argument " "2"" of type '" "DrawCommand const &""'"); - } - arg2 = reinterpret_cast< DrawCommand * >(argp2); - (arg1)->add_command((DrawCommand const &)*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_play_command(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - DrawCommand *arg2 = 0 ; - bool arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - bool val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Canvas_play_command",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_play_command" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_DrawCommand, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_play_command" "', argument " "2"" of type '" "DrawCommand const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Canvas_play_command" "', argument " "2"" of type '" "DrawCommand const &""'"); - } - arg2 = reinterpret_cast< DrawCommand * >(argp2); - ecode3 = SWIG_AsVal_bool(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Canvas_play_command" "', argument " "3"" of type '" "bool""'"); - } - arg3 = static_cast< bool >(val3); - (arg1)->play_command((DrawCommand const &)*arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_playback_done(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - bool result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_playback_done",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_playback_done" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (bool)(arg1)->playback_done(); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_playback_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_playback_length",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_playback_length" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (int)(arg1)->playback_length(); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_playback_pos(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_playback_pos",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_playback_pos" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (int)(arg1)->playback_pos(); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_start_playback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_start_playback",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_start_playback" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - (arg1)->start_playback(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_pause_playback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_pause_playback",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_pause_playback" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - (arg1)->pause_playback(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_resume_playback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_resume_playback",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_resume_playback" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - (arg1)->resume_playback(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_stop_playback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_stop_playback",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_stop_playback" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - (arg1)->stop_playback(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_finish_playback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_finish_playback",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_finish_playback" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - (arg1)->finish_playback(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_playback_finish_stroke(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_playback_finish_stroke",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_playback_finish_stroke" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - (arg1)->playback_finish_stroke(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_playback_to(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_playback_to",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_playback_to" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_playback_to" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - (arg1)->playback_to(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_playback_step_to(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_playback_step_to",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_playback_step_to" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_playback_step_to" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - (arg1)->playback_step_to(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_playback_to_timed(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int arg2 ; - float arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - float val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Canvas_playback_to_timed",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_playback_to_timed" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_playback_to_timed" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Canvas_playback_to_timed" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - (arg1)->playback_to_timed(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_set_playback_speed(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_set_playback_speed",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_set_playback_speed" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_set_playback_speed" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - (arg1)->set_playback_speed(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_truncate_at_playback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_truncate_at_playback",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_truncate_at_playback" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - (arg1)->truncate_at_playback(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_update_playback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_update_playback",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_update_playback" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - (arg1)->update_playback(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_get_num_commands(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_get_num_commands",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_get_num_commands" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - result = (int)(arg1)->get_num_commands(); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_play_range(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int arg2 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Canvas_play_range",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_play_range" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_play_range" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Canvas_play_range" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - (arg1)->play_range(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_blit_1x(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - GdkImage *arg2 = (GdkImage *) 0 ; - int arg3 ; - int arg4 ; - int arg5 ; - int arg6 ; - int arg7 ; - int arg8 ; - bool arg9 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - int val6 ; - int ecode6 = 0 ; - int val7 ; - int ecode7 = 0 ; - int val8 ; - int ecode8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:Canvas_blit_1x",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_blit_1x" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - { - // todo- Error checking would be nice. - PyGObject* pygo = (PyGObject*)obj1; - GdkImage* img = (GdkImage*)pygo->obj; - arg2 = img; - } - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Canvas_blit_1x" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Canvas_blit_1x" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Canvas_blit_1x" "', argument " "5"" of type '" "int""'"); - } - arg5 = static_cast< int >(val5); - ecode6 = SWIG_AsVal_int(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Canvas_blit_1x" "', argument " "6"" of type '" "int""'"); - } - arg6 = static_cast< int >(val6); - ecode7 = SWIG_AsVal_int(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Canvas_blit_1x" "', argument " "7"" of type '" "int""'"); - } - arg7 = static_cast< int >(val7); - ecode8 = SWIG_AsVal_int(obj7, &val8); - if (!SWIG_IsOK(ecode8)) { - SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "Canvas_blit_1x" "', argument " "8"" of type '" "int""'"); - } - arg8 = static_cast< int >(val8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "Canvas_blit_1x" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - (arg1)->blit_1x(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_blit_2x(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - GdkImage *arg2 = (GdkImage *) 0 ; - int arg3 ; - int arg4 ; - int arg5 ; - int arg6 ; - int arg7 ; - int arg8 ; - bool arg9 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - int val6 ; - int ecode6 = 0 ; - int val7 ; - int ecode7 = 0 ; - int val8 ; - int ecode8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:Canvas_blit_2x",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_blit_2x" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - { - // todo- Error checking would be nice. - PyGObject* pygo = (PyGObject*)obj1; - GdkImage* img = (GdkImage*)pygo->obj; - arg2 = img; - } - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Canvas_blit_2x" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Canvas_blit_2x" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Canvas_blit_2x" "', argument " "5"" of type '" "int""'"); - } - arg5 = static_cast< int >(val5); - ecode6 = SWIG_AsVal_int(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Canvas_blit_2x" "', argument " "6"" of type '" "int""'"); - } - arg6 = static_cast< int >(val6); - ecode7 = SWIG_AsVal_int(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Canvas_blit_2x" "', argument " "7"" of type '" "int""'"); - } - arg7 = static_cast< int >(val7); - ecode8 = SWIG_AsVal_int(obj7, &val8); - if (!SWIG_IsOK(ecode8)) { - SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "Canvas_blit_2x" "', argument " "8"" of type '" "int""'"); - } - arg8 = static_cast< int >(val8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "Canvas_blit_2x" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - (arg1)->blit_2x(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_blit_4x(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - GdkImage *arg2 = (GdkImage *) 0 ; - int arg3 ; - int arg4 ; - int arg5 ; - int arg6 ; - int arg7 ; - int arg8 ; - bool arg9 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - int val6 ; - int ecode6 = 0 ; - int val7 ; - int ecode7 = 0 ; - int val8 ; - int ecode8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:Canvas_blit_4x",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_blit_4x" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - { - // todo- Error checking would be nice. - PyGObject* pygo = (PyGObject*)obj1; - GdkImage* img = (GdkImage*)pygo->obj; - arg2 = img; - } - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Canvas_blit_4x" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Canvas_blit_4x" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Canvas_blit_4x" "', argument " "5"" of type '" "int""'"); - } - arg5 = static_cast< int >(val5); - ecode6 = SWIG_AsVal_int(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Canvas_blit_4x" "', argument " "6"" of type '" "int""'"); - } - arg6 = static_cast< int >(val6); - ecode7 = SWIG_AsVal_int(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Canvas_blit_4x" "', argument " "7"" of type '" "int""'"); - } - arg7 = static_cast< int >(val7); - ecode8 = SWIG_AsVal_int(obj7, &val8); - if (!SWIG_IsOK(ecode8)) { - SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "Canvas_blit_4x" "', argument " "8"" of type '" "int""'"); - } - arg8 = static_cast< int >(val8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "Canvas_blit_4x" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - (arg1)->blit_4x(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_blit_8x(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - GdkImage *arg2 = (GdkImage *) 0 ; - int arg3 ; - int arg4 ; - int arg5 ; - int arg6 ; - int arg7 ; - int arg8 ; - bool arg9 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - int val6 ; - int ecode6 = 0 ; - int val7 ; - int ecode7 = 0 ; - int val8 ; - int ecode8 = 0 ; - bool val9 ; - int ecode9 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - PyObject * obj7 = 0 ; - PyObject * obj8 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:Canvas_blit_8x",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_blit_8x" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - { - // todo- Error checking would be nice. - PyGObject* pygo = (PyGObject*)obj1; - GdkImage* img = (GdkImage*)pygo->obj; - arg2 = img; - } - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Canvas_blit_8x" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Canvas_blit_8x" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Canvas_blit_8x" "', argument " "5"" of type '" "int""'"); - } - arg5 = static_cast< int >(val5); - ecode6 = SWIG_AsVal_int(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Canvas_blit_8x" "', argument " "6"" of type '" "int""'"); - } - arg6 = static_cast< int >(val6); - ecode7 = SWIG_AsVal_int(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Canvas_blit_8x" "', argument " "7"" of type '" "int""'"); - } - arg7 = static_cast< int >(val7); - ecode8 = SWIG_AsVal_int(obj7, &val8); - if (!SWIG_IsOK(ecode8)) { - SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "Canvas_blit_8x" "', argument " "8"" of type '" "int""'"); - } - arg8 = static_cast< int >(val8); - ecode9 = SWIG_AsVal_bool(obj8, &val9); - if (!SWIG_IsOK(ecode9)) { - SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "Canvas_blit_8x" "', argument " "9"" of type '" "bool""'"); - } - arg9 = static_cast< bool >(val9); - (arg1)->blit_8x(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_downsize_video(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - unsigned int *arg2 = (unsigned int *) 0 ; - GstBuffer *arg3 = (GstBuffer *) 0 ; - int arg4 ; - int arg5 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val4 ; - int ecode4 = 0 ; - int val5 ; - int ecode5 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOO:Canvas_downsize_video",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_downsize_video" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_int, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_downsize_video" "', argument " "2"" of type '" "unsigned int *""'"); - } - arg2 = reinterpret_cast< unsigned int * >(argp2); - { - // todo- Error checking would be nice. - PyGObject* pygo = (PyGObject*)obj2; - GstBuffer* buf = (GstBuffer*)pygo->obj; - arg3 = buf; - } - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Canvas_downsize_video" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - ecode5 = SWIG_AsVal_int(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Canvas_downsize_video" "', argument " "5"" of type '" "int""'"); - } - arg5 = static_cast< int >(val5); - (arg1)->downsize_video(arg2,arg3,arg4,arg5); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_videopaint_motion(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - GstBuffer *arg2 = (GstBuffer *) 0 ; - int arg3 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Canvas_videopaint_motion",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_videopaint_motion" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - { - // todo- Error checking would be nice. - PyGObject* pygo = (PyGObject*)obj1; - GstBuffer* buf = (GstBuffer*)pygo->obj; - arg2 = buf; - } - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Canvas_videopaint_motion" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Canvas_videopaint_motion" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - (arg1)->videopaint_motion(arg2,arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_blit_videopaint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - GdkImage *arg2 = (GdkImage *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_blit_videopaint",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_blit_videopaint" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - { - // todo- Error checking would be nice. - PyGObject* pygo = (PyGObject*)obj1; - GdkImage* img = (GdkImage*)pygo->obj; - arg2 = img; - } - (arg1)->blit_videopaint(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_set_reference_buffer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - GstBuffer *arg2 = (GstBuffer *) 0 ; - int arg3 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Canvas_set_reference_buffer",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_set_reference_buffer" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - { - // todo- Error checking would be nice. - PyGObject* pygo = (PyGObject*)obj1; - GstBuffer* buf = (GstBuffer*)pygo->obj; - arg2 = buf; - } - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Canvas_set_reference_buffer" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Canvas_set_reference_buffer" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - (arg1)->set_reference_buffer(arg2,arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_render_reference_overlay(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_render_reference_overlay",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_render_reference_overlay" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - (arg1)->render_reference_overlay(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_render_overlay(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_render_overlay",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_render_overlay" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - (arg1)->render_overlay(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_clear_overlay(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Canvas_clear_overlay",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_clear_overlay" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - (arg1)->clear_overlay(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_upgrade_drw_header(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - DRW_Header *arg2 = (DRW_Header *) 0 ; - DRW_Command *arg3 = (DRW_Command *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Canvas_upgrade_drw_header",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_upgrade_drw_header" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_DRW_Header, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_upgrade_drw_header" "', argument " "2"" of type '" "DRW_Header *""'"); - } - arg2 = reinterpret_cast< DRW_Header * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_DRW_Command, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Canvas_upgrade_drw_header" "', argument " "3"" of type '" "DRW_Command *""'"); - } - arg3 = reinterpret_cast< DRW_Command * >(argp3); - (arg1)->upgrade_drw_header(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_load(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - char *arg2 = (char *) 0 ; - bool result; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_load",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_load" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_load" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - result = (bool)(arg1)->load((char const *)arg2); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_save(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - char *arg2 = (char *) 0 ; - bool result; - void *argp1 = 0 ; - int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Canvas_save",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_save" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_save" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - result = (bool)(arg1)->save((char const *)arg2); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return resultobj; -fail: - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_convert_from_drw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - DRW_Command *arg2 = (DRW_Command *) 0 ; - int arg3 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Canvas_convert_from_drw",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_convert_from_drw" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_DRW_Command, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_convert_from_drw" "', argument " "2"" of type '" "DRW_Command *""'"); - } - arg2 = reinterpret_cast< DRW_Command * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Canvas_convert_from_drw" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Canvas_convert_from_drw" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - (arg1)->convert_from_drw(arg2,arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_convert_to_drw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - DRW_Command **arg2 = (DRW_Command **) 0 ; - int arg3 ; - int arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Canvas_convert_to_drw",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_convert_to_drw" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_DRW_Command, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_convert_to_drw" "', argument " "2"" of type '" "DRW_Command **""'"); - } - arg2 = reinterpret_cast< DRW_Command ** >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Canvas_convert_to_drw" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - ecode4 = SWIG_AsVal_int(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Canvas_convert_to_drw" "', argument " "4"" of type '" "int""'"); - } - arg4 = static_cast< int >(val4); - (arg1)->convert_to_drw(arg2,arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_send_drw_commands(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - int arg2 ; - int arg3 ; - DrawCommandBuffer result; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Canvas_send_drw_commands",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_send_drw_commands" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Canvas_send_drw_commands" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Canvas_send_drw_commands" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - result = (arg1)->send_drw_commands(arg2,arg3); - resultobj = SWIG_NewPointerObj((new DrawCommandBuffer(static_cast< const DrawCommandBuffer& >(result))), SWIGTYPE_p_DrawCommandBuffer, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Canvas_receive_drw_commands(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Canvas *arg1 = (Canvas *) 0 ; - DrawCommandBuffer *arg2 = 0 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Canvas_receive_drw_commands",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_receive_drw_commands" "', argument " "1"" of type '" "Canvas *""'"); - } - arg1 = reinterpret_cast< Canvas * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_DrawCommandBuffer, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Canvas_receive_drw_commands" "', argument " "2"" of type '" "DrawCommandBuffer const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Canvas_receive_drw_commands" "', argument " "2"" of type '" "DrawCommandBuffer const &""'"); - } - arg2 = reinterpret_cast< DrawCommandBuffer * >(argp2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Canvas_receive_drw_commands" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - (arg1)->receive_drw_commands((DrawCommandBuffer const &)*arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Canvas_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_Canvas, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_Palette_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Palette_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_size_set" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Palette_size_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->size = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Palette_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_size_get" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - result = (int) ((arg1)->size); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_palette_h_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Palette_palette_h_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_palette_h_set" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Palette_palette_h_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->palette_h = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_palette_h_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Palette_palette_h_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_palette_h_get" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - result = (float) ((arg1)->palette_h); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_palette_s_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Palette_palette_s_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_palette_s_set" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Palette_palette_s_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->palette_s = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_palette_s_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Palette_palette_s_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_palette_s_get" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - result = (float) ((arg1)->palette_s); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_palette_v_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - float arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Palette_palette_v_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_palette_v_set" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Palette_palette_v_set" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - if (arg1) (arg1)->palette_v = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_palette_v_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Palette_palette_v_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_palette_v_get" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - result = (float) ((arg1)->palette_v); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_triangle_cursor_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - Pos *arg2 = (Pos *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Palette_triangle_cursor_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_triangle_cursor_set" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Palette_triangle_cursor_set" "', argument " "2"" of type '" "Pos *""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - if (arg1) (arg1)->triangle_cursor = *arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_triangle_cursor_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - Pos *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Palette_triangle_cursor_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_triangle_cursor_get" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - result = (Pos *)& ((arg1)->triangle_cursor); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Pos, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_triangle_capture_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Palette_triangle_capture_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_triangle_capture_set" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Palette_triangle_capture_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->triangle_capture = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_triangle_capture_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - bool result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Palette_triangle_capture_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_triangle_capture_get" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - result = (bool) ((arg1)->triangle_capture); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_wheel_capture_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - bool arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - bool val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Palette_wheel_capture_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_wheel_capture_set" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - ecode2 = SWIG_AsVal_bool(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Palette_wheel_capture_set" "', argument " "2"" of type '" "bool""'"); - } - arg2 = static_cast< bool >(val2); - if (arg1) (arg1)->wheel_capture = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_wheel_capture_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - bool result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Palette_wheel_capture_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_wheel_capture_get" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - result = (bool) ((arg1)->wheel_capture); - resultobj = SWIG_From_bool(static_cast< bool >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_Palette(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - Palette *result = 0 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_Palette",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Palette" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - result = (Palette *)new Palette(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Palette, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_get_wheel_radius(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Palette_get_wheel_radius",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_get_wheel_radius" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - result = (float)(arg1)->get_wheel_radius(); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_rgb_to_hsv(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - float arg2 ; - float arg3 ; - float arg4 ; - float *arg5 = (float *) 0 ; - float *arg6 = (float *) 0 ; - float *arg7 = (float *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - float val3 ; - int ecode3 = 0 ; - float val4 ; - int ecode4 = 0 ; - void *argp5 = 0 ; - int res5 = 0 ; - void *argp6 = 0 ; - int res6 = 0 ; - void *argp7 = 0 ; - int res7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:Palette_rgb_to_hsv",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_rgb_to_hsv" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Palette_rgb_to_hsv" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - ecode3 = SWIG_AsVal_float(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Palette_rgb_to_hsv" "', argument " "3"" of type '" "float""'"); - } - arg3 = static_cast< float >(val3); - ecode4 = SWIG_AsVal_float(obj3, &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Palette_rgb_to_hsv" "', argument " "4"" of type '" "float""'"); - } - arg4 = static_cast< float >(val4); - res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res5)) { - SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Palette_rgb_to_hsv" "', argument " "5"" of type '" "float *""'"); - } - arg5 = reinterpret_cast< float * >(argp5); - res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res6)) { - SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Palette_rgb_to_hsv" "', argument " "6"" of type '" "float *""'"); - } - arg6 = reinterpret_cast< float * >(argp6); - res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res7)) { - SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Palette_rgb_to_hsv" "', argument " "7"" of type '" "float *""'"); - } - arg7 = reinterpret_cast< float * >(argp7); - (arg1)->rgb_to_hsv(arg2,arg3,arg4,arg5,arg6,arg7); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_hsv_to_rgb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - float *arg2 = (float *) 0 ; - float *arg3 = (float *) 0 ; - float *arg4 = (float *) 0 ; - float arg5 ; - float arg6 ; - float arg7 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - float val5 ; - int ecode5 = 0 ; - float val6 ; - int ecode6 = 0 ; - float val7 ; - int ecode7 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject * obj4 = 0 ; - PyObject * obj5 = 0 ; - PyObject * obj6 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:Palette_hsv_to_rgb",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_hsv_to_rgb" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Palette_hsv_to_rgb" "', argument " "2"" of type '" "float *""'"); - } - arg2 = reinterpret_cast< float * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Palette_hsv_to_rgb" "', argument " "3"" of type '" "float *""'"); - } - arg3 = reinterpret_cast< float * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_float, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Palette_hsv_to_rgb" "', argument " "4"" of type '" "float *""'"); - } - arg4 = reinterpret_cast< float * >(argp4); - ecode5 = SWIG_AsVal_float(obj4, &val5); - if (!SWIG_IsOK(ecode5)) { - SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Palette_hsv_to_rgb" "', argument " "5"" of type '" "float""'"); - } - arg5 = static_cast< float >(val5); - ecode6 = SWIG_AsVal_float(obj5, &val6); - if (!SWIG_IsOK(ecode6)) { - SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Palette_hsv_to_rgb" "', argument " "6"" of type '" "float""'"); - } - arg6 = static_cast< float >(val6); - ecode7 = SWIG_AsVal_float(obj6, &val7); - if (!SWIG_IsOK(ecode7)) { - SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Palette_hsv_to_rgb" "', argument " "7"" of type '" "float""'"); - } - arg7 = static_cast< float >(val7); - (arg1)->hsv_to_rgb(arg2,arg3,arg4,arg5,arg6,arg7); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_set_color(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - Color *arg2 = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Palette_set_color",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_set_color" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Color, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Palette_set_color" "', argument " "2"" of type '" "Color const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Palette_set_color" "', argument " "2"" of type '" "Color const &""'"); - } - arg2 = reinterpret_cast< Color * >(argp2); - (arg1)->set_color((Color const &)*arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_get_color(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - Color result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Palette_get_color",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_get_color" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - result = (arg1)->get_color(); - resultobj = SWIG_NewPointerObj((new Color(static_cast< const Color& >(result))), SWIGTYPE_p_Color, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - float arg2 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - float val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Palette_sqr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_sqr" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - ecode2 = SWIG_AsVal_float(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Palette_sqr" "', argument " "2"" of type '" "float""'"); - } - arg2 = static_cast< float >(val2); - result = (float)(arg1)->sqr(arg2); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_dot(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - Pos *arg2 = 0 ; - Pos *arg3 = 0 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Palette_dot",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_dot" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Palette_dot" "', argument " "2"" of type '" "Pos const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Palette_dot" "', argument " "2"" of type '" "Pos const &""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Palette_dot" "', argument " "3"" of type '" "Pos const &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Palette_dot" "', argument " "3"" of type '" "Pos const &""'"); - } - arg3 = reinterpret_cast< Pos * >(argp3); - result = (float)(arg1)->dot((Pos const &)*arg2,(Pos const &)*arg3); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - Pos *arg2 = 0 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Palette_length",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_length" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Palette_length" "', argument " "2"" of type '" "Pos const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Palette_length" "', argument " "2"" of type '" "Pos const &""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - result = (float)(arg1)->length((Pos const &)*arg2); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_length_sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - Pos *arg2 = 0 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Palette_length_sqr",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_length_sqr" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Palette_length_sqr" "', argument " "2"" of type '" "Pos const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Palette_length_sqr" "', argument " "2"" of type '" "Pos const &""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - result = (float)(arg1)->length_sqr((Pos const &)*arg2); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_distance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - Pos *arg2 = 0 ; - Pos *arg3 = 0 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Palette_distance",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_distance" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Palette_distance" "', argument " "2"" of type '" "Pos const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Palette_distance" "', argument " "2"" of type '" "Pos const &""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Palette_distance" "', argument " "3"" of type '" "Pos const &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Palette_distance" "', argument " "3"" of type '" "Pos const &""'"); - } - arg3 = reinterpret_cast< Pos * >(argp3); - result = (float)(arg1)->distance((Pos const &)*arg2,(Pos const &)*arg3); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_distance_sqr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - Pos *arg2 = 0 ; - Pos *arg3 = 0 ; - float result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Palette_distance_sqr",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_distance_sqr" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Palette_distance_sqr" "', argument " "2"" of type '" "Pos const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Palette_distance_sqr" "', argument " "2"" of type '" "Pos const &""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Palette_distance_sqr" "', argument " "3"" of type '" "Pos const &""'"); - } - if (!argp3) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Palette_distance_sqr" "', argument " "3"" of type '" "Pos const &""'"); - } - arg3 = reinterpret_cast< Pos * >(argp3); - result = (float)(arg1)->distance_sqr((Pos const &)*arg2,(Pos const &)*arg3); - resultobj = SWIG_From_float(static_cast< float >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_normalize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - Pos *arg2 = 0 ; - Pos result; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Palette_normalize",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_normalize" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_Pos, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Palette_normalize" "', argument " "2"" of type '" "Pos const &""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Palette_normalize" "', argument " "2"" of type '" "Pos const &""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - result = (arg1)->normalize((Pos const &)*arg2); - resultobj = SWIG_NewPointerObj((new Pos(static_cast< const Pos& >(result))), SWIGTYPE_p_Pos, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_get_triangle_points(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - Pos *arg2 = (Pos *) 0 ; - Pos *arg3 = (Pos *) 0 ; - Pos *arg4 = (Pos *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - void *argp4 = 0 ; - int res4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOOO:Palette_get_triangle_points",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_get_triangle_points" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Palette_get_triangle_points" "', argument " "2"" of type '" "Pos *""'"); - } - arg2 = reinterpret_cast< Pos * >(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Palette_get_triangle_points" "', argument " "3"" of type '" "Pos *""'"); - } - arg3 = reinterpret_cast< Pos * >(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Pos, 0 | 0 ); - if (!SWIG_IsOK(res4)) { - SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Palette_get_triangle_points" "', argument " "4"" of type '" "Pos *""'"); - } - arg4 = reinterpret_cast< Pos * >(argp4); - (arg1)->get_triangle_points(arg2,arg3,arg4); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_render_wheel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - GdkImage *arg2 = (GdkImage *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Palette_render_wheel",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_render_wheel" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - { - // todo- Error checking would be nice. - PyGObject* pygo = (PyGObject*)obj1; - GdkImage* img = (GdkImage*)pygo->obj; - arg2 = img; - } - (arg1)->render_wheel(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_render_triangle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - GdkImage *arg2 = (GdkImage *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:Palette_render_triangle",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_render_triangle" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - { - // todo- Error checking would be nice. - PyGObject* pygo = (PyGObject*)obj1; - GdkImage* img = (GdkImage*)pygo->obj; - arg2 = img; - } - (arg1)->render_triangle(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_get_wheel_pos(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - Pos result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Palette_get_wheel_pos",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_get_wheel_pos" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - result = (arg1)->get_wheel_pos(); - resultobj = SWIG_NewPointerObj((new Pos(static_cast< const Pos& >(result))), SWIGTYPE_p_Pos, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_get_triangle_pos(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - Pos result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Palette_get_triangle_pos",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_get_triangle_pos" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - result = (arg1)->get_triangle_pos(); - resultobj = SWIG_NewPointerObj((new Pos(static_cast< const Pos& >(result))), SWIGTYPE_p_Pos, SWIG_POINTER_OWN | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_process_mouse(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - int arg2 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OOO:Palette_process_mouse",&obj0,&obj1,&obj2)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_process_mouse" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Palette_process_mouse" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int(obj2, &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Palette_process_mouse" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - (arg1)->process_mouse(arg2,arg3); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_Palette_process_mouse_release(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:Palette_process_mouse_release",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Palette_process_mouse_release" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - (arg1)->process_mouse_release(); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_Palette(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - Palette *arg1 = (Palette *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_Palette",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Palette, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Palette" "', argument " "1"" of type '" "Palette *""'"); - } - arg1 = reinterpret_cast< Palette * >(argp1); - delete arg1; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *Palette_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_Palette, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -SWIGINTERN PyObject *_wrap_BrushPreview_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - BrushPreview *arg1 = (BrushPreview *) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:BrushPreview_size_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BrushPreview, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BrushPreview_size_set" "', argument " "1"" of type '" "BrushPreview *""'"); - } - arg1 = reinterpret_cast< BrushPreview * >(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BrushPreview_size_set" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - if (arg1) (arg1)->size = arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BrushPreview_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - BrushPreview *arg1 = (BrushPreview *) 0 ; - int result; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:BrushPreview_size_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BrushPreview, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BrushPreview_size_get" "', argument " "1"" of type '" "BrushPreview *""'"); - } - arg1 = reinterpret_cast< BrushPreview * >(argp1); - result = (int) ((arg1)->size); - resultobj = SWIG_From_int(static_cast< int >(result)); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BrushPreview_brush_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - BrushPreview *arg1 = (BrushPreview *) 0 ; - Brush *arg2 = (Brush *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:BrushPreview_brush_set",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BrushPreview, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BrushPreview_brush_set" "', argument " "1"" of type '" "BrushPreview *""'"); - } - arg1 = reinterpret_cast< BrushPreview * >(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Brush, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "BrushPreview_brush_set" "', argument " "2"" of type '" "Brush *""'"); - } - arg2 = reinterpret_cast< Brush * >(argp2); - if (arg1) (arg1)->brush = *arg2; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BrushPreview_brush_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - BrushPreview *arg1 = (BrushPreview *) 0 ; - Brush *result = 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:BrushPreview_brush_get",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BrushPreview, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BrushPreview_brush_get" "', argument " "1"" of type '" "BrushPreview *""'"); - } - arg1 = reinterpret_cast< BrushPreview * >(argp1); - result = (Brush *)& ((arg1)->brush); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Brush, 0 | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_new_BrushPreview(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - int arg1 ; - BrushPreview *result = 0 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:new_BrushPreview",&obj0)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_BrushPreview" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - result = (BrushPreview *)new BrushPreview(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BrushPreview, SWIG_POINTER_NEW | 0 ); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_BrushPreview_render(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - BrushPreview *arg1 = (BrushPreview *) 0 ; - GdkImage *arg2 = (GdkImage *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"OO:BrushPreview_render",&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BrushPreview, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BrushPreview_render" "', argument " "1"" of type '" "BrushPreview *""'"); - } - arg1 = reinterpret_cast< BrushPreview * >(argp1); - { - // todo- Error checking would be nice. - PyGObject* pygo = (PyGObject*)obj1; - GdkImage* img = (GdkImage*)pygo->obj; - arg2 = img; - } - (arg1)->render(arg2); - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *_wrap_delete_BrushPreview(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *resultobj = 0; - BrushPreview *arg1 = (BrushPreview *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - - if (!PyArg_ParseTuple(args,(char *)"O:delete_BrushPreview",&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BrushPreview, SWIG_POINTER_DISOWN | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_BrushPreview" "', argument " "1"" of type '" "BrushPreview *""'"); - } - arg1 = reinterpret_cast< BrushPreview * >(argp1); - delete arg1; - - resultobj = SWIG_Py_Void(); - return resultobj; -fail: - return NULL; -} - - -SWIGINTERN PyObject *BrushPreview_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { - PyObject *obj; - if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; - SWIG_TypeNewClientData(SWIGTYPE_p_BrushPreview, SWIG_NewClientData(obj)); - return SWIG_Py_Void(); -} - -static PyMethodDef SwigMethods[] = { - { (char *)"sgn", _wrap_sgn, METH_VARARGS, NULL}, - { (char *)"sqr", _wrap_sqr, METH_VARARGS, NULL}, - { (char *)"clamp", _wrap_clamp, METH_VARARGS, NULL}, - { (char *)"to_rad", _wrap_to_rad, METH_VARARGS, NULL}, - { (char *)"to_deg", _wrap_to_deg, METH_VARARGS, NULL}, - { (char *)"map_range", _wrap_map_range, METH_VARARGS, NULL}, - { (char *)"fixed_scale", _wrap_fixed_scale, METH_VARARGS, NULL}, - { (char *)"endian_swap", _wrap_endian_swap, METH_VARARGS, NULL}, - { (char *)"Pos_x_set", _wrap_Pos_x_set, METH_VARARGS, NULL}, - { (char *)"Pos_x_get", _wrap_Pos_x_get, METH_VARARGS, NULL}, - { (char *)"Pos_y_set", _wrap_Pos_y_set, METH_VARARGS, NULL}, - { (char *)"Pos_y_get", _wrap_Pos_y_get, METH_VARARGS, NULL}, - { (char *)"new_Pos", _wrap_new_Pos, METH_VARARGS, NULL}, - { (char *)"Pos___add__", _wrap_Pos___add__, METH_VARARGS, NULL}, - { (char *)"Pos___sub__", _wrap_Pos___sub__, METH_VARARGS, NULL}, - { (char *)"Pos___mul__", _wrap_Pos___mul__, METH_VARARGS, NULL}, - { (char *)"Pos___div__", _wrap_Pos___div__, METH_VARARGS, NULL}, - { (char *)"Pos_create_from_min", _wrap_Pos_create_from_min, METH_VARARGS, NULL}, - { (char *)"Pos_create_from_max", _wrap_Pos_create_from_max, METH_VARARGS, NULL}, - { (char *)"Pos_create_from_angle", _wrap_Pos_create_from_angle, METH_VARARGS, NULL}, - { (char *)"Pos_create_from_rotation", _wrap_Pos_create_from_rotation, METH_VARARGS, NULL}, - { (char *)"delete_Pos", _wrap_delete_Pos, METH_VARARGS, NULL}, - { (char *)"Pos_swigregister", Pos_swigregister, METH_VARARGS, NULL}, - { (char *)"Color_r_set", _wrap_Color_r_set, METH_VARARGS, NULL}, - { (char *)"Color_r_get", _wrap_Color_r_get, METH_VARARGS, NULL}, - { (char *)"Color_g_set", _wrap_Color_g_set, METH_VARARGS, NULL}, - { (char *)"Color_g_get", _wrap_Color_g_get, METH_VARARGS, NULL}, - { (char *)"Color_b_set", _wrap_Color_b_set, METH_VARARGS, NULL}, - { (char *)"Color_b_get", _wrap_Color_b_get, METH_VARARGS, NULL}, - { (char *)"Color_a_set", _wrap_Color_a_set, METH_VARARGS, NULL}, - { (char *)"Color_a_get", _wrap_Color_a_get, METH_VARARGS, NULL}, - { (char *)"new_Color", _wrap_new_Color, METH_VARARGS, NULL}, - { (char *)"Color_get_a8r8g8b8", _wrap_Color_get_a8r8g8b8, METH_VARARGS, NULL}, - { (char *)"Color_create_from_a8r8g8b8", _wrap_Color_create_from_a8r8g8b8, METH_VARARGS, NULL}, - { (char *)"Color_get_a8b8g8r8", _wrap_Color_get_a8b8g8r8, METH_VARARGS, NULL}, - { (char *)"Color_create_from_a8b8g8r8", _wrap_Color_create_from_a8b8g8r8, METH_VARARGS, NULL}, - { (char *)"Color_get_r5g6b5", _wrap_Color_get_r5g6b5, METH_VARARGS, NULL}, - { (char *)"Color_create_from_r5g6b5", _wrap_Color_create_from_r5g6b5, METH_VARARGS, NULL}, - { (char *)"Color_get_b5g6r5", _wrap_Color_get_b5g6r5, METH_VARARGS, NULL}, - { (char *)"Color_create_from_float", _wrap_Color_create_from_float, METH_VARARGS, NULL}, - { (char *)"Color_create_from_blend", _wrap_Color_create_from_blend, METH_VARARGS, NULL}, - { (char *)"Color_create_from_lerp", _wrap_Color_create_from_lerp, METH_VARARGS, NULL}, - { (char *)"Color_create_from_yuv", _wrap_Color_create_from_yuv, METH_VARARGS, NULL}, - { (char *)"Color_yuv_to_hsv", _wrap_Color_yuv_to_hsv, METH_VARARGS, NULL}, - { (char *)"delete_Color", _wrap_delete_Color, METH_VARARGS, NULL}, - { (char *)"Color_swigregister", Color_swigregister, METH_VARARGS, NULL}, - { (char *)"ByteBuffer_size_set", _wrap_ByteBuffer_size_set, METH_VARARGS, NULL}, - { (char *)"ByteBuffer_size_get", _wrap_ByteBuffer_size_get, METH_VARARGS, NULL}, - { (char *)"ByteBuffer_data_set", _wrap_ByteBuffer_data_set, METH_VARARGS, NULL}, - { (char *)"ByteBuffer_data_get", _wrap_ByteBuffer_data_get, METH_VARARGS, NULL}, - { (char *)"new_ByteBuffer", _wrap_new_ByteBuffer, METH_VARARGS, NULL}, - { (char *)"delete_ByteBuffer", _wrap_delete_ByteBuffer, METH_VARARGS, NULL}, - { (char *)"ByteBuffer_swigregister", ByteBuffer_swigregister, METH_VARARGS, NULL}, - { (char *)"SurfaceA8R8G8B8_width_set", _wrap_SurfaceA8R8G8B8_width_set, METH_VARARGS, NULL}, - { (char *)"SurfaceA8R8G8B8_width_get", _wrap_SurfaceA8R8G8B8_width_get, METH_VARARGS, NULL}, - { (char *)"SurfaceA8R8G8B8_height_set", _wrap_SurfaceA8R8G8B8_height_set, METH_VARARGS, NULL}, - { (char *)"SurfaceA8R8G8B8_height_get", _wrap_SurfaceA8R8G8B8_height_get, METH_VARARGS, NULL}, - { (char *)"SurfaceA8R8G8B8_stride_set", _wrap_SurfaceA8R8G8B8_stride_set, METH_VARARGS, NULL}, - { (char *)"SurfaceA8R8G8B8_stride_get", _wrap_SurfaceA8R8G8B8_stride_get, METH_VARARGS, NULL}, - { (char *)"SurfaceA8R8G8B8_pixels_set", _wrap_SurfaceA8R8G8B8_pixels_set, METH_VARARGS, NULL}, - { (char *)"SurfaceA8R8G8B8_pixels_get", _wrap_SurfaceA8R8G8B8_pixels_get, METH_VARARGS, NULL}, - { (char *)"new_SurfaceA8R8G8B8", _wrap_new_SurfaceA8R8G8B8, METH_VARARGS, NULL}, - { (char *)"delete_SurfaceA8R8G8B8", _wrap_delete_SurfaceA8R8G8B8, METH_VARARGS, NULL}, - { (char *)"SurfaceA8R8G8B8_swigregister", SurfaceA8R8G8B8_swigregister, METH_VARARGS, NULL}, - { (char *)"new_DrawCommandBuffer", _wrap_new_DrawCommandBuffer, METH_VARARGS, NULL}, - { (char *)"delete_DrawCommandBuffer", _wrap_delete_DrawCommandBuffer, METH_VARARGS, NULL}, - { (char *)"DrawCommandBuffer_append", _wrap_DrawCommandBuffer_append, METH_VARARGS, NULL}, - { (char *)"DrawCommandBuffer_clear", _wrap_DrawCommandBuffer_clear, METH_VARARGS, NULL}, - { (char *)"DrawCommandBuffer_get_bytes", _wrap_DrawCommandBuffer_get_bytes, METH_VARARGS, NULL}, - { (char *)"DrawCommandBuffer_cmds_set", _wrap_DrawCommandBuffer_cmds_set, METH_VARARGS, NULL}, - { (char *)"DrawCommandBuffer_cmds_get", _wrap_DrawCommandBuffer_cmds_get, METH_VARARGS, NULL}, - { (char *)"DrawCommandBuffer_ncommands_set", _wrap_DrawCommandBuffer_ncommands_set, METH_VARARGS, NULL}, - { (char *)"DrawCommandBuffer_ncommands_get", _wrap_DrawCommandBuffer_ncommands_get, METH_VARARGS, NULL}, - { (char *)"DrawCommandBuffer_create_from_string", _wrap_DrawCommandBuffer_create_from_string, METH_VARARGS, NULL}, - { (char *)"DrawCommandBuffer_swigregister", DrawCommandBuffer_swigregister, METH_VARARGS, NULL}, - { (char *)"DrawCommand_type_set", _wrap_DrawCommand_type_set, METH_VARARGS, NULL}, - { (char *)"DrawCommand_type_get", _wrap_DrawCommand_type_get, METH_VARARGS, NULL}, - { (char *)"DrawCommand_pos_set", _wrap_DrawCommand_pos_set, METH_VARARGS, NULL}, - { (char *)"DrawCommand_pos_get", _wrap_DrawCommand_pos_get, METH_VARARGS, NULL}, - { (char *)"DrawCommand_color_set", _wrap_DrawCommand_color_set, METH_VARARGS, NULL}, - { (char *)"DrawCommand_color_get", _wrap_DrawCommand_color_get, METH_VARARGS, NULL}, - { (char *)"DrawCommand_pressure_set", _wrap_DrawCommand_pressure_set, METH_VARARGS, NULL}, - { (char *)"DrawCommand_pressure_get", _wrap_DrawCommand_pressure_get, METH_VARARGS, NULL}, - { (char *)"DrawCommand_flipx_set", _wrap_DrawCommand_flipx_set, METH_VARARGS, NULL}, - { (char *)"DrawCommand_flipx_get", _wrap_DrawCommand_flipx_get, METH_VARARGS, NULL}, - { (char *)"DrawCommand_flipy_set", _wrap_DrawCommand_flipy_set, METH_VARARGS, NULL}, - { (char *)"DrawCommand_flipy_get", _wrap_DrawCommand_flipy_get, METH_VARARGS, NULL}, - { (char *)"DrawCommand_is_text_set", _wrap_DrawCommand_is_text_set, METH_VARARGS, NULL}, - { (char *)"DrawCommand_is_text_get", _wrap_DrawCommand_is_text_get, METH_VARARGS, NULL}, - { (char *)"DrawCommand_text_set", _wrap_DrawCommand_text_set, METH_VARARGS, NULL}, - { (char *)"DrawCommand_text_get", _wrap_DrawCommand_text_get, METH_VARARGS, NULL}, - { (char *)"DrawCommand_brush_control_set", _wrap_DrawCommand_brush_control_set, METH_VARARGS, NULL}, - { (char *)"DrawCommand_brush_control_get", _wrap_DrawCommand_brush_control_get, METH_VARARGS, NULL}, - { (char *)"DrawCommand_brush_type_set", _wrap_DrawCommand_brush_type_set, METH_VARARGS, NULL}, - { (char *)"DrawCommand_brush_type_get", _wrap_DrawCommand_brush_type_get, METH_VARARGS, NULL}, - { (char *)"DrawCommand_size_set", _wrap_DrawCommand_size_set, METH_VARARGS, NULL}, - { (char *)"DrawCommand_size_get", _wrap_DrawCommand_size_get, METH_VARARGS, NULL}, - { (char *)"DrawCommand_opacity_set", _wrap_DrawCommand_opacity_set, METH_VARARGS, NULL}, - { (char *)"DrawCommand_opacity_get", _wrap_DrawCommand_opacity_get, METH_VARARGS, NULL}, - { (char *)"new_DrawCommand", _wrap_new_DrawCommand, METH_VARARGS, NULL}, - { (char *)"DrawCommand_create_color_change", _wrap_DrawCommand_create_color_change, METH_VARARGS, NULL}, - { (char *)"DrawCommand_create_draw", _wrap_DrawCommand_create_draw, METH_VARARGS, NULL}, - { (char *)"DrawCommand_create_end_draw", _wrap_DrawCommand_create_end_draw, METH_VARARGS, NULL}, - { (char *)"DrawCommand_create_size_change", _wrap_DrawCommand_create_size_change, METH_VARARGS, NULL}, - { (char *)"DrawCommand_create_flip", _wrap_DrawCommand_create_flip, METH_VARARGS, NULL}, - { (char *)"delete_DrawCommand", _wrap_delete_DrawCommand, METH_VARARGS, NULL}, - { (char *)"DrawCommand_swigregister", DrawCommand_swigregister, METH_VARARGS, NULL}, - { (char *)"BrushType_distance_tbl_get", _wrap_BrushType_distance_tbl_get, METH_VARARGS, NULL}, - { (char *)"BrushType_distance_tbl_set", _wrap_BrushType_distance_tbl_set, METH_VARARGS, NULL}, - { (char *)"BrushType_intensity_tbl_set", _wrap_BrushType_intensity_tbl_set, METH_VARARGS, NULL}, - { (char *)"BrushType_intensity_tbl_get", _wrap_BrushType_intensity_tbl_get, METH_VARARGS, NULL}, - { (char *)"BrushType_create_distance_table", _wrap_BrushType_create_distance_table, METH_VARARGS, NULL}, - { (char *)"BrushType_smooth_step", _wrap_BrushType_smooth_step, METH_VARARGS, NULL}, - { (char *)"BrushType_create_brush", _wrap_BrushType_create_brush, METH_VARARGS, NULL}, - { (char *)"BrushType_create_hard_brush", _wrap_BrushType_create_hard_brush, METH_VARARGS, NULL}, - { (char *)"BrushType_create_soft_brush", _wrap_BrushType_create_soft_brush, METH_VARARGS, NULL}, - { (char *)"BrushType_create_cursor", _wrap_BrushType_create_cursor, METH_VARARGS, NULL}, - { (char *)"new_BrushType", _wrap_new_BrushType, METH_VARARGS, NULL}, - { (char *)"delete_BrushType", _wrap_delete_BrushType, METH_VARARGS, NULL}, - { (char *)"BrushType_swigregister", BrushType_swigregister, METH_VARARGS, NULL}, - { (char *)"Brush_brush_type_get", _wrap_Brush_brush_type_get, METH_VARARGS, NULL}, - { (char *)"Brush_brush_type_set", _wrap_Brush_brush_type_set, METH_VARARGS, NULL}, - { (char *)"Brush_color_set", _wrap_Brush_color_set, METH_VARARGS, NULL}, - { (char *)"Brush_color_get", _wrap_Brush_color_get, METH_VARARGS, NULL}, - { (char *)"Brush_type_set", _wrap_Brush_type_set, METH_VARARGS, NULL}, - { (char *)"Brush_type_get", _wrap_Brush_type_get, METH_VARARGS, NULL}, - { (char *)"Brush_size_set", _wrap_Brush_size_set, METH_VARARGS, NULL}, - { (char *)"Brush_size_get", _wrap_Brush_size_get, METH_VARARGS, NULL}, - { (char *)"Brush_control_set", _wrap_Brush_control_set, METH_VARARGS, NULL}, - { (char *)"Brush_control_get", _wrap_Brush_control_get, METH_VARARGS, NULL}, - { (char *)"Brush_opacity_set", _wrap_Brush_opacity_set, METH_VARARGS, NULL}, - { (char *)"Brush_opacity_get", _wrap_Brush_opacity_get, METH_VARARGS, NULL}, - { (char *)"new_Brush", _wrap_new_Brush, METH_VARARGS, NULL}, - { (char *)"delete_Brush", _wrap_delete_Brush, METH_VARARGS, NULL}, - { (char *)"Brush_swigregister", Brush_swigregister, METH_VARARGS, NULL}, - { (char *)"Canvas_commands_set", _wrap_Canvas_commands_set, METH_VARARGS, NULL}, - { (char *)"Canvas_commands_get", _wrap_Canvas_commands_get, METH_VARARGS, NULL}, - { (char *)"Canvas_width_set", _wrap_Canvas_width_set, METH_VARARGS, NULL}, - { (char *)"Canvas_width_get", _wrap_Canvas_width_get, METH_VARARGS, NULL}, - { (char *)"Canvas_height_set", _wrap_Canvas_height_set, METH_VARARGS, NULL}, - { (char *)"Canvas_height_get", _wrap_Canvas_height_get, METH_VARARGS, NULL}, - { (char *)"Canvas_image_set", _wrap_Canvas_image_set, METH_VARARGS, NULL}, - { (char *)"Canvas_image_get", _wrap_Canvas_image_get, METH_VARARGS, NULL}, - { (char *)"Canvas_image_backup_set", _wrap_Canvas_image_backup_set, METH_VARARGS, NULL}, - { (char *)"Canvas_image_backup_get", _wrap_Canvas_image_backup_get, METH_VARARGS, NULL}, - { (char *)"Canvas_alpha_set", _wrap_Canvas_alpha_set, METH_VARARGS, NULL}, - { (char *)"Canvas_alpha_get", _wrap_Canvas_alpha_get, METH_VARARGS, NULL}, - { (char *)"Canvas_image_shared_set", _wrap_Canvas_image_shared_set, METH_VARARGS, NULL}, - { (char *)"Canvas_image_shared_get", _wrap_Canvas_image_shared_get, METH_VARARGS, NULL}, - { (char *)"Canvas_image_reference_set", _wrap_Canvas_image_reference_set, METH_VARARGS, NULL}, - { (char *)"Canvas_image_reference_get", _wrap_Canvas_image_reference_get, METH_VARARGS, NULL}, - { (char *)"Canvas_image_video_set", _wrap_Canvas_image_video_set, METH_VARARGS, NULL}, - { (char *)"Canvas_image_video_get", _wrap_Canvas_image_video_get, METH_VARARGS, NULL}, - { (char *)"Canvas_video_idx_set", _wrap_Canvas_video_idx_set, METH_VARARGS, NULL}, - { (char *)"Canvas_video_idx_get", _wrap_Canvas_video_idx_get, METH_VARARGS, NULL}, - { (char *)"Canvas_videopaint_pos_set", _wrap_Canvas_videopaint_pos_set, METH_VARARGS, NULL}, - { (char *)"Canvas_videopaint_pos_get", _wrap_Canvas_videopaint_pos_get, METH_VARARGS, NULL}, - { (char *)"Canvas_videopaint_pressure_set", _wrap_Canvas_videopaint_pressure_set, METH_VARARGS, NULL}, - { (char *)"Canvas_videopaint_pressure_get", _wrap_Canvas_videopaint_pressure_get, METH_VARARGS, NULL}, - { (char *)"Canvas_brush_set", _wrap_Canvas_brush_set, METH_VARARGS, NULL}, - { (char *)"Canvas_brush_get", _wrap_Canvas_brush_get, METH_VARARGS, NULL}, - { (char *)"Canvas_lastpos_set", _wrap_Canvas_lastpos_set, METH_VARARGS, NULL}, - { (char *)"Canvas_lastpos_get", _wrap_Canvas_lastpos_get, METH_VARARGS, NULL}, - { (char *)"Canvas_lastorgpos_set", _wrap_Canvas_lastorgpos_set, METH_VARARGS, NULL}, - { (char *)"Canvas_lastorgpos_get", _wrap_Canvas_lastorgpos_get, METH_VARARGS, NULL}, - { (char *)"Canvas_lastpressure_set", _wrap_Canvas_lastpressure_set, METH_VARARGS, NULL}, - { (char *)"Canvas_lastpressure_get", _wrap_Canvas_lastpressure_get, METH_VARARGS, NULL}, - { (char *)"Canvas_dirtymin_set", _wrap_Canvas_dirtymin_set, METH_VARARGS, NULL}, - { (char *)"Canvas_dirtymin_get", _wrap_Canvas_dirtymin_get, METH_VARARGS, NULL}, - { (char *)"Canvas_dirtymax_set", _wrap_Canvas_dirtymax_set, METH_VARARGS, NULL}, - { (char *)"Canvas_dirtymax_get", _wrap_Canvas_dirtymax_get, METH_VARARGS, NULL}, - { (char *)"Canvas_strokemin_set", _wrap_Canvas_strokemin_set, METH_VARARGS, NULL}, - { (char *)"Canvas_strokemin_get", _wrap_Canvas_strokemin_get, METH_VARARGS, NULL}, - { (char *)"Canvas_strokemax_set", _wrap_Canvas_strokemax_set, METH_VARARGS, NULL}, - { (char *)"Canvas_strokemax_get", _wrap_Canvas_strokemax_get, METH_VARARGS, NULL}, - { (char *)"Canvas_stroke_set", _wrap_Canvas_stroke_set, METH_VARARGS, NULL}, - { (char *)"Canvas_stroke_get", _wrap_Canvas_stroke_get, METH_VARARGS, NULL}, - { (char *)"Canvas_idle_while_drawing_set", _wrap_Canvas_idle_while_drawing_set, METH_VARARGS, NULL}, - { (char *)"Canvas_idle_while_drawing_get", _wrap_Canvas_idle_while_drawing_get, METH_VARARGS, NULL}, - { (char *)"Canvas_drawtype_set", _wrap_Canvas_drawtype_set, METH_VARARGS, NULL}, - { (char *)"Canvas_drawtype_get", _wrap_Canvas_drawtype_get, METH_VARARGS, NULL}, - { (char *)"Canvas_playing_set", _wrap_Canvas_playing_set, METH_VARARGS, NULL}, - { (char *)"Canvas_playing_get", _wrap_Canvas_playing_get, METH_VARARGS, NULL}, - { (char *)"Canvas_playback_set", _wrap_Canvas_playback_set, METH_VARARGS, NULL}, - { (char *)"Canvas_playback_get", _wrap_Canvas_playback_get, METH_VARARGS, NULL}, - { (char *)"Canvas_playback_speed_set", _wrap_Canvas_playback_speed_set, METH_VARARGS, NULL}, - { (char *)"Canvas_playback_speed_get", _wrap_Canvas_playback_speed_get, METH_VARARGS, NULL}, - { (char *)"Canvas_modified_set", _wrap_Canvas_modified_set, METH_VARARGS, NULL}, - { (char *)"Canvas_modified_get", _wrap_Canvas_modified_get, METH_VARARGS, NULL}, - { (char *)"new_Canvas", _wrap_new_Canvas, METH_VARARGS, NULL}, - { (char *)"delete_Canvas", _wrap_delete_Canvas, METH_VARARGS, NULL}, - { (char *)"Canvas_clear", _wrap_Canvas_clear, METH_VARARGS, NULL}, - { (char *)"Canvas_resize", _wrap_Canvas_resize, METH_VARARGS, NULL}, - { (char *)"Canvas_reset_brush", _wrap_Canvas_reset_brush, METH_VARARGS, NULL}, - { (char *)"Canvas_save_shared_image", _wrap_Canvas_save_shared_image, METH_VARARGS, NULL}, - { (char *)"Canvas_restore_shared_image", _wrap_Canvas_restore_shared_image, METH_VARARGS, NULL}, - { (char *)"Canvas_clear_image", _wrap_Canvas_clear_image, METH_VARARGS, NULL}, - { (char *)"Canvas_get_variable_brush_size", _wrap_Canvas_get_variable_brush_size, METH_VARARGS, NULL}, - { (char *)"Canvas_command_draw", _wrap_Canvas_command_draw, METH_VARARGS, NULL}, - { (char *)"Canvas_command_enddraw", _wrap_Canvas_command_enddraw, METH_VARARGS, NULL}, - { (char *)"Canvas_reset_dirty_rect", _wrap_Canvas_reset_dirty_rect, METH_VARARGS, NULL}, - { (char *)"Canvas_draw_brush", _wrap_Canvas_draw_brush, METH_VARARGS, NULL}, - { (char *)"Canvas_pickup_color", _wrap_Canvas_pickup_color, METH_VARARGS, NULL}, - { (char *)"Canvas_add_command", _wrap_Canvas_add_command, METH_VARARGS, NULL}, - { (char *)"Canvas_play_command", _wrap_Canvas_play_command, METH_VARARGS, NULL}, - { (char *)"Canvas_playback_done", _wrap_Canvas_playback_done, METH_VARARGS, NULL}, - { (char *)"Canvas_playback_length", _wrap_Canvas_playback_length, METH_VARARGS, NULL}, - { (char *)"Canvas_playback_pos", _wrap_Canvas_playback_pos, METH_VARARGS, NULL}, - { (char *)"Canvas_start_playback", _wrap_Canvas_start_playback, METH_VARARGS, NULL}, - { (char *)"Canvas_pause_playback", _wrap_Canvas_pause_playback, METH_VARARGS, NULL}, - { (char *)"Canvas_resume_playback", _wrap_Canvas_resume_playback, METH_VARARGS, NULL}, - { (char *)"Canvas_stop_playback", _wrap_Canvas_stop_playback, METH_VARARGS, NULL}, - { (char *)"Canvas_finish_playback", _wrap_Canvas_finish_playback, METH_VARARGS, NULL}, - { (char *)"Canvas_playback_finish_stroke", _wrap_Canvas_playback_finish_stroke, METH_VARARGS, NULL}, - { (char *)"Canvas_playback_to", _wrap_Canvas_playback_to, METH_VARARGS, NULL}, - { (char *)"Canvas_playback_step_to", _wrap_Canvas_playback_step_to, METH_VARARGS, NULL}, - { (char *)"Canvas_playback_to_timed", _wrap_Canvas_playback_to_timed, METH_VARARGS, NULL}, - { (char *)"Canvas_set_playback_speed", _wrap_Canvas_set_playback_speed, METH_VARARGS, NULL}, - { (char *)"Canvas_truncate_at_playback", _wrap_Canvas_truncate_at_playback, METH_VARARGS, NULL}, - { (char *)"Canvas_update_playback", _wrap_Canvas_update_playback, METH_VARARGS, NULL}, - { (char *)"Canvas_get_num_commands", _wrap_Canvas_get_num_commands, METH_VARARGS, NULL}, - { (char *)"Canvas_play_range", _wrap_Canvas_play_range, METH_VARARGS, NULL}, - { (char *)"Canvas_blit_1x", _wrap_Canvas_blit_1x, METH_VARARGS, NULL}, - { (char *)"Canvas_blit_2x", _wrap_Canvas_blit_2x, METH_VARARGS, NULL}, - { (char *)"Canvas_blit_4x", _wrap_Canvas_blit_4x, METH_VARARGS, NULL}, - { (char *)"Canvas_blit_8x", _wrap_Canvas_blit_8x, METH_VARARGS, NULL}, - { (char *)"Canvas_downsize_video", _wrap_Canvas_downsize_video, METH_VARARGS, NULL}, - { (char *)"Canvas_videopaint_motion", _wrap_Canvas_videopaint_motion, METH_VARARGS, NULL}, - { (char *)"Canvas_blit_videopaint", _wrap_Canvas_blit_videopaint, METH_VARARGS, NULL}, - { (char *)"Canvas_set_reference_buffer", _wrap_Canvas_set_reference_buffer, METH_VARARGS, NULL}, - { (char *)"Canvas_render_reference_overlay", _wrap_Canvas_render_reference_overlay, METH_VARARGS, NULL}, - { (char *)"Canvas_render_overlay", _wrap_Canvas_render_overlay, METH_VARARGS, NULL}, - { (char *)"Canvas_clear_overlay", _wrap_Canvas_clear_overlay, METH_VARARGS, NULL}, - { (char *)"Canvas_upgrade_drw_header", _wrap_Canvas_upgrade_drw_header, METH_VARARGS, NULL}, - { (char *)"Canvas_load", _wrap_Canvas_load, METH_VARARGS, NULL}, - { (char *)"Canvas_save", _wrap_Canvas_save, METH_VARARGS, NULL}, - { (char *)"Canvas_convert_from_drw", _wrap_Canvas_convert_from_drw, METH_VARARGS, NULL}, - { (char *)"Canvas_convert_to_drw", _wrap_Canvas_convert_to_drw, METH_VARARGS, NULL}, - { (char *)"Canvas_send_drw_commands", _wrap_Canvas_send_drw_commands, METH_VARARGS, NULL}, - { (char *)"Canvas_receive_drw_commands", _wrap_Canvas_receive_drw_commands, METH_VARARGS, NULL}, - { (char *)"Canvas_swigregister", Canvas_swigregister, METH_VARARGS, NULL}, - { (char *)"Palette_size_set", _wrap_Palette_size_set, METH_VARARGS, NULL}, - { (char *)"Palette_size_get", _wrap_Palette_size_get, METH_VARARGS, NULL}, - { (char *)"Palette_palette_h_set", _wrap_Palette_palette_h_set, METH_VARARGS, NULL}, - { (char *)"Palette_palette_h_get", _wrap_Palette_palette_h_get, METH_VARARGS, NULL}, - { (char *)"Palette_palette_s_set", _wrap_Palette_palette_s_set, METH_VARARGS, NULL}, - { (char *)"Palette_palette_s_get", _wrap_Palette_palette_s_get, METH_VARARGS, NULL}, - { (char *)"Palette_palette_v_set", _wrap_Palette_palette_v_set, METH_VARARGS, NULL}, - { (char *)"Palette_palette_v_get", _wrap_Palette_palette_v_get, METH_VARARGS, NULL}, - { (char *)"Palette_triangle_cursor_set", _wrap_Palette_triangle_cursor_set, METH_VARARGS, NULL}, - { (char *)"Palette_triangle_cursor_get", _wrap_Palette_triangle_cursor_get, METH_VARARGS, NULL}, - { (char *)"Palette_triangle_capture_set", _wrap_Palette_triangle_capture_set, METH_VARARGS, NULL}, - { (char *)"Palette_triangle_capture_get", _wrap_Palette_triangle_capture_get, METH_VARARGS, NULL}, - { (char *)"Palette_wheel_capture_set", _wrap_Palette_wheel_capture_set, METH_VARARGS, NULL}, - { (char *)"Palette_wheel_capture_get", _wrap_Palette_wheel_capture_get, METH_VARARGS, NULL}, - { (char *)"new_Palette", _wrap_new_Palette, METH_VARARGS, NULL}, - { (char *)"Palette_get_wheel_radius", _wrap_Palette_get_wheel_radius, METH_VARARGS, NULL}, - { (char *)"Palette_rgb_to_hsv", _wrap_Palette_rgb_to_hsv, METH_VARARGS, NULL}, - { (char *)"Palette_hsv_to_rgb", _wrap_Palette_hsv_to_rgb, METH_VARARGS, NULL}, - { (char *)"Palette_set_color", _wrap_Palette_set_color, METH_VARARGS, NULL}, - { (char *)"Palette_get_color", _wrap_Palette_get_color, METH_VARARGS, NULL}, - { (char *)"Palette_sqr", _wrap_Palette_sqr, METH_VARARGS, NULL}, - { (char *)"Palette_dot", _wrap_Palette_dot, METH_VARARGS, NULL}, - { (char *)"Palette_length", _wrap_Palette_length, METH_VARARGS, NULL}, - { (char *)"Palette_length_sqr", _wrap_Palette_length_sqr, METH_VARARGS, NULL}, - { (char *)"Palette_distance", _wrap_Palette_distance, METH_VARARGS, NULL}, - { (char *)"Palette_distance_sqr", _wrap_Palette_distance_sqr, METH_VARARGS, NULL}, - { (char *)"Palette_normalize", _wrap_Palette_normalize, METH_VARARGS, NULL}, - { (char *)"Palette_get_triangle_points", _wrap_Palette_get_triangle_points, METH_VARARGS, NULL}, - { (char *)"Palette_render_wheel", _wrap_Palette_render_wheel, METH_VARARGS, NULL}, - { (char *)"Palette_render_triangle", _wrap_Palette_render_triangle, METH_VARARGS, NULL}, - { (char *)"Palette_get_wheel_pos", _wrap_Palette_get_wheel_pos, METH_VARARGS, NULL}, - { (char *)"Palette_get_triangle_pos", _wrap_Palette_get_triangle_pos, METH_VARARGS, NULL}, - { (char *)"Palette_process_mouse", _wrap_Palette_process_mouse, METH_VARARGS, NULL}, - { (char *)"Palette_process_mouse_release", _wrap_Palette_process_mouse_release, METH_VARARGS, NULL}, - { (char *)"delete_Palette", _wrap_delete_Palette, METH_VARARGS, NULL}, - { (char *)"Palette_swigregister", Palette_swigregister, METH_VARARGS, NULL}, - { (char *)"BrushPreview_size_set", _wrap_BrushPreview_size_set, METH_VARARGS, NULL}, - { (char *)"BrushPreview_size_get", _wrap_BrushPreview_size_get, METH_VARARGS, NULL}, - { (char *)"BrushPreview_brush_set", _wrap_BrushPreview_brush_set, METH_VARARGS, NULL}, - { (char *)"BrushPreview_brush_get", _wrap_BrushPreview_brush_get, METH_VARARGS, NULL}, - { (char *)"new_BrushPreview", _wrap_new_BrushPreview, METH_VARARGS, NULL}, - { (char *)"BrushPreview_render", _wrap_BrushPreview_render, METH_VARARGS, NULL}, - { (char *)"delete_BrushPreview", _wrap_delete_BrushPreview, METH_VARARGS, NULL}, - { (char *)"BrushPreview_swigregister", BrushPreview_swigregister, METH_VARARGS, NULL}, - { NULL, NULL, 0, NULL } -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ - -static swig_type_info _swigt__p_Brush = {"_p_Brush", "Brush *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_BrushPreview = {"_p_BrushPreview", "BrushPreview *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_BrushType = {"_p_BrushType", "BrushType *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_ByteBuffer = {"_p_ByteBuffer", "ByteBuffer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_Canvas = {"_p_Canvas", "Canvas *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_Color = {"_p_Color", "Color *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_DRW_Command = {"_p_DRW_Command", "DRW_Command *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_DRW_Header = {"_p_DRW_Header", "DRW_Header *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_DrawCommand = {"_p_DrawCommand", "DrawCommand *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_DrawCommandBuffer = {"_p_DrawCommandBuffer", "DrawCommandBuffer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_GdkImage = {"_p_GdkImage", "GdkImage *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_GstBuffer = {"_p_GstBuffer", "GstBuffer *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_Palette = {"_p_Palette", "Palette *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_Pos = {"_p_Pos", "Pos *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_SurfaceA8R8G8B8 = {"_p_SurfaceA8R8G8B8", "SurfaceA8R8G8B8 *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_a_BrushType__BRUSH_TABLE_HEIGHT__unsigned_char = {"_p_a_BrushType__BRUSH_TABLE_HEIGHT__unsigned_char", "unsigned char (*)[BrushType::BRUSH_TABLE_HEIGHT]", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_a_BrushType__DIST_TABLE_WIDTH__unsigned_char = {"_p_a_BrushType__DIST_TABLE_WIDTH__unsigned_char", "unsigned char (*)[BrushType::DIST_TABLE_WIDTH]", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_float = {"_p_float", "float *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_DRW_Command = {"_p_p_DRW_Command", "DRW_Command **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_unsigned_int = {"_p_p_unsigned_int", "unsigned int **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_uint32_t = {"_p_uint32_t", "uint32_t *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "unsigned int *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned short *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_vectorTDrawCommand_t = {"_p_vectorTDrawCommand_t", "vector<DrawCommand > *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_void = {"_p_void", "void *", 0, 0, (void*)0, 0}; - -static swig_type_info *swig_type_initial[] = { - &_swigt__p_Brush, - &_swigt__p_BrushPreview, - &_swigt__p_BrushType, - &_swigt__p_ByteBuffer, - &_swigt__p_Canvas, - &_swigt__p_Color, - &_swigt__p_DRW_Command, - &_swigt__p_DRW_Header, - &_swigt__p_DrawCommand, - &_swigt__p_DrawCommandBuffer, - &_swigt__p_GdkImage, - &_swigt__p_GstBuffer, - &_swigt__p_Palette, - &_swigt__p_Pos, - &_swigt__p_SurfaceA8R8G8B8, - &_swigt__p_a_BrushType__BRUSH_TABLE_HEIGHT__unsigned_char, - &_swigt__p_a_BrushType__DIST_TABLE_WIDTH__unsigned_char, - &_swigt__p_char, - &_swigt__p_float, - &_swigt__p_p_DRW_Command, - &_swigt__p_p_unsigned_int, - &_swigt__p_uint32_t, - &_swigt__p_unsigned_char, - &_swigt__p_unsigned_int, - &_swigt__p_unsigned_short, - &_swigt__p_vectorTDrawCommand_t, - &_swigt__p_void, -}; - -static swig_cast_info _swigc__p_Brush[] = { {&_swigt__p_Brush, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_BrushPreview[] = { {&_swigt__p_BrushPreview, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_BrushType[] = { {&_swigt__p_BrushType, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_ByteBuffer[] = { {&_swigt__p_ByteBuffer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Canvas[] = { {&_swigt__p_Canvas, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Color[] = { {&_swigt__p_Color, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_DRW_Command[] = { {&_swigt__p_DRW_Command, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_DRW_Header[] = { {&_swigt__p_DRW_Header, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_DrawCommand[] = { {&_swigt__p_DrawCommand, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_DrawCommandBuffer[] = { {&_swigt__p_DrawCommandBuffer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_GdkImage[] = { {&_swigt__p_GdkImage, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_GstBuffer[] = { {&_swigt__p_GstBuffer, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Palette[] = { {&_swigt__p_Palette, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Pos[] = { {&_swigt__p_Pos, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_SurfaceA8R8G8B8[] = { {&_swigt__p_SurfaceA8R8G8B8, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_a_BrushType__BRUSH_TABLE_HEIGHT__unsigned_char[] = { {&_swigt__p_a_BrushType__BRUSH_TABLE_HEIGHT__unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_a_BrushType__DIST_TABLE_WIDTH__unsigned_char[] = { {&_swigt__p_a_BrushType__DIST_TABLE_WIDTH__unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_float[] = { {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_DRW_Command[] = { {&_swigt__p_p_DRW_Command, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_unsigned_int[] = { {&_swigt__p_p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_uint32_t[] = { {&_swigt__p_uint32_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_unsigned_short[] = { {&_swigt__p_unsigned_short, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_vectorTDrawCommand_t[] = { {&_swigt__p_vectorTDrawCommand_t, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_void[] = { {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}}; - -static swig_cast_info *swig_cast_initial[] = { - _swigc__p_Brush, - _swigc__p_BrushPreview, - _swigc__p_BrushType, - _swigc__p_ByteBuffer, - _swigc__p_Canvas, - _swigc__p_Color, - _swigc__p_DRW_Command, - _swigc__p_DRW_Header, - _swigc__p_DrawCommand, - _swigc__p_DrawCommandBuffer, - _swigc__p_GdkImage, - _swigc__p_GstBuffer, - _swigc__p_Palette, - _swigc__p_Pos, - _swigc__p_SurfaceA8R8G8B8, - _swigc__p_a_BrushType__BRUSH_TABLE_HEIGHT__unsigned_char, - _swigc__p_a_BrushType__DIST_TABLE_WIDTH__unsigned_char, - _swigc__p_char, - _swigc__p_float, - _swigc__p_p_DRW_Command, - _swigc__p_p_unsigned_int, - _swigc__p_uint32_t, - _swigc__p_unsigned_char, - _swigc__p_unsigned_int, - _swigc__p_unsigned_short, - _swigc__p_vectorTDrawCommand_t, - _swigc__p_void, -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ - -static swig_const_info swig_const_table[] = { -{0, 0, 0, 0.0, 0, 0}}; - -#ifdef __cplusplus -} -#endif -/* ----------------------------------------------------------------------------- - * Type initialization: - * This problem is tough by the requirement that no dynamic - * memory is used. Also, since swig_type_info structures store pointers to - * swig_cast_info structures and swig_cast_info structures store pointers back - * to swig_type_info structures, we need some lookup code at initialization. - * The idea is that swig generates all the structures that are needed. - * The runtime then collects these partially filled structures. - * The SWIG_InitializeModule function takes these initial arrays out of - * swig_module, and does all the lookup, filling in the swig_module.types - * array with the correct data and linking the correct swig_cast_info - * structures together. - * - * The generated swig_type_info structures are assigned staticly to an initial - * array. We just loop through that array, and handle each type individually. - * First we lookup if this type has been already loaded, and if so, use the - * loaded structure instead of the generated one. Then we have to fill in the - * cast linked list. The cast data is initially stored in something like a - * two-dimensional array. Each row corresponds to a type (there are the same - * number of rows as there are in the swig_type_initial array). Each entry in - * a column is one of the swig_cast_info structures for that type. - * The cast_initial array is actually an array of arrays, because each row has - * a variable number of columns. So to actually build the cast linked list, - * we find the array of casts associated with the type, and loop through it - * adding the casts to the list. The one last trick we need to do is making - * sure the type pointer in the swig_cast_info struct is correct. - * - * First off, we lookup the cast->type name to see if it is already loaded. - * There are three cases to handle: - * 1) If the cast->type has already been loaded AND the type we are adding - * casting info to has not been loaded (it is in this module), THEN we - * replace the cast->type pointer with the type pointer that has already - * been loaded. - * 2) If BOTH types (the one we are adding casting info to, and the - * cast->type) are loaded, THEN the cast info has already been loaded by - * the previous module so we just ignore it. - * 3) Finally, if cast->type has not already been loaded, then we add that - * swig_cast_info to the linked list (because the cast->type) pointer will - * be correct. - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#if 0 -} /* c-mode */ -#endif -#endif - -#if 0 -#define SWIGRUNTIME_DEBUG -#endif - - -SWIGRUNTIME void -SWIG_InitializeModule(void *clientdata) { - size_t i; - swig_module_info *module_head, *iter; - int found; - - clientdata = clientdata; - - /* check to see if the circular list has been setup, if not, set it up */ - if (swig_module.next==0) { - /* Initialize the swig_module */ - swig_module.type_initial = swig_type_initial; - swig_module.cast_initial = swig_cast_initial; - swig_module.next = &swig_module; - } - - /* Try and load any already created modules */ - module_head = SWIG_GetModule(clientdata); - if (!module_head) { - /* This is the first module loaded for this interpreter */ - /* so set the swig module into the interpreter */ - SWIG_SetModule(clientdata, &swig_module); - module_head = &swig_module; - } else { - /* the interpreter has loaded a SWIG module, but has it loaded this one? */ - found=0; - iter=module_head; - do { - if (iter==&swig_module) { - found=1; - break; - } - iter=iter->next; - } while (iter!= module_head); - - /* if the is found in the list, then all is done and we may leave */ - if (found) return; - /* otherwise we must add out module into the list */ - swig_module.next = module_head->next; - module_head->next = &swig_module; - } - - /* Now work on filling in swig_module.types */ -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: size %d\n", swig_module.size); -#endif - for (i = 0; i < swig_module.size; ++i) { - swig_type_info *type = 0; - swig_type_info *ret; - swig_cast_info *cast; - -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); -#endif - - /* if there is another module already loaded */ - if (swig_module.next != &swig_module) { - type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); - } - if (type) { - /* Overwrite clientdata field */ -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: found type %s\n", type->name); -#endif - if (swig_module.type_initial[i]->clientdata) { - type->clientdata = swig_module.type_initial[i]->clientdata; -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); -#endif - } - } else { - type = swig_module.type_initial[i]; - } - - /* Insert casting types */ - cast = swig_module.cast_initial[i]; - while (cast->type) { - /* Don't need to add information already in the list */ - ret = 0; -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); -#endif - if (swig_module.next != &swig_module) { - ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); -#ifdef SWIGRUNTIME_DEBUG - if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); -#endif - } - if (ret) { - if (type == swig_module.type_initial[i]) { -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: skip old type %s\n", ret->name); -#endif - cast->type = ret; - ret = 0; - } else { - /* Check for casting already in the list */ - swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); -#ifdef SWIGRUNTIME_DEBUG - if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); -#endif - if (!ocast) ret = 0; - } - } - - if (!ret) { -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); -#endif - if (type->cast) { - type->cast->prev = cast; - cast->next = type->cast; - } - type->cast = cast; - } - cast++; - } - /* Set entry in modules->types array equal to the type */ - swig_module.types[i] = type; - } - swig_module.types[i] = 0; - -#ifdef SWIGRUNTIME_DEBUG - printf("**** SWIG_InitializeModule: Cast List ******\n"); - for (i = 0; i < swig_module.size; ++i) { - int j = 0; - swig_cast_info *cast = swig_module.cast_initial[i]; - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); - while (cast->type) { - printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); - cast++; - ++j; - } - printf("---- Total casts: %d\n",j); - } - printf("**** SWIG_InitializeModule: Cast List ******\n"); -#endif -} - -/* This function will propagate the clientdata field of type to -* any new swig_type_info structures that have been added into the list -* of equivalent types. It is like calling -* SWIG_TypeClientData(type, clientdata) a second time. -*/ -SWIGRUNTIME void -SWIG_PropagateClientData(void) { - size_t i; - swig_cast_info *equiv; - static int init_run = 0; - - if (init_run) return; - init_run = 1; - - for (i = 0; i < swig_module.size; i++) { - if (swig_module.types[i]->clientdata) { - equiv = swig_module.types[i]->cast; - while (equiv) { - if (!equiv->converter) { - if (equiv->type && !equiv->type->clientdata) - SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); - } - equiv = equiv->next; - } - } - } -} - -#ifdef __cplusplus -#if 0 -{ - /* c-mode */ -#endif -} -#endif - - - -#ifdef __cplusplus -extern "C" { -#endif - - /* Python-specific SWIG API */ -#define SWIG_newvarlink() SWIG_Python_newvarlink() -#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) -#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) - - /* ----------------------------------------------------------------------------- - * global variable support code. - * ----------------------------------------------------------------------------- */ - - typedef struct swig_globalvar { - char *name; /* Name of global variable */ - PyObject *(*get_attr)(void); /* Return the current value */ - int (*set_attr)(PyObject *); /* Set the value */ - struct swig_globalvar *next; - } swig_globalvar; - - typedef struct swig_varlinkobject { - PyObject_HEAD - swig_globalvar *vars; - } swig_varlinkobject; - - SWIGINTERN PyObject * - swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { - return PyString_FromString("<Swig global variables>"); - } - - SWIGINTERN PyObject * - swig_varlink_str(swig_varlinkobject *v) { - PyObject *str = PyString_FromString("("); - swig_globalvar *var; - for (var = v->vars; var; var=var->next) { - PyString_ConcatAndDel(&str,PyString_FromString(var->name)); - if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); - } - PyString_ConcatAndDel(&str,PyString_FromString(")")); - return str; - } - - SWIGINTERN int - swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { - PyObject *str = swig_varlink_str(v); - fprintf(fp,"Swig global variables "); - fprintf(fp,"%s\n", PyString_AsString(str)); - Py_DECREF(str); - return 0; - } - - SWIGINTERN void - swig_varlink_dealloc(swig_varlinkobject *v) { - swig_globalvar *var = v->vars; - while (var) { - swig_globalvar *n = var->next; - free(var->name); - free(var); - var = n; - } - } - - SWIGINTERN PyObject * - swig_varlink_getattr(swig_varlinkobject *v, char *n) { - PyObject *res = NULL; - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - res = (*var->get_attr)(); - break; - } - var = var->next; - } - if (res == NULL && !PyErr_Occurred()) { - PyErr_SetString(PyExc_NameError,"Unknown C global variable"); - } - return res; - } - - SWIGINTERN int - swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { - int res = 1; - swig_globalvar *var = v->vars; - while (var) { - if (strcmp(var->name,n) == 0) { - res = (*var->set_attr)(p); - break; - } - var = var->next; - } - if (res == 1 && !PyErr_Occurred()) { - PyErr_SetString(PyExc_NameError,"Unknown C global variable"); - } - return res; - } - - SWIGINTERN PyTypeObject* - swig_varlink_type(void) { - static char varlink__doc__[] = "Swig var link object"; - static PyTypeObject varlink_type; - static int type_init = 0; - if (!type_init) { - const PyTypeObject tmp - = { - PyObject_HEAD_INIT(NULL) - 0, /* Number of items in variable part (ob_size) */ - (char *)"swigvarlink", /* Type name (tp_name) */ - sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ - 0, /* Itemsize (tp_itemsize) */ - (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ - (printfunc) swig_varlink_print, /* Print (tp_print) */ - (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ - (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ - 0, /* tp_compare */ - (reprfunc) swig_varlink_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - (reprfunc)swig_varlink_str, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ - 0, /* tp_flags */ - varlink__doc__, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 - 0, /* tp_del */ -#endif -#ifdef COUNT_ALLOCS - 0,0,0,0 /* tp_alloc -> tp_next */ -#endif - }; - varlink_type = tmp; - varlink_type.ob_type = &PyType_Type; - type_init = 1; - } - return &varlink_type; - } - - /* Create a variable linking object for use later */ - SWIGINTERN PyObject * - SWIG_Python_newvarlink(void) { - swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); - if (result) { - result->vars = 0; - } - return ((PyObject*) result); - } - - SWIGINTERN void - SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { - swig_varlinkobject *v = (swig_varlinkobject *) p; - swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); - if (gv) { - size_t size = strlen(name)+1; - gv->name = (char *)malloc(size); - if (gv->name) { - strncpy(gv->name,name,size); - gv->get_attr = get_attr; - gv->set_attr = set_attr; - gv->next = v->vars; - } - } - v->vars = gv; - } - - SWIGINTERN PyObject * - SWIG_globals(void) { - static PyObject *_SWIG_globals = 0; - if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); - return _SWIG_globals; - } - - /* ----------------------------------------------------------------------------- - * constants/methods manipulation - * ----------------------------------------------------------------------------- */ - - /* Install Constants */ - SWIGINTERN void - SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { - PyObject *obj = 0; - size_t i; - for (i = 0; constants[i].type; ++i) { - switch(constants[i].type) { - case SWIG_PY_POINTER: - obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); - break; - case SWIG_PY_BINARY: - obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); - break; - default: - obj = 0; - break; - } - if (obj) { - PyDict_SetItemString(d, constants[i].name, obj); - Py_DECREF(obj); - } - } - } - - /* -----------------------------------------------------------------------------*/ - /* Fix SwigMethods to carry the callback ptrs when needed */ - /* -----------------------------------------------------------------------------*/ - - SWIGINTERN void - SWIG_Python_FixMethods(PyMethodDef *methods, - swig_const_info *const_table, - swig_type_info **types, - swig_type_info **types_initial) { - size_t i; - for (i = 0; methods[i].ml_name; ++i) { - const char *c = methods[i].ml_doc; - if (c && (c = strstr(c, "swig_ptr: "))) { - int j; - swig_const_info *ci = 0; - const char *name = c + 10; - for (j = 0; const_table[j].type; ++j) { - if (strncmp(const_table[j].name, name, - strlen(const_table[j].name)) == 0) { - ci = &(const_table[j]); - break; - } - } - if (ci) { - size_t shift = (ci->ptype) - types; - swig_type_info *ty = types_initial[shift]; - size_t ldoc = (c - methods[i].ml_doc); - size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; - char *ndoc = (char*)malloc(ldoc + lptr + 10); - if (ndoc) { - char *buff = ndoc; - void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; - if (ptr) { - strncpy(buff, methods[i].ml_doc, ldoc); - buff += ldoc; - strncpy(buff, "swig_ptr: ", 10); - buff += 10; - SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); - methods[i].ml_doc = ndoc; - } - } - } - } - } - } - -#ifdef __cplusplus -} -#endif - -/* -----------------------------------------------------------------------------* - * Partial Init method - * -----------------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT void SWIG_init(void) { - PyObject *m, *d; - - /* Fix SwigMethods to carry the callback ptrs when needed */ - SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); - - m = Py_InitModule((char *) SWIG_name, SwigMethods); - d = PyModule_GetDict(m); - - SWIG_InitializeModule(0); - SWIG_InstallConstants(d,swig_const_table); - - - PyDict_SetItemString(d,(char*)"cvar", SWIG_globals()); - SWIG_addvarlink(SWIG_globals(),(char*)"PI",Swig_var_PI_get, Swig_var_PI_set); - SWIG_Python_SetConstant(d, "DrawCommand_TYPE_DRAW",SWIG_From_int(static_cast< int >(DrawCommand::TYPE_DRAW))); - SWIG_Python_SetConstant(d, "DrawCommand_TYPE_DRAWEND",SWIG_From_int(static_cast< int >(DrawCommand::TYPE_DRAWEND))); - SWIG_Python_SetConstant(d, "DrawCommand_TYPE_COLORCHANGE",SWIG_From_int(static_cast< int >(DrawCommand::TYPE_COLORCHANGE))); - SWIG_Python_SetConstant(d, "DrawCommand_TYPE_SIZECHANGE",SWIG_From_int(static_cast< int >(DrawCommand::TYPE_SIZECHANGE))); - SWIG_Python_SetConstant(d, "BrushType_BRUSHTYPE_HARD",SWIG_From_int(static_cast< int >(BrushType::BRUSHTYPE_HARD))); - SWIG_Python_SetConstant(d, "BrushType_BRUSHTYPE_SOFT",SWIG_From_int(static_cast< int >(BrushType::BRUSHTYPE_SOFT))); - SWIG_Python_SetConstant(d, "BrushType_BRUSHTYPE_CURSOR",SWIG_From_int(static_cast< int >(BrushType::BRUSHTYPE_CURSOR))); - SWIG_Python_SetConstant(d, "BrushType_NUM_BRUSHES",SWIG_From_int(static_cast< int >(BrushType::NUM_BRUSHES))); - SWIG_Python_SetConstant(d, "BrushType_DIST_TABLE_WIDTH",SWIG_From_int(static_cast< int >(BrushType::DIST_TABLE_WIDTH))); - SWIG_Python_SetConstant(d, "BrushType_DIST_TABLE_CENTER",SWIG_From_int(static_cast< int >(BrushType::DIST_TABLE_CENTER))); - SWIG_Python_SetConstant(d, "BrushType_BRUSH_TABLE_WIDTH",SWIG_From_int(static_cast< int >(BrushType::BRUSH_TABLE_WIDTH))); - SWIG_Python_SetConstant(d, "BrushType_BRUSH_TABLE_HEIGHT",SWIG_From_int(static_cast< int >(BrushType::BRUSH_TABLE_HEIGHT))); - SWIG_Python_SetConstant(d, "BrushType_EXTRA_BRUSH_SCALE",SWIG_From_float(static_cast< float >(BrushType::EXTRA_BRUSH_SCALE))); - SWIG_addvarlink(SWIG_globals(),(char*)"BrushType_distance_tbl",Swig_var_BrushType_distance_tbl_get, Swig_var_BrushType_distance_tbl_set); - SWIG_Python_SetConstant(d, "Brush_BRUSHCONTROL_VARIABLEOPACITY",SWIG_From_int(static_cast< int >(Brush::BRUSHCONTROL_VARIABLEOPACITY))); - SWIG_Python_SetConstant(d, "Brush_BRUSHCONTROL_VARIABLESIZE",SWIG_From_int(static_cast< int >(Brush::BRUSHCONTROL_VARIABLESIZE))); - SWIG_addvarlink(SWIG_globals(),(char*)"Brush_brush_type",Swig_var_Brush_brush_type_get, Swig_var_Brush_brush_type_set); - SWIG_Python_SetConstant(d, "Canvas_REFERENCE_WIDTH",SWIG_From_int(static_cast< int >(Canvas::REFERENCE_WIDTH))); - SWIG_Python_SetConstant(d, "Canvas_REFERENCE_HEIGHT",SWIG_From_int(static_cast< int >(Canvas::REFERENCE_HEIGHT))); - SWIG_Python_SetConstant(d, "Canvas_VIDEO_WIDTH",SWIG_From_int(static_cast< int >(Canvas::VIDEO_WIDTH))); - SWIG_Python_SetConstant(d, "Canvas_VIDEO_HEIGHT",SWIG_From_int(static_cast< int >(Canvas::VIDEO_HEIGHT))); - SWIG_Python_SetConstant(d, "Canvas_DRAWBRUSH_TYPE_NORMAL",SWIG_From_int(static_cast< int >(Canvas::DRAWBRUSH_TYPE_NORMAL))); - SWIG_Python_SetConstant(d, "Canvas_DRAWBRUSH_TYPE_OLDCURSOR",SWIG_From_int(static_cast< int >(Canvas::DRAWBRUSH_TYPE_OLDCURSOR))); - SWIG_Python_SetConstant(d, "Canvas_DRAWBRUSH_TYPE_DIRECT",SWIG_From_int(static_cast< int >(Canvas::DRAWBRUSH_TYPE_DIRECT))); - SWIG_Python_SetConstant(d, "Canvas_DRAWBRUSH_TYPE_GETCOLOR",SWIG_From_int(static_cast< int >(Canvas::DRAWBRUSH_TYPE_GETCOLOR))); - SWIG_Python_SetConstant(d, "Canvas_DRAWBRUSH_TYPE_CURSOR",SWIG_From_int(static_cast< int >(Canvas::DRAWBRUSH_TYPE_CURSOR))); - SWIG_Python_SetConstant(d, "Palette_WHEEL_WIDTH",SWIG_From_int(static_cast< int >(Palette::WHEEL_WIDTH))); -} - diff --git a/src/deploy.sh b/src/deploy.sh deleted file mode 100755 index 0d548de..0000000 --- a/src/deploy.sh +++ /dev/null @@ -1,2 +0,0 @@ -scp ~/Colors.activity/colors.py ~/Colors.activity/_colorsc.so ~/Colors.activity/colorsc.py olpc@$XOIP:~/Colors.activity/ - diff --git a/src/drwfile.h b/src/drwfile.h deleted file mode 100644 index f581f9b..0000000 --- a/src/drwfile.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright 2008 by Jens Andersson and Wade Brainerd. - This file is part of Colors! XO. - - Colors is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Colors is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Colors. If not, see <http://www.gnu.org/licenses/>. -*/ -#ifndef _DRWFILE_H_ -#define _DRWFILE_H_ - -#define DRW_VERSION 1070 - -struct DRW_Command -{ - union - { - struct - { - unsigned int type0 : 2; - unsigned int alpha : 8; - unsigned int x : 11; - unsigned int y : 11; - }; - - struct - { - unsigned int type1 : 2; - unsigned int col : 24; - unsigned int flipx : 1; - unsigned int flipy : 1; - }; - - struct - { - unsigned int type2 : 2; - unsigned int size : 16; - unsigned int brushcontrol : 2; - unsigned int brushtype : 2; - unsigned int opacity : 8; - }; - - struct - { - unsigned int type : 2; - unsigned int undef : 30; - }; - - int raw; - }; -}; - -struct DRW_Header -{ - static const unsigned int ID = 0x436f6c21; // 'Col!' - - unsigned int id; - unsigned int version; - int colorsversion_initial; - int colorsversion_saved; - int strokes; - int time; - int timessaved; - int dummy[8]; - int ncommands; -}; - -#endif diff --git a/src/gtk_types.h b/src/gtk_types.h deleted file mode 100644 index f3e26bd..0000000 --- a/src/gtk_types.h +++ /dev/null @@ -1,130 +0,0 @@ -// This file serves to allow access to a limited subset of GTK and GStreamer objects passed from PyGTK, without the full -// GLib + GTK + GST development environment. -// -// Obviously, it is limited to working with a specific version of GTK, PyGTK and GStreamer, but these structures appear -// to be fairly stable. -#ifndef GTK_TYPES_H -#define GTK_TYPES_H - -#include <stdint.h> - -typedef uint8_t guint8; -typedef int32_t gint; -typedef uint32_t guint; -typedef uint16_t guint16; -typedef uint64_t guint64; -typedef void* gpointer; - -struct GTypeClass; -struct GData; - -struct _GTypeInstance -{ - /*< private >*/ - GTypeClass *g_class; -}; - -typedef struct _GTypeInstance GTypeInstance; - -struct _GObject -{ - GTypeInstance g_type_instance; - - /*< private >*/ - guint ref_count; - GData *qdata; -}; - -typedef struct _GObject GObject; - -typedef enum -{ - GDK_IMAGE_NORMAL, - GDK_IMAGE_SHARED, - GDK_IMAGE_FASTEST -} GdkImageType; - -typedef enum -{ - GDK_LSB_FIRST, - GDK_MSB_FIRST -} GdkByteOrder; - -struct GdkVisual; -struct GdkColormap; - -typedef struct { - GObject parent_instance; - - - GdkImageType type; /* read only. */ - GdkVisual *visual; /* read only. visual used to create the image */ - GdkByteOrder byte_order; /* read only. */ - gint width; /* read only. */ - gint height; /* read only. */ - guint16 depth; /* read only. */ - guint16 bpp; /* read only. bytes per pixel */ - guint16 bpl; /* read only. bytes per line */ - guint16 bits_per_pixel; /* read only. bits per pixel */ - gpointer mem; - - GdkColormap *colormap; /* read only. */ -} GdkImage; - -struct GSList; - -typedef struct { - PyObject_HEAD - GObject *obj; - PyObject *inst_dict; /* the instance dictionary -- must be last */ - PyObject *weakreflist; /* list of weak references */ - GSList *closures; -} PyGObject; - -struct _GstMiniObject { - GTypeInstance instance; - /*< public >*/ /* with COW */ - gint refcount; - guint flags; - - /*< private >*/ - gpointer _gst_reserved; -}; - -typedef struct _GstMiniObject GstMiniObject; - -struct GstCaps; - -typedef guint64 GstClockTime; - -#define GST_PADDING 4 - -struct _GstBuffer { - GstMiniObject mini_object; - - /*< public >*/ /* with COW */ - /* pointer to data and its size */ - guint8 *data; - guint size; - - /* timestamp */ - GstClockTime timestamp; - GstClockTime duration; - - /* the media type of this buffer */ - GstCaps *caps; - - /* media specific offset */ - guint64 offset; - guint64 offset_end; - - guint8 *malloc_data; - - /*< private >*/ - gpointer _gst_reserved[GST_PADDING]; -}; - -typedef struct _GstBuffer GstBuffer; - -#endif - diff --git a/src/palette.cpp b/src/palette.cpp deleted file mode 100644 index 0751983..0000000 --- a/src/palette.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/* - Copyright 2008 by Jens Andersson and Wade Brainerd. - This file is part of Colors! XO. - - Colors is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Colors is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Colors. If not, see <http://www.gnu.org/licenses/>. -*/ -#include "palette.h" - diff --git a/src/palette.h b/src/palette.h deleted file mode 100644 index 03d51eb..0000000 --- a/src/palette.h +++ /dev/null @@ -1,458 +0,0 @@ -/* - Copyright 2008 by Jens Andersson and Wade Brainerd. - This file is part of Colors! XO. - - Colors is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Colors is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Colors. If not, see <http://www.gnu.org/licenses/>. -*/ -#ifndef _PALETTE_H_ -#define _PALETTE_H_ - -#include "colorsc.h" -#include "canvas.h" - -// The Palette is the color wheel and triangle that are part of the brush controls dialog. -// This class manages rendering the palette as efficiently as possible into GdkImage objects which are -// then displayed on the screen. -// It also manages responding to mouse inputs that are passed from the Python code. -class Palette -{ -public: - static const int WHEEL_WIDTH = 75; - - int size; - - float palette_h, palette_s, palette_v; - - Pos triangle_cursor; - bool triangle_capture; - bool wheel_capture; - - Palette(int size) : size(size) - { - palette_h = palette_s = palette_v = 0; - triangle_capture = false; - } - - float get_wheel_radius() - { - return size - WHEEL_WIDTH/2; - } - - void rgb_to_hsv(float r, float g, float b, float* h, float* s, float* v) - { - float mn = min(min(r, g), b); - float mx = max(max(r, g), b); - *v = mx; // v - float delta = mx - mn; - if (mx != 0) - *s = delta / mx; // s - else - { - // r = g = b = 0 // s = 0, v is undefined - *s = 0; - *h = -1; - return; - } - if (delta == 0) - *h = 0; - else if (r == mx) - *h = ( g - b ) / delta; // between yellow & magenta - else if (g == mx) - *h = 2 + ( b - r ) / delta; // between cyan & yellow - else - *h = 4 + ( r - g ) / delta; // between magenta & cyan - *h *= 60; // degrees - if (*h < 0) - *h += 360; - } - - void hsv_to_rgb(float* r, float* g, float* b, float h, float s, float v) - { - if (s == 0) - { - // achromatic (grey) - *r = *g = *b = v; - return; - } - h /= 60; // sector 0 to 5 - int i = int(floorf(h)); - float f = h - i; // factorial part of h - float p = v * (1-s); - float q = v * (1-s * f); - float t = v * (1-s * (1 - f)); - switch (i) - { - case 0: *r = v; *g = t; *b = p; break; - case 1: *r = q; *g = v; *b = p; break; - case 2: *r = p; *g = v; *b = t; break; - case 3: *r = p; *g = q; *b = v; break; - case 4: *r = t; *g = p; *b = v; break; - default: - case 5: *r = v; *g = p; *b = q; break; - } - } - - void set_color(const Color& c) - { - rgb_to_hsv(c.r/255.0f, c.g/255.0f, c.b/255.0f, &palette_h, &palette_s, &palette_v); - - // I couldn't work out an exact solution to the blobby triangle position, so I'm using a relaxation algorithm. - // It usually takes less than 10 iterations to converge and only runs when you first open the palette. - Pos p0, p1, p2; - get_triangle_points(&p0, &p1, &p2); - float side = distance(p0, p1); - - Pos p = (p0+p1+p2)*(1.0f/3.0f); - float epsilon = 0.001f; - int max_iterations = 50; - for (int i = 0; i < max_iterations; i++) - { - float d0 = distance(p, p0); - float d0ok = fabsf((side-d0)-palette_s*side); - p = p + ((p0-p)/length(p0-p)) * (d0-(1.0f-palette_s)*side); - - float d2 = distance(p, p2); - float d2ok = fabsf(d2-palette_v*side); - p = p + ((p2-p)/length(p2-p)) * (d2-palette_v*side); - - if (d0ok <= epsilon && d2ok <= epsilon) break; - } - triangle_cursor = p; - } - - Color get_color() - { - float r, g, b; - hsv_to_rgb(&r, &g, &b, palette_h, palette_s, palette_v); - return Color::create_from_float(r, g, b, 1.0f); - } - - float sqr(float a) - { - return a*a; - } - - float dot(const Pos& a, const Pos& b) - { - return a.x*b.x + a.y*b.y; - } - - float length(const Pos& a) - { - return sqrtf(dot(a,a)); - } - - float length_sqr(const Pos& a) - { - return dot(a,a); - } - - float distance(const Pos& a, const Pos& b) - { - return length(a-b); - } - - float distance_sqr(const Pos& a, const Pos& b) - { - return length_sqr(a-b); - } - - Pos normalize(const Pos& a) - { - return a/length(a); - } - - void get_triangle_points(Pos* p0, Pos* p1, Pos* p2) - { - Pos center(size/2, size/2); - *p0 = center + Pos::create_from_angle(palette_h+0.0f, size/2-WHEEL_WIDTH); - *p1 = center + Pos::create_from_angle(palette_h+120.0f, size/2-WHEEL_WIDTH); - *p2 = center + Pos::create_from_angle(palette_h+240.0f, size/2-WHEEL_WIDTH); - } - - // The wheel never changes, so it can be rendered once here. This also clears the image background. - void render_wheel(GdkImage* image) - { - if (image->width != size || image->height != size || image->bits_per_pixel != 16) - { - fprintf(stderr, "Error: Invalid Palette GdkImage.\n"); - return; - } - - Color bkg(64, 64, 64, 0); - - float wheel_radius = size/2; - float ring_min_sqr = sqr(wheel_radius-WHEEL_WIDTH); - float ring_max_sqr = sqr(wheel_radius); - - unsigned short* pixels = (unsigned short*)image->mem; - int stride = image->bpl/sizeof(unsigned short); - - for (int y = 0; y < size; y++) - { - unsigned short* row = &pixels[y*stride]; - for (int x = 0; x < size; x++) - { - // Get radius from center of palette. - float dx = x-wheel_radius; - float dy = y-wheel_radius; - float dist_sqr = dx*dx + dy*dy; - - // Inside color wheel ring? Draw the wheel. - if (dist_sqr >= ring_min_sqr && dist_sqr < ring_max_sqr) - { - // Calculate HSV from wheel angle. - float h = atan2f(dy, dx)*180.0f/PI; - while (h<0) h += 360.0f; - while (h>360.0f) h -= 360.0f; - float r, g, b; - hsv_to_rgb(&r, &g, &b, h, 1.0f, 1.0f); - *row++ = Color::create_from_float(r, g, b, 1).get_r5g6b5(); - } - else - *row++ = bkg.get_r5g6b5(); - } - } - } - - // Clears out the inner circle and redraws the color triangle, as fast as possible. - // Scales up implicitly by 2x to improve performance. - // The appearance was an accident which creates a kind of blobby triangle, like the intersection of three circles. - // But I like the look so I'm keeping it! - void render_triangle(GdkImage* image) - { - if (image->width != size || image->height != size || image->bits_per_pixel != 16 || (size&1)) - { - fprintf(stderr, "Error: Invalid Palette GdkImage.\n"); - return; - } - - Color bkg(64, 64, 64, 0); - unsigned short bkgc = bkg.get_r5g6b5(); - - Pos p0, p1, p2; - get_triangle_points(&p0, &p1, &p2); - float triangle_side = distance(p0, p1); - float triangle_side_sqr = triangle_side*triangle_side; - float inv_triangle_side = 1.0f/triangle_side; - - float wheel_radius = size/2; - float ring_min_sqr = sqr(wheel_radius-WHEEL_WIDTH); - - int x0 = WHEEL_WIDTH; - int x1 = size-WHEEL_WIDTH; - - unsigned short* pixels = (unsigned short*)image->mem; - int stride = image->bpl/sizeof(unsigned short); - - Pos p(x0,x0); - for (int y = x0; y < x1; y+=2, p.y += 2.0f) - { - p.x = x0; - unsigned short* __restrict row0 = &pixels[(y+0)*stride+x0]; - unsigned short* __restrict row1 = &pixels[(y+1)*stride+x0]; - for (int x = x0; x < x1; x+=2, p.x += 2.0f) - { - // Calculate position inside triangle. If inside, then use as HSV. - float d0_sqr = distance_sqr(p, p0); - float d1_sqr = distance_sqr(p, p1); - float d2_sqr = distance_sqr(p, p2); - if (d0_sqr <= triangle_side_sqr && d1_sqr <= triangle_side_sqr && d2_sqr <= triangle_side_sqr) - { - float r, g, b; - hsv_to_rgb(&r, &g, &b, palette_h, 1.0f-sqrtf(d0_sqr)*inv_triangle_side, sqrtf(d2_sqr)*inv_triangle_side); - unsigned short c = Color::create_from_float(r, g, b, 1).get_r5g6b5(); - row0[0] = c; - row0[1] = c; - row1[0] = c; - row1[1] = c; - } - else - { - // Inside ring? Clear to background. - if (distance_sqr(p, Pos(wheel_radius, wheel_radius)) < ring_min_sqr) - { - row0[0] = bkgc; - row0[1] = bkgc; - row1[0] = bkgc; - row1[1] = bkgc; - } - } - row0 += 2; - row1 += 2; - } - } - } - - Pos get_wheel_pos() - { - float a = palette_h*PI/180.0f; - float r = size/2 - WHEEL_WIDTH/2; - return Pos(size/2+r*cosf(a), size/2+r*sinf(a)); - } - - Pos get_triangle_pos() - { - return triangle_cursor; - } - - void process_mouse(int mx, int my) - { - Pos p0, p1, p2; - get_triangle_points(&p0, &p1, &p2); - - // If the triangle has the mouse capture, clip the mouse position to within the blobby triangle. - if (!wheel_capture) - { - if (triangle_capture) - { - Pos p(mx, my); - float d0 = distance(p, p0); - float d1 = distance(p, p1); - float d2 = distance(p, p2); - float side = distance(p0, p1)-1; - if (d0 > side || d1 > side || d2 > side) - { - Pos far_point = p0; - float far_dist = d0; - if (d1 > far_dist) { far_point = p1; far_dist = d1; } - if (d2 > far_dist) { far_point = p2; far_dist = d2; } - p = far_point + normalize(p-far_point) * side; - mx = int(p.x); - my = int(p.y); - } - } - - // Now check to see if it's on the triangle. - float side = 1.0f/distance(p0, p1); - Pos p(mx, my); - float d0 = distance(p, p0)*side; - float d1 = distance(p, p1)*side; - float d2 = distance(p, p2)*side; - if (d0 <= 1.0f && d1 <= 1.0f && d2 <= 1.0f) - { - triangle_capture = true; - triangle_cursor = p; - palette_s = 1.0f-d0; - palette_v = d2; - } - } - - if (!triangle_capture) - { - // Check to see if the mouse is in the wheel ring. - int dx = mx-size/2; - int dy = my-size/2; - float dist = sqrtf(dx*dx + dy*dy); - if (dist >= size/2-WHEEL_WIDTH || wheel_capture) - { - wheel_capture = true; - float h = atan2f(float(dy), float(dx))*180.0f/PI; - while (h<0) h += 360.0f; - while (h>360.0f) h -= 360.0f; - // Rotate the triangle cursor with the wheel. - triangle_cursor = Pos::create_from_rotation(triangle_cursor, (p0+p1+p2)/3.0f, (h-palette_h)*PI/180.0f); - palette_h = h; - } - } - } - - void process_mouse_release() - { - triangle_capture = false; - wheel_capture = false; - } -}; - -// The BrushPreview is a simple preview of the current brush as displayed in the Brush Controls panel. -// This class handles rendering the brush preview to a GdkImage to be displayed on the screen. -class BrushPreview -{ -public: - int size; - - Brush brush; - - BrushPreview(int size) : size(size) - { - } - - void render(GdkImage* image) - { - if (image->width != size || image->height != size || image->bits_per_pixel != 16 || (size&1)) - { - fprintf(stderr, "Error: Invalid BrushPreview GdkImage.\n"); - return; - } - - // Minimum brush size. - if (brush.size<2) brush.size = 2; - - // Calculate interpolation constants - float db = (BrushType::DIST_TABLE_WIDTH-1) / float(brush.size); - - float xb = BrushType::DIST_TABLE_CENTER - (size/2)*db; - float yb = BrushType::DIST_TABLE_CENTER - (size/2)*db; - - // Select which line of the brush-lookup-table to use that most closely matches the current brush width - int brushidx = int(float(BrushType::BRUSH_TABLE_HEIGHT) / brush.size); - - int opacity = int(round(255.0f * brush.opacity)); - - unsigned short* pixels = (unsigned short*)image->mem; - int stride = image->bpl/sizeof(unsigned short); - - // Interpolate the distance table over the area. For each pixel find the distance, and look the - // brush-intensity up in the brush-table - for (int y = 0; y < size; y+=2) - { - float x2b = xb; - unsigned short* __restrict row0 = &pixels[(y+0)*stride]; - unsigned short* __restrict row1 = &pixels[(y+1)*stride]; - for (int x = 0; x < size; x+=2) - { - // Find brush-intensity and mulitply that with incoming opacity - if (x2b >= 0 && x2b < BrushType::DIST_TABLE_WIDTH && yb >= 0 && yb < BrushType::DIST_TABLE_WIDTH) - { - int lookup = BrushType::distance_tbl[int(x2b)][int(yb)]; - int intensity = fixed_scale(Brush::brush_type[brush.type].intensity_tbl[lookup][brushidx], opacity); - Color i = Color::create_from_a8r8g8b8(0xffffffff); - //Color i = Color::create_from_a8r8g8b8(image[y*size+x]); - i = Color::create_from_lerp(brush.color, i, intensity); - unsigned short c = i.get_r5g6b5(); - row0[0] = c; - row0[1] = c; - row1[0] = c; - row1[1] = c; - } - else - { - row0[0] = 0xffff; - row0[1] = 0xffff; - row1[0] = 0xffff; - row1[1] = 0xffff; - } - - row0 += 2; - row1 += 2; - - x2b += db*2; - } - yb += db*2; - } - } -}; - -#endif - diff --git a/src/setup.py b/src/setup.py deleted file mode 100644 index 1295652..0000000 --- a/src/setup.py +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env python - -""" -setup.py file for colorsc -""" - -from distutils.core import setup, Extension - -colorsc_module = Extension('_colorsc', sources=['canvas.cpp', 'palette.cpp', 'colorsc_wrap.cxx'] ) - -setup (name = 'colorsc', version = '0.1', - author = "Jens Andersson", - description = """Colors C extension library.""", - ext_modules = [colorsc_module], py_modules = ["colorsc"]) - |