max_stars_repo_path
stringlengths
2
976
max_stars_repo_name
stringlengths
5
109
max_stars_count
float64
0
191k
id
stringlengths
1
7
content
stringlengths
1
11.6M
score
float64
-0.83
3.86
int_score
int64
0
4
modules/bullet/bullet_physics_server.h
ZopharShinta/SegsEngine
0
7997083
/*************************************************************************/ /* bullet_physics_server.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2019 <NAME>, <NAME>. */ /* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #pragma once #include "core/rid.h" #include "servers/physics_server_3d.h" /** @author AndreaCatania */ class SpaceBullet; class AreaBullet; class ShapeBullet; class RigidBodyBullet; class SoftBodyBullet; class JointBullet; class CollisionObjectBullet; class RigidCollisionObjectBullet; class GODOT_EXPORT BulletPhysicsServer : public PhysicsServer3D { GDCLASS(BulletPhysicsServer,PhysicsServer3D) friend class BulletPhysicsDirectSpaceState; bool active; char active_spaces_count; Vector<SpaceBullet *> active_spaces; mutable RID_Owner<SpaceBullet> space_owner; mutable RID_Owner<ShapeBullet> shape_owner; mutable RID_Owner<AreaBullet> area_owner; mutable RID_Owner<RigidBodyBullet> rigid_body_owner; mutable RID_Owner<SoftBodyBullet> soft_body_owner; mutable RID_Owner<JointBullet> joint_owner; protected: static void _bind_methods(); public: BulletPhysicsServer(); ~BulletPhysicsServer() override; _FORCE_INLINE_ RID_Owner<SpaceBullet> *get_space_owner() { return &space_owner; } _FORCE_INLINE_ RID_Owner<ShapeBullet> *get_shape_owner() { return &shape_owner; } _FORCE_INLINE_ RID_Owner<AreaBullet> *get_area_owner() { return &area_owner; } _FORCE_INLINE_ RID_Owner<RigidBodyBullet> *get_rigid_body_owner() { return &rigid_body_owner; } _FORCE_INLINE_ RID_Owner<SoftBodyBullet> *get_soft_body_owner() { return &soft_body_owner; } _FORCE_INLINE_ RID_Owner<JointBullet> *get_joint_owner() { return &joint_owner; } /* SHAPE API */ RID shape_create(ShapeType p_shape) override; void shape_set_data(RID p_shape, const Variant &p_data) override; ShapeType shape_get_type(RID p_shape) const override; Variant shape_get_data(RID p_shape) const override; void shape_set_margin(RID p_shape, real_t p_margin) override; real_t shape_get_margin(RID p_shape) const override; /// Not supported void shape_set_custom_solver_bias(RID p_shape, real_t p_bias) override; /// Not supported real_t shape_get_custom_solver_bias(RID p_shape) const override; /* SPACE API */ RID space_create() override; void space_set_active(RID p_space, bool p_active) override; bool space_is_active(RID p_space) const override; /// Not supported void space_set_param(RID p_space, SpaceParameter p_param, real_t p_value) override; /// Not supported real_t space_get_param(RID p_space, SpaceParameter p_param) const override; PhysicsDirectSpaceState3D *space_get_direct_state(RID p_space) override; void space_set_debug_contacts(RID p_space, int p_max_contacts) override; const Vector<Vector3> &space_get_contacts(RID p_space) const override; int space_get_contact_count(RID p_space) const override; /* AREA API */ /// Bullet Physics Engine not support "Area", this must be handled by the game developer in another way. /// Since godot Physics use the concept of area even to define the main world, the API area_set_param is used to set initial physics world information. /// The API area_set_param is a bit hacky, and allow Godot to set some parameters on Bullet's world, a different use print a warning to console. /// All other APIs returns a warning message if used RID area_create() override; void area_set_space(RID p_area, RID p_space) override; RID area_get_space(RID p_area) const override; void area_set_space_override_mode(RID p_area, AreaSpaceOverrideMode p_mode) override; AreaSpaceOverrideMode area_get_space_override_mode(RID p_area) const override; void area_add_shape(RID p_area, RID p_shape, const Transform &p_transform = Transform(), bool p_disabled = false) override; void area_set_shape(RID p_area, int p_shape_idx, RID p_shape) override; void area_set_shape_transform(RID p_area, int p_shape_idx, const Transform &p_transform) override; int area_get_shape_count(RID p_area) const override; RID area_get_shape(RID p_area, int p_shape_idx) const override; Transform area_get_shape_transform(RID p_area, int p_shape_idx) const override; void area_remove_shape(RID p_area, int p_shape_idx) override; void area_clear_shapes(RID p_area) override; void area_set_shape_disabled(RID p_area, int p_shape_idx, bool p_disabled) override; void area_attach_object_instance_id(RID p_area, ObjectID p_id) override; ObjectID area_get_object_instance_id(RID p_area) const override; /// If you pass as p_area the SpaceBullet you can set some parameters as specified below /// AREA_PARAM_GRAVITY /// AREA_PARAM_GRAVITY_VECTOR /// Otherwise you can set area parameters void area_set_param(RID p_area, AreaParameter p_param, const Variant &p_value) override; Variant area_get_param(RID p_area, AreaParameter p_param) const override; void area_set_transform(RID p_area, const Transform &p_transform) override; Transform area_get_transform(RID p_area) const override; void area_set_collision_mask(RID p_area, uint32_t p_mask) override; void area_set_collision_layer(RID p_area, uint32_t p_layer) override; void area_set_monitorable(RID p_area, bool p_monitorable) override; void area_set_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) override; void area_set_area_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) override; void area_set_ray_pickable(RID p_area, bool p_enable) override; bool area_is_ray_pickable(RID p_area) const override; /* RIGID BODY API */ RID body_create(BodyMode p_mode = BODY_MODE_RIGID, bool p_init_sleeping = false) override; void body_set_space(RID p_body, RID p_space) override; RID body_get_space(RID p_body) const override; void body_set_mode(RID p_body, BodyMode p_mode) override; BodyMode body_get_mode(RID p_body) const override; void body_add_shape(RID p_body, RID p_shape, const Transform &p_transform = Transform(), bool p_disabled = false) override; // Not supported, Please remove and add new shape void body_set_shape(RID p_body, int p_shape_idx, RID p_shape) override; void body_set_shape_transform(RID p_body, int p_shape_idx, const Transform &p_transform) override; int body_get_shape_count(RID p_body) const override; RID body_get_shape(RID p_body, int p_shape_idx) const override; Transform body_get_shape_transform(RID p_body, int p_shape_idx) const override; void body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) override; void body_remove_shape(RID p_body, int p_shape_idx) override; void body_clear_shapes(RID p_body) override; // Used for Rigid and Soft Bodies void body_attach_object_instance_id(RID p_body, ObjectID p_id) override; ObjectID body_get_object_instance_id(RID p_body) const override; void body_set_enable_continuous_collision_detection(RID p_body, bool p_enable) override; bool body_is_continuous_collision_detection_enabled(RID p_body) const override; void body_set_collision_layer(RID p_body, uint32_t p_layer) override; uint32_t body_get_collision_layer(RID p_body) const override; void body_set_collision_mask(RID p_body, uint32_t p_mask) override; uint32_t body_get_collision_mask(RID p_body) const override; /// This is not supported by physics server void body_set_user_flags(RID p_body, uint32_t p_flags) override; /// This is not supported by physics server uint32_t body_get_user_flags(RID p_body) const override; void body_set_param(RID p_body, BodyParameter p_param, float p_value) override; float body_get_param(RID p_body, BodyParameter p_param) const override; void body_set_kinematic_safe_margin(RID p_body, real_t p_margin) override; real_t body_get_kinematic_safe_margin(RID p_body) const override; void body_set_state(RID p_body, BodyState p_state, const Variant &p_variant) override; Variant body_get_state(RID p_body, BodyState p_state) const override; void body_set_applied_force(RID p_body, const Vector3 &p_force) override; Vector3 body_get_applied_force(RID p_body) const override; void body_set_applied_torque(RID p_body, const Vector3 &p_torque) override; Vector3 body_get_applied_torque(RID p_body) const override; void body_add_central_force(RID p_body, const Vector3 &p_force) override; void body_add_force(RID p_body, const Vector3 &p_force, const Vector3 &p_pos) override; void body_add_torque(RID p_body, const Vector3 &p_torque) override; void body_apply_central_impulse(RID p_body, const Vector3 &p_impulse) override; void body_apply_impulse(RID p_body, const Vector3 &p_pos, const Vector3 &p_impulse) override; void body_apply_torque_impulse(RID p_body, const Vector3 &p_impulse) override; void body_set_axis_velocity(RID p_body, const Vector3 &p_axis_velocity) override; void body_set_axis_lock(RID p_body, BodyAxis p_axis, bool p_lock) override; bool body_is_axis_locked(RID p_body, BodyAxis p_axis) const override; void body_add_collision_exception(RID p_body, RID p_body_b) override; void body_remove_collision_exception(RID p_body, RID p_body_b) override; void body_get_collision_exceptions(RID p_body, Vector<RID> *p_exceptions) override; void body_set_max_contacts_reported(RID p_body, int p_contacts) override; int body_get_max_contacts_reported(RID p_body) const override; void body_set_contacts_reported_depth_threshold(RID p_body, float p_threshold) override; float body_get_contacts_reported_depth_threshold(RID p_body) const override; void body_set_omit_force_integration(RID p_body, bool p_omit) override; bool body_is_omitting_force_integration(RID p_body) const override; void body_set_force_integration_callback(RID p_body, Object *p_receiver, const StringName &p_method, const Variant &p_udata = Variant()) override; void body_set_ray_pickable(RID p_body, bool p_enable) override; bool body_is_ray_pickable(RID p_body) const override; // this function only works on physics process, errors and returns null otherwise PhysicsDirectBodyState3D *body_get_direct_state(RID p_body) override; bool body_test_motion(RID p_body, const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia, MotionResult *r_result = nullptr, bool p_exclude_raycast_shapes = true) override; int body_test_ray_separation(RID p_body, const Transform &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, SeparationResult *r_results, int p_result_max, float p_margin = 0.001) override; /* SOFT BODY API */ RID soft_body_create(bool p_init_sleeping = false) override; void soft_body_update_rendering_server(RID p_body, class SoftBodyVisualServerHandler *p_rendering_server_handler) override; void soft_body_set_space(RID p_body, RID p_space) override; RID soft_body_get_space(RID p_body) const override; void soft_body_set_mesh(RID p_body, const REF &p_mesh) override; void soft_body_set_collision_layer(RID p_body, uint32_t p_layer) override; uint32_t soft_body_get_collision_layer(RID p_body) const override; void soft_body_set_collision_mask(RID p_body, uint32_t p_mask) override; uint32_t soft_body_get_collision_mask(RID p_body) const override; void soft_body_add_collision_exception(RID p_body, RID p_body_b) override; void soft_body_remove_collision_exception(RID p_body, RID p_body_b) override; void soft_body_get_collision_exceptions(RID p_body, Vector<RID> *p_exceptions) override; void soft_body_set_state(RID p_body, BodyState p_state, const Variant &p_variant) override; Variant soft_body_get_state(RID p_body, BodyState p_state) const override; /// Special function. This function has bad performance void soft_body_set_transform(RID p_body, const Transform &p_transform) override; Vector3 soft_body_get_vertex_position(RID p_body, int vertex_index) const override; void soft_body_set_ray_pickable(RID p_body, bool p_enable) override; bool soft_body_is_ray_pickable(RID p_body) const override; void soft_body_set_simulation_precision(RID p_body, int p_simulation_precision) override; int soft_body_get_simulation_precision(RID p_body) override; void soft_body_set_total_mass(RID p_body, real_t p_total_mass) override; real_t soft_body_get_total_mass(RID p_body) override; void soft_body_set_linear_stiffness(RID p_body, real_t p_stiffness) override; real_t soft_body_get_linear_stiffness(RID p_body) override; void soft_body_set_areaAngular_stiffness(RID p_body, real_t p_stiffness) override; real_t soft_body_get_areaAngular_stiffness(RID p_body) override; void soft_body_set_volume_stiffness(RID p_body, real_t p_stiffness) override; real_t soft_body_get_volume_stiffness(RID p_body) override; void soft_body_set_pressure_coefficient(RID p_body, real_t p_pressure_coefficient) override; real_t soft_body_get_pressure_coefficient(RID p_body) override; void soft_body_set_pose_matching_coefficient(RID p_body, real_t p_pose_matching_coefficient) override; real_t soft_body_get_pose_matching_coefficient(RID p_body) override; void soft_body_set_damping_coefficient(RID p_body, real_t p_damping_coefficient) override; real_t soft_body_get_damping_coefficient(RID p_body) override; void soft_body_set_drag_coefficient(RID p_body, real_t p_drag_coefficient) override; real_t soft_body_get_drag_coefficient(RID p_body) override; void soft_body_move_point(RID p_body, int p_point_index, const Vector3 &p_global_position) override; Vector3 soft_body_get_point_global_position(RID p_body, int p_point_index) override; Vector3 soft_body_get_point_offset(RID p_body, int p_point_index) const override; void soft_body_remove_all_pinned_points(RID p_body) override; void soft_body_pin_point(RID p_body, int p_point_index, bool p_pin) override; bool soft_body_is_point_pinned(RID p_body, int p_point_index) override; /* JOINT API */ JointType joint_get_type(RID p_joint) const override; void joint_set_solver_priority(RID p_joint, int p_priority) override; int joint_get_solver_priority(RID p_joint) const override; void joint_disable_collisions_between_bodies(RID p_joint, const bool p_disable) override; bool joint_is_disabled_collisions_between_bodies(RID p_joint) const override; RID joint_create_pin(RID p_body_A, const Vector3 &p_local_A, RID p_body_B, const Vector3 &p_local_B) override; void pin_joint_set_param(RID p_joint, PinJointParam p_param, float p_value) override; float pin_joint_get_param(RID p_joint, PinJointParam p_param) const override; void pin_joint_set_local_a(RID p_joint, const Vector3 &p_A) override; Vector3 pin_joint_get_local_a(RID p_joint) const override; void pin_joint_set_local_b(RID p_joint, const Vector3 &p_B) override; Vector3 pin_joint_get_local_b(RID p_joint) const override; RID joint_create_hinge(RID p_body_A, const Transform &p_hinge_A, RID p_body_B, const Transform &p_hinge_B) override; RID joint_create_hinge_simple(RID p_body_A, const Vector3 &p_pivot_A, const Vector3 &p_axis_A, RID p_body_B, const Vector3 &p_pivot_B, const Vector3 &p_axis_B) override; void hinge_joint_set_param(RID p_joint, HingeJointParam p_param, float p_value) override; float hinge_joint_get_param(RID p_joint, HingeJointParam p_param) const override; void hinge_joint_set_flag(RID p_joint, HingeJointFlag p_flag, bool p_value) override; bool hinge_joint_get_flag(RID p_joint, HingeJointFlag p_flag) const override; /// Reference frame is A RID joint_create_slider(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) override; void slider_joint_set_param(RID p_joint, SliderJointParam p_param, float p_value) override; float slider_joint_get_param(RID p_joint, SliderJointParam p_param) const override; /// Reference frame is A RID joint_create_cone_twist(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) override; void cone_twist_joint_set_param(RID p_joint, ConeTwistJointParam p_param, float p_value) override; float cone_twist_joint_get_param(RID p_joint, ConeTwistJointParam p_param) const override; /// Reference frame is A RID joint_create_generic_6dof(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) override; void generic_6dof_joint_set_param(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisParam p_param, float p_value) override; float generic_6dof_joint_get_param(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisParam p_param) override; void generic_6dof_joint_set_flag(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisFlag p_flag, bool p_enable) override; bool generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisFlag p_flag) override; void generic_6dof_joint_set_precision(RID p_joint, int precision) override; int generic_6dof_joint_get_precision(RID p_joint) override; /* MISC */ void free_rid(RID p_rid) override; void set_active(bool p_active) override { active = p_active; } static bool singleton_isActive() { return static_cast<BulletPhysicsServer *>(get_singleton())->active; } bool isActive() { return active; } void init() override; void step(float p_deltaTime) override; void sync() override; void flush_queries() override; void finish() override; bool is_flushing_queries() const override { return false; } int get_process_info(ProcessInfo p_info) override; CollisionObjectBullet *get_collisin_object(RID p_object) const; RigidCollisionObjectBullet *get_rigid_collisin_object(RID p_object) const; /// Internal APIs public: };
1.359375
1
More/General/Pulsar/Flux.h
xuanyuanstar/psrchive_CDFT
0
7997091
//-*-C++-*- /*************************************************************************** * * Copyright (C) 2010 by <NAME> * Licensed under the Academic Free License version 2.1 * ***************************************************************************/ #ifndef __Pulsar_Flux_h #define __Pulsar_Flux_h #include "Pulsar/Algorithm.h" #include "Estimate.h" namespace Pulsar { class Profile; //! Computes average flux of a Profile. /*! Virtual base class, different algorithms implemented by * descendents. NOTE this class is very similar to the algorithms * currently used by the various S/N estimators, it may be possible * to merge the code. */ class Flux : public Algorithm { public: //! Default constructor Flux() {}; //! Destructor ~Flux() {}; //! Return flux Estimate<double> operator() (const Profile *p) { return get_flux(p); } //! Return flux w/ uncertainty //virtual Estimate<double> get_flux(const Profile *p) { return Estimate<double>(0,0); } virtual Estimate<double> get_flux(const Profile *p)=0; //! Return name of flux algorithm virtual std::string get_method() const { return ""; } protected: }; } #endif
1.875
2
include/cs106b/platform.h
ghenah/jericho
0
7997099
/* * File: platform.h * ---------------- * This file defines the <code>Platform</code> class, which encapsulates * the platform-specific parts of the StanfordCPPLib package. This file is * logically part of the implementation and is not interesting to clients. */ /*************************************************************************/ /* Stanford Portable Library */ /* Copyright (c) 2014 by <NAME> <<EMAIL>> */ /* */ /* This program 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. */ /* */ /* This program 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 this program. If not, see <http://www.gnu.org/licenses/>. */ /*************************************************************************/ #ifndef _platform_h #define _platform_h #include <string> #include <vector> #include "gevents.h" #include "gwindow.h" #include "sound.h" class Platform { private: Platform(); friend Platform *getPlatform(); public: virtual ~Platform(); void clearConsole(); void setConsoleFont(const std::string & font); void setConsoleSize(double width, double height); bool fileExists(std::string filename); bool isFile(std::string filename); bool isSymbolicLink(std::string filename); bool isDirectory(std::string filename); void setCurrentDirectory(std::string path); std::string getCurrentDirectory(); void createDirectory(std::string path); std::string getDirectoryPathSeparator(); std::string getSearchPathSeparator(); std::string expandPathname(std::string filename); void listDirectory(std::string path, vector<std::string> & list); std::string openFileDialog(std::string title, std::string mode, std::string path); void createGWindow(const GWindow & gw, double width, double height, GObject *topCompound); void deleteGWindow(const GWindow & gw); void close(const GWindow & gw); void requestFocus(const GWindow & gw); void clear(const GWindow & gw); void repaint(const GWindow & gw); void setVisible(const GWindow & gw, bool flag); void setResizable(const GWindow & gw, bool flag); void setWindowTitle(const GWindow & gw, std::string title); void setRegionAlignment(const GWindow & gw, std::string region, std::string align); void addToRegion(const GWindow & gw, GObject *gobj, std::string region); void removeFromRegion(const GWindow & gw, GObject *gobj, std::string region); void pause(double milliseconds); double getScreenWidth(); double getScreenHeight(); GEvent waitForEvent(int mask); GEvent getNextEvent(int mask); void exitGraphics(); void createTimer(const GTimer & timer, double delay); void deleteTimer(const GTimer & timer); void startTimer(const GTimer & timer); void stopTimer(const GTimer & timer); void createSound(Sound *sound, std::string filename); void deleteSound(Sound *sound); void playSound(Sound *sound); void createGRect(GObject *gobj, double width, double height); void createGRoundRect(GObject *gobj, double width, double height, double corner); void createG3DRect(GObject *gobj, double width, double height, bool raised); void setRaised(GObject *gobj, bool raised); void createGOval(GObject *gobj, double width, double height); void createGArc(GObject *gobj, double width, double height, double start, double sweep); void setStartAngle(GObject *gobj, double angle); void setSweepAngle(GObject *gobj, double angle); void createGLine(GObject *gobj, double x1, double y1, double x2, double y2); void setStartPoint(GObject *gobj, double x, double y); void setEndPoint(GObject *gobj, double x, double y); void createGLabel(GObject *gobj, std::string label); GDimension createGImage(GObject *gobj, std::string filename); void createGPolygon(GObject *gobj); void addVertex(GObject *gobj, double x, double y); void setActionCommand(GObject *gobj, std::string cmd); GDimension getSize(GObject *gobj); void createGButton(GObject *gobj, std::string label); void createGCheckBox(GObject *gobj, std::string label); bool isSelected(GObject *gobj); void setSelected(GObject *gobj, bool state); void createGSlider(GObject *gobj, int min, int max, int value); int getValue(GObject *gobj); void setValue(GObject *gobj, int value); void createGTextField(GObject *gobj, int nChars); std::string getText(GObject *gobj); void setText(GObject *gobj, std::string str); void createGChooser(GObject *gobj); void addItem(GObject *gobj, std::string item); std::string getSelectedItem(GObject *gobj); void setSelectedItem(GObject *gobj, std::string item); void createGCompound(GObject *gobj); void deleteGObject(GObject *gobj); void add(GObject *compound, GObject *gobj); void remove(GObject *gobj); void sendForward(GObject *gobj); void sendToFront(GObject *gobj); void sendBackward(GObject *gobj); void sendToBack(GObject *gobj); void setVisible(GObject *gobj, bool flag); void setColor(GObject *gobj, std::string color); void scale(GObject *gobj, double sx, double sy); void rotate(GObject *gobj, double theta); GRectangle getBounds(const GObject *gobj); bool contains(const GObject *gobj, double x, double y); void setLineWidth(GObject *gobj, double lineWidth); void setLocation(GObject *gobj, double x, double y); void setSize(GObject *gobj, double width, double height); void setFrameRectangle(GObject *gobj, double x, double y, double width, double height); void draw(const GWindow & gw, const GObject *gobj); void setFilled(GObject *gobj, bool flag); void setFillColor(GObject *gobj, std::string color); void setFont(GObject *gobj, std::string font); void setLabel(GObject *gobj, std::string str); double getFontAscent(const GObject *gobj); double getFontDescent(const GObject *gobj); GDimension getGLabelSize(const GObject *gobj); }; Platform *getPlatform(); #endif
1.132813
1
src/psg/initacqparms.c
timburrow/ovj-private
1
7997107
/* * Copyright (C) 2015 University of Oregon * * You may distribute under the terms of either the GNU General Public * License or the Apache License, as specified in the LICENSE file. * * For more information, see the LICENSE file. */ /*----------------------------------------------------------------- | | Modified Author Purpose | -------- ------ ------- | 4/21/89 <NAME>. 1. Corrected alogrithm in ra_initacqparms() | to to handle both il='y' & 'n'. | 4/28/89 <NAME>. 1. More fixes to alogrithm in ra_initacqparms() | Important Note: alogrithm will not work | when il=f# is valid entry !!!! | | 6/29/89 <NAME>. 1. Use new global parameters to initial lc & | calc. acode offsets | +------------------------------------------------------------------*/ #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <sys/file.h> #include <string.h> #include <errno.h> #include <netinet/in.h> #include "mfileObj.h" #include "variables.h" #include "data.h" #include "group.h" #include "acodes.h" #include "rfconst.h" #include "acqparms.h" #include "dsp.h" /* PSG_LC conditional compiles lc.h properly for PSG */ #ifndef PSG_LC #define PSG_LC #endif #include "lc.h" #include "lc_index.h" #include "shrexpinfo.h" #define PRTLEVEL 1 #ifdef DEBUG #define DPRINT(level, str) \ if (bgflag >= level) fprintf(stderr,str) #define DPRINT1(level, str, arg1) \ if (bgflag >= level) fprintf(stderr,str,arg1) #define DPRINT2(level, str, arg1, arg2) \ if (bgflag >= level) fprintf(stderr,str,arg1,arg2) #define DPRINT3(level, str, arg1, arg2, arg3) \ if (bgflag >= level) fprintf(stderr,str,arg1,arg2,arg3) #define DPRINT4(level, str, arg1, arg2, arg3, arg4) \ if (bgflag >= level) fprintf(stderr,str,arg1,arg2,arg3,arg4) #else #define DPRINT(level, str) #define DPRINT1(level, str, arg2) #define DPRINT2(level, str, arg1, arg2) #define DPRINT3(level, str, arg1, arg2, arg3) #define DPRINT4(level, str, arg1, arg2, arg3, arg4) #endif extern double parmult(); extern double getval(); extern double sign_add(); /* add roundoff according to sign */ extern long acqpar_seek(); extern int putcode(); /*extern autodata autostruct; */ extern int clr_at_blksize_mode; extern int lockfid_mode; extern int bgflag; /*extern int dsp_info[];*/ extern long rt_tab[]; extern int newacq; extern int acqiflag; /* for interactive acq. or not? */ extern char fileRFpattern[]; extern double relaxdelay; extern double dtmmaxsum; extern codeint ilssval,ilctss,ssval,ctss; static int acqfd; static struct datafilehead acqfileheader; static struct datablockhead acqblockheader; static acqparmsize = sizeof(autodata) + sizeof(Acqparams); static char infopath[256]; static MFILE_ID ifile = NULL; /* inova datafile for ra */ static char *savedoffsetAddr; /* saved inova offset header */ #define AUTOLOC 1 /* offset into lc struct for autod struct */ #define ACODEB 11 /* offset to beginning of Acodes */ #define ACODEP 12 #define RRI_SHIMSET 5 /* shimset number for RRI Shims */ extern unsigned long start_elem; /* elem (FID) for acquisition to start on (RA)*/ extern unsigned long completed_elem; /* total number of completed elements (FIDs) (RA) */ extern int num_tables; /* number of tables for acodes */ extern Acqparams *Alc; SHR_EXP_STRUCT ExpInfo; static long max_ct; static long ss2val; double psync; double ldshimdelay,oneshimdelay; int ok2bumpflag; double dsposskipdelay=0.0; /*----------------------------------------------------------------- | | initacqparms() | initialize acquisition parameters pass in code section | | get experimental parameters and setup data pointers | Author <NAME> 6/26/86 | Note: setup_parfile should be executed before this routine. | Modified Author Purpose | -------- ------ ------- | 2/10/89 <NAME>. 1. Added Code to set low core element lc->acqelemid | 5/2/91 <NAME>. 1. low core element lc->acqelemid is a codelong now +---------------------------------------------------------------*/ initacqparms(fidn) unsigned long fidn; { char dp[MAXSTR]; char cp[MAXSTR]; char ok2bumpstr[MAXSTR]; long np_words; /* total # of data point words */ codeint ss; /* steady state count */ codeint cttime; /* #CTs between screen updates to Host */ codeint dpflag; /* double precision flag = 2 or 4 */ codeint blocks; /* data size in blocks (256words) */ codeint asize; /* data size in blocks (256words) */ codelong tot_np; /* np size */ codelong curct, bsct4ra; int i; int topword; int botword; int times; int bytes; int words; int fifotype; double tmpval; /* initialize lc */ std_lc_init(); /* configuration test word for acquisition to confirm */ fifotype = (fifolpsize < 70) ? 0x0 : 0x0100; /* --- calc. CTs between updates of CT to Host CPU --- */ if ( P_getreal(CURRENT,"cttime",&tmpval,1) < 0 ) { tmpval = 0.0; /* if not found assume 0 */ } cttime = (int) (sign_add(tmpval, 0.0005)); if (cttime < 1) cttime = 5; /* update every 5 secs */ cttime = (int) ((double) cttime / (d1+ (np/sw) + 0.1)); ss2val = 0; if (!var_active("ss",CURRENT)) { ss = 0; } else { ss = (codeint) (sign_add(getval("ss"), 0.0005)); if (ss >= 0) { if ( P_getreal(CURRENT,"ss2",&tmpval,1) >= 0 ) { if (var_active("ss2",CURRENT)) { ss2val = sign_add(tmpval, 0.0005); if (ss2val < 1) ss2val = 0; } } } } if (ss != 0) cttime = 0; /* no ct display with steady state else if ( cttime > 32767) cttime = 32767; /* max ct between updates */ else if (cttime < 1) cttime = 1; /* --- completed transients (ct) --- */ if ((P_getreal(CURRENT,"ct",&tmpval,1)) >= 0) { curct = (int) (tmpval + 0.0005); } else { text_error("initacqparms(): cannot find ct."); psg_abort(1); } bsct4ra = (bs + 0.005); if (newacq) /* test for newacq added at request of DJI, 08/1996 */ { if (bsct4ra > 0) bsct4ra = curct/bsct4ra; /* for ra, check nt and ct and interleaving */ /* for ra, curct handled in ra_initacqparms or ra_inovaacqparms. */ if (curct == nt) { if (getIlFlag()) { if (getStartFidNum() > 1) bsct4ra = bsct4ra - 1; } else { bsct4ra = 0; } } else { if (getIlFlag()) { if (getStartFidNum() > 1) bsct4ra = bsct4ra - 1; } } if (bsct4ra < 0) bsct4ra = 0; } getstr("dp",dp); if (newacq) /* test for newacq since U+ expects 0 or 4 not 2 or 4 08/1996 */ { dpflag = (dp[0] == 'y') ? 4 : 2; /* single - 2, double - 4 INOVA */ } else { dpflag = (dp[0] == 'y') ? 4 : 0; /* single - 0, double - 4 UNITY Plus */ } /* Init maxsum */ if ( P_getreal(CURRENT,"dtmmaxsum",&dtmmaxsum,1) < 0 ) { dtmmaxsum = (double) 0x7ff00000; /* if not found assume max */ if (dpflag == 2) dtmmaxsum = (double) 0x7fff; /* single precision max */ } /* --- setup real time np with total data points to be take --- */ /* the STM will expect this many points */ /* data pts * # of fids */ tot_np = (codelong) ((long) (np + .0005)) * ((long) (nf + 0.005)); /*if (dsp_info[0] == 0)*/ if (dsp_params.il_oversamp > 1) { /* Inline DSP acquires more points so data block allocation is larger */ /*tot_np *= (codelong) dsp_info[1];*/ /*tot_np += (codelong) dsp_info[3];*/ tot_np *= (codelong) dsp_params.il_oversamp; tot_np += (codelong) dsp_params.il_extrapts; /* Bypass hardware if present */ asize = 1; } else { char tmpstr[256]; /* Real-time DSP uses this for oversampling and decimation */ /*asize = (dsp_info[1] & 0xff);*/ asize = (dsp_params.rt_oversamp & 0xff); if (P_getstring(CURRENT, "osfilt", tmpstr, 1, 255) >= 0 ) { if ( (tmpstr[0] == 'b') || (tmpstr[0] == 'B') ) if ( (tmpstr[1] >= '1') && (tmpstr[1] <= '7') ) asize |= ((tmpstr[1]-'0') << 8); else asize |= (1 << 8); } } if (dpflag == 4) asize |= 0xC000; np_words = tot_np; if (dpflag == 4) np_words *= 2L; /* double size for double precision data */ if (bgflag) fprintf(stderr,"np: %lf, nf: %lf , asize = %x\n",np,nf,asize); blocks = (codeint) ((np_words + 255L) / 256L); /* block = 256 words */ getstr("cp",cp); cpflag = (cp[0] == 'y') ? 0 : 1; if ( P_getreal(CURRENT,"mxconst",&tmpval,1) < 0 ) { tmpval = 0.0; /* if not found assume 0 */ } /* Get relaxation delay for acqi and interelement delay */ if (option_check("qtune")) { relaxdelay = -1.0; } else if ( P_getreal(CURRENT,"relaxdelay",&relaxdelay,1) < 0 ) { if (acqiflag) relaxdelay = 0.020; /* if not found assume 20 millisecs */ else relaxdelay = 0.0; /* if not found assume 0 */ } else if (relaxdelay > 2.0) { text_error("relaxdelay truncated to maximum relaxdelay: 2 sec"); relaxdelay = 2.0; } /* Get parser synchronization delay, for testing */ if ( P_getreal(CURRENT,"psync",&psync,1) < 0 ) { psync = 0.020; /* if not found assume 20 millisecs */ } /* Get parser synchronization delay, for testing */ if ( P_getreal(CURRENT,"ldshimdelay",&ldshimdelay,1) < 0 ) { if ( P_getreal(GLOBAL,"ldshimdelay",&ldshimdelay,1) < 0 ) { double tmpshimset; ldshimdelay = 4.5; /* if not found assume 4.5 sec */ if ( P_getreal(GLOBAL,"shimset",&tmpshimset,1) < 0 ) { tmpshimset = 1.0; } if ((int)(tmpshimset) == RRI_SHIMSET) ldshimdelay = 15.0; /* 15 secs to load RRI shims */ } } /* Get parser synchronization delay, for one shim for testing */ if ( P_getreal(CURRENT,"oneshimdelay",&oneshimdelay,1) < 0 ) { if ( P_getreal(GLOBAL,"oneshimdelay",&oneshimdelay,1) < 0 ) { double tmpshimset; oneshimdelay = 0.080; /* if not found assume 0.08 for one shim */ if ( P_getreal(GLOBAL,"shimset",&tmpshimset,1) < 0 ) { tmpshimset = 1.0; } if ((int)(tmpshimset) == RRI_SHIMSET) oneshimdelay = 0.3; /* 0.3 secs to load one RRI shim */ } } ok2bumpflag = 0; if (P_getstring(CURRENT, "ok2bump", ok2bumpstr, 1, sizeof( ok2bumpstr - 1 )) >= 0 ) { if (ok2bumpstr[ 0 ] == 'Y' || ok2bumpstr[ 0 ] == 'y') ok2bumpflag = 1; } xmtrstep = 90.0; decstep = 90.0; custom_lc_init( /* Alc->acqidver */ (codeint) ((idc & 0x00ff) | fifotype), /* Alc->acqelemid */ (codeulong) fidn, /* Alc->acqctctr */ (codeint) cttime, /* Alc->acqdsize */ (codeint) blocks, /* Alc->acqnp */ (codelong) tot_np, /* Alc->acqnt */ (codelong) (nt + 0.0001), /* Alc->acqdpf */ (codeint) dpflag, /* Alc->acqbs */ (codeint) (bs + 0.005), /* Alc->acqbsct */ (codeint) bsct4ra, /* Alc->acqss */ (codeint) ss, /* Alc->acqasize */ (codeint) asize, /* Alc->acqcpf */ (codeint) cpflag, /* Alc->acqmaxconst */ (codeint) (sign_add(tmpval,0.005)), /* arraydim */ (codeulong) (ExpInfo.NumAcodes), /* relaxdelay */ (codeulong) (relaxdelay*1e8), /* Alc->acqct */ (codelong) curct, /* Alc->clrbsflag */ (codeint) clr_at_blksize_mode, /* lockflag */ (codeint) lockfid_mode ); } /*----------------------------------------------------------------- | | convertdbl()/3 | convert a double value into two integers. | A top word and a bottom word | (e.g., 131572.0 -> topword: 2 (131572.0 / 65536.0) | botword: 500 ( remainder from above ). | 131572 = 2 * 65536 + 500 | | Author <NAME> 6/26/86 +------------------------------------------------------------------*/ convertdbl(value,topint,botint) double value; int *topint; int *botint; { long long val; int top; int bot; if (value < 0.0) value = -value; val = (long long) (value + 0.0005); top = val / 65536; bot = val % 65536; if (bgflag) fprintf(stderr,"convertdbl(): value: %lf top: %ld bot: %ld \n", value,top,bot); *topint = top; *botint = bot; } /*----------------------------------------------------------------- | | ra_initacqparms(fid#) | update and fill in lc parameters from exp#/acqfil/acqpar | from previous go. | Author <NAME> 8/01/88 | Modified Author Purpose | -------- ------ ------- | 2/10/89 <NAME>. 1. Added alogrithm to calc. start_elem and | complete_elem for ra. | 4/21/89 <NAME>. 1. Corrected alogrithm to to handle both | il='y' & 'n'. | 4/28/89 <NAME>. 1. More fixes to alogrithm | Important Note: alogrithm will not work | when il=f# is valid entry !!!! | 2/22/90 <NAME>. 1. return 0 if no blockheader data, return 1 if | blockheader data present. +---------------------------------------------------------------*/ ra_initacqparms(fidn) unsigned long fidn; /* fid number to obtain the acqpar parameters for */ { Acqparams *lc,*ra_lc; autodata *autoptr; char msge[256]; int len1,len2; codeint acqbuffer[512]; struct datablockhead acqblockheader; if (fidn == 1) { max_ct = 0L; } acqpar_seek(fidn); /* move to proper fid entry in acqpar */ len1 = read(acqfd,&acqblockheader,sizeof(struct datablockhead)); len2 = read(acqfd,acqbuffer,acqparmsize); DPRINT3(PRTLEVEL,"ra_init: fid %lu, blockhdr %d, lc & auto %d\n", fidn,len1,len2); if ( (len1 == 0) || (len2 == 0) ) { if (max_ct != -1L) /* no start selected, 1st none acquire fid is start */ { start_elem = fidn; max_ct = -1L; /* only set start_elem once */ DPRINT3(PRTLEVEL,"fid: %lu, start_elem = %lu, max_ct = %d \n", fidn,start_elem,max_ct); } return(0); /* no further data */ } ra_lc = (Acqparams *) acqbuffer; /* ra lc parameters */ lc = (Acqparams *) lc_stadr; /* initialize lc parameters */ DPRINT2(PRTLEVEL,"lc-> 0x%lx, ra_lc-> 0x%lx\n",lc,ra_lc); DPRINT2(PRTLEVEL,"ct=%ld, ra ct=%ld\n",lc->acqct,ra_lc->acqct); DPRINT2(PRTLEVEL,"np=%ld, ra np=%ld\n",lc->acqnp,ra_lc->acqnp); DPRINT2(PRTLEVEL,"nt=%ld, ra nt=%ld\n",lc->acqnt,ra_lc->acqnt); /* find the maximum ct acquired without actually completing the FID */ /* the assumption here is that fids are acquired 1 to arraydim */ /* i.e., 1st fid ct>0 is max ct acquired so far */ if ( (ra_lc->acqct != ra_lc->acqnt) && (max_ct == 0L) ) { max_ct = ra_lc->acqct; start_elem = fidn; /* maybe start_elem */ } DPRINT3(PRTLEVEL,"fid: %lu, start_elem = %lu, max_ct = %d \n", fidn,start_elem,max_ct); DPRINT1(PRTLEVEL,"il='%s'\n",il); if ( (max_ct != 0L) && (max_ct != -1L) && (ra_lc->acqct != ra_lc->acqnt) ) { /* first elem with bs!=bsct or ct < max_ct , if il!='n' is the start_elem */ if ( (il[0] != 'n') && (il[0] != 'N') ) { if ( (ra_lc->acqbsct != ra_lc->acqbs) || (ra_lc->acqct < max_ct) ) { start_elem = fidn; max_ct = -1L; /* only set start_elem once */ } } else { start_elem = fidn; max_ct = -1L; /* only set start_elem once */ } } DPRINT3(PRTLEVEL,"fid: %lu, start_elem = %lu, max_ct = %d \n", fidn,start_elem,max_ct); if (ra_lc->acqct == ra_lc->acqnt) { lc->acqnt = ra_lc->acqnt; /* nt can not be change for completed fids */ completed_elem++; /* total number of completed elements (FIDs) (RA) */ } else if ( lc->acqnt <= ra_lc->acqct ) { lc->acqnt = ra_lc->acqnt; /* nt can not be made <= to ct , for now. */ sprintf(msge,"WARNING: FID:%d 'nt' <= 'ct', original 'nt' used.\n", fidn); text_error(msge); } DPRINT2(PRTLEVEL,"nt=%ld, ra nt=%ld\n",lc->acqnt,ra_lc->acqnt); if (ra_lc->acqnp != lc->acqnp) { sprintf(msge,"WARNING 'np' has changed from %ld to %ld.\n", ra_lc->acqnp,lc->acqnp); text_error(msge); } if (ra_lc->acqdpf != lc->acqdpf) { text_error("data precision changed, PSG aborting."); psg_abort(1); } lc->acqct = ra_lc->acqct; lc->acqisum = ra_lc->acqisum; lc->acqrsum = ra_lc->acqrsum; lc->acqstmar = ra_lc->acqstmar; lc->acqstmcr = ra_lc->acqstmcr; DPRINT2(PRTLEVEL,"maxscale %hd, ra %hd\n",lc->acqmaxscale,ra_lc->acqmaxscale); lc->acqmaxscale = ra_lc->acqmaxscale; lc->acqicmode = ra_lc->acqicmode; lc->acqstmchk = ra_lc->acqstmchk; lc->acqnflag = ra_lc->acqnflag; DPRINT2(PRTLEVEL,"scale %hd, ra %hd\n",lc->acqscale,ra_lc->acqscale); lc->acqscale = ra_lc->acqscale; lc->acqcheck = ra_lc->acqcheck; lc->acqoph = ra_lc->acqoph; lc->acqbsct = ra_lc->acqbsct; lc->acqssct = ra_lc->acqssct; lc->acqctcom = ra_lc->acqctcom; lc->acqtablert = ra_lc->acqtablert; lc->acqv1 = ra_lc->acqv1; lc->acqv2 = ra_lc->acqv2; lc->acqv3 = ra_lc->acqv3; lc->acqv4 = ra_lc->acqv4; lc->acqv5 = ra_lc->acqv5; lc->acqv6 = ra_lc->acqv6; lc->acqv7 = ra_lc->acqv7; lc->acqv8 = ra_lc->acqv8; lc->acqv9 = ra_lc->acqv9; lc->acqv10 = ra_lc->acqv10; lc->acqv11 = ra_lc->acqv11; lc->acqv12 = ra_lc->acqv12; lc->acqv13 = ra_lc->acqv13; lc->acqv14 = ra_lc->acqv14; return(1); /* data found and lc updated */ } /*--------------------------------------------------------------------- | set_counter()/ | | Sets ss counters for each element +-------------------------------------------------------------------*/ set_counters() { long ilsstmp, ilctsstmp; if (Alc->acqss < 0) { Alc->acqssct = -1 * Alc->acqss; ilsstmp = Alc->acqssct; } else if (ix == getStartFidNum()) { Alc->acqssct = Alc->acqss; ilsstmp = ss2val; } else if (ss2val) { Alc->acqssct = ss2val; ilsstmp = ss2val; } else { Alc->acqssct = 0; ilsstmp = 0; } Alc->acqrtvptr = ( Alc->acqnt - (Alc->acqssct % Alc->acqnt) + Alc->acqct ) % Alc->acqnt; ilctsstmp = ( Alc->acqnt - (ilsstmp % Alc->acqnt) + Alc->acqct ) % Alc->acqnt; if (newacq) { init_acqvar(ilssval,ilsstmp); init_acqvar(ilctss,ilctsstmp); } } /*--------------------------------------------------------------------- | ss4autoshim()/ | | Sets ss counters if autoshimming. | Only set if ss > 1 and the counters have not been set. +-------------------------------------------------------------------*/ ss4autoshim() { if (newacq) { if ((Alc->acqss > 0) && (ix != getStartFidNum())) { Alc->acqssct = Alc->acqss; Alc->acqrtvptr = (Alc->acqnt - (Alc->acqssct % Alc->acqnt) + Alc->acqct) % Alc->acqnt; init_acqvar(ssval,(long)Alc->acqssct); init_acqvar(ctss,(long)Alc->acqrtvptr); } } } /*--------------------------------------------------------------------- | open_acqpar(path)/1 | | Position the disk read/write heads to the proper block offset | for the acqpar file (lc,auto structure parameters. +-------------------------------------------------------------------*/ open_acqpar(filename) char *filename; { int len; if (bgflag) fprintf(stderr,"Opening Acqpar file: '%s' \n",filename); acqfd = open(filename,O_EXCL | O_RDONLY ,0666); if (acqfd < 0) { text_error("Cannot open acqpar file: '%s', RA not possible.\n",filename); psg_abort(1); } len = read(acqfd,&acqfileheader,sizeof(struct datafilehead)); if (len < 1) { text_error("Cannot read acqpar file: '%s'\n",filename); psg_abort(1); } } /*--------------------------------------------------------------------- | acqpar_seek(index)/1 | | Position the disk read/write heads to the proper block offset | for the acqpar file (lc,auto structure parameters. | | Modified Author Purpose | -------- ------ ------- | 2/10/89 <NAME>. 1. Routine now returns the (long) position of seek +-------------------------------------------------------------------*/ long acqpar_seek(elemindx) unsigned long elemindx; { int acqoffset; long pos; acqoffset = sizeof(acqfileheader) + (acqfileheader.bbytes * ((unsigned long) (elemindx - 1))) ; if (bgflag) fprintf(stderr,"acqpar_seek(): fid# = %d,acqoffset = %d \n", elemindx,acqoffset); pos = lseek(acqfd, acqoffset,SEEK_SET); if (pos == -1) { char *str_err; if ( (str_err = strerror(errno) ) != NULL ) { fprintf(stdout,"acqpar_seek Error: offset %ld,: %s\n", acqoffset,str_err); } return(-1); } return(pos); } int setup_parfile(suflag) int suflag; { double tmp; char tmpstr[256]; int t; char *ptr; ExpInfo.PSGident = 1; /* identify as 'C' varient PSG, Java == 100 */ if ((P_getreal(CURRENT,"priority",&tmp,1)) >= 0) ExpInfo.Priority = (int) (tmp + 0.0005); else ExpInfo.Priority = 0; if ((P_getreal(CURRENT,"nt",&tmp,1)) >= 0) ExpInfo.NumTrans = (int) (tmp + 0.0005); else { text_error("initacqqueue(): cannot set nt."); psg_abort(1); } if ((P_getreal(CURRENT,"bs",&tmp,1)) >= 0) ExpInfo.NumInBS = (int) (tmp + 0.0005); else { text_error("initacqqueue(): cannot set bs."); psg_abort(1); } if (!(var_active("bs",CURRENT))) ExpInfo.NumInBS = 0; if ((P_getreal(CURRENT,"np",&tmp,1)) >= 0) ExpInfo.NumDataPts = (int) (tmp + 0.0005); else { text_error("initacqqueue(): cannot set np."); psg_abort(1); } /* --- Number of FIDs per CT --- */ if ((P_getreal(CURRENT,"nf",&tmp,1)) >= 0) { DPRINT2(1,"initacqqueue(): nf = %5.0lf, active = %d \n", tmp,var_active("nf",CURRENT)); if ( (tmp < 2.0 ) || (!(var_active("nf",CURRENT))) ) { tmp = 1.0; } } else /* no nf, so set it to one. */ { tmp = 1.0; } ExpInfo.NumFids = (int) (tmp + 0.0005); if (P_getstring(CURRENT,"dp",tmpstr,1,4) < 0) { text_error("initacqqueue(): cannot get dp"); psg_abort(1); } ExpInfo.DataPtSize = (tmpstr[0] == 'y') ? 4 : 2; /* --- receiver gain --- */ if ((P_getreal(CURRENT,"gain",&tmp,1)) >= 0) ExpInfo.Gain = (int) (tmp + 0.0005); else { text_error("initacqqueue(): cannot set gain."); psg_abort(1); } /* --- sample spin rate --- */ if ((P_getreal(CURRENT,"spin",&tmp,1)) >= 0) ExpInfo.Spin = (int) (tmp + 0.0005); else { text_error("initacqqueue(): cannot set spin."); psg_abort(1); } /* --- completed transients (ct) --- */ if ((P_getreal(CURRENT,"ct",&tmp,1)) >= 0) ExpInfo.CurrentTran = (int) (tmp + 0.0005); else { text_error("initacqqueue(): cannot set ct."); psg_abort(1); } /* --- number of fids --- */ if ((P_getreal(CURRENT,"arraydim",&tmp,1)) >= 0) ExpInfo.ArrayDim = (int) (tmp + 0.0005); else { text_error("initacqqueue(): cannot read arraydim."); psg_abort(1); } if ((P_getreal(CURRENT,"acqcycles",&tmp,1)) >= 0) ExpInfo.NumAcodes = (int) (tmp + 0.0005); else { text_error("initacqqueue(): cannot read acqcycles."); psg_abort(1); } ExpInfo.FidSize = ExpInfo.DataPtSize * ExpInfo.NumDataPts * ExpInfo.NumFids; ExpInfo.DataSize = sizeof(struct datafilehead); ExpInfo.DataSize += (unsigned long long) (sizeof(struct datablockhead) + ExpInfo.FidSize) * (unsigned long long) ExpInfo.ArrayDim; /* --- path to the user's experiment work directory --- */ if (P_getstring(GLOBAL,"userdir",tmpstr,1,255) < 0) { text_error("initacqqueue(): cannot get userdir"); psg_abort(1); } strcpy(ExpInfo.UsrDirFile,tmpstr); if (P_getstring(GLOBAL,"systemdir",tmpstr,1,255) < 0) { text_error("initacqqueue(): cannot get systemdir"); psg_abort(1); } strcpy(ExpInfo.SysDirFile,tmpstr); if (P_getstring(GLOBAL,"curexp",tmpstr,1,255) < 0) { text_error("initacqqueue(): cannot get curexp"); psg_abort(1); } strcpy(ExpInfo.CurExpFile,tmpstr); /* --- suflag */ ExpInfo.GoFlag = suflag; /* -------------------------------------------------------------- | Unique name to this GO, | vnmrsystem/acqqueue/id is path to acq proccess files | | Notice that goid is an array of strings, with each | element having a carefully defined meaning. +-----------------------------------------------------------------*/ if (P_getstring(CURRENT,"goid",infopath,1,255) < 0) { text_error("initacqqueue(): cannot get goid"); psg_abort(1); } strcpy(ExpInfo.Codefile,infopath); strcat(ExpInfo.Codefile,".Code"); strcpy(ExpInfo.RTParmFile,infopath); strcat(ExpInfo.RTParmFile,".RTpars"); strcpy(ExpInfo.TableFile,infopath); strcat(ExpInfo.TableFile,".Tables"); ExpInfo.WaveFormFile[0] = '\0'; ExpInfo.GradFile[0] = '\0'; /* Beware that infopath gets accessed again if acqiflag is set, for the data file path */ /* --- file path to named acqfile or exp# acqfile 'file' --- */ if (!acqiflag) { int autoflag; char autopar[12]; if (P_getstring(CURRENT,"exppath",tmpstr,1,255) < 0) { text_error("initacqqueue(): cannot get exppath"); psg_abort(1); } strcpy(ExpInfo.DataFile,tmpstr); ExpInfo.InteractiveFlag = 0; if (getparm("auto","string",GLOBAL,autopar,12)) autoflag = 0; else autoflag = ((autopar[0] == 'y') || (autopar[0] == 'Y')); ExpInfo.ExpFlags = 0; if (autoflag) { strcat(ExpInfo.DataFile,".fid"); ExpInfo.ExpFlags |= AUTOMODE_BIT; /* set automode bit */ } if (ra_flag) ExpInfo.ExpFlags |= RESUME_ACQ_BIT; /* set RA bit */ if (clr_at_blksize_mode) ExpInfo.ExpFlags |= CLR_AT_BS_BIT; /* For "Repeat Scan" */ } else { strcpy(ExpInfo.DataFile,infopath); strcat(ExpInfo.DataFile,".Data"); ExpInfo.InteractiveFlag = 1; ExpInfo.ExpFlags = 0; } if (P_getstring(CURRENT,"goid",tmpstr,2,255) < 0) { text_error("initacqqueue(): cannot get goid: user"); psg_abort(1); } strcpy(ExpInfo.UserName,tmpstr); if (P_getstring(CURRENT,"goid",tmpstr,3,255) < 0) { text_error("initacqqueue(): cannot get goid: exp number"); psg_abort(1); } ExpInfo.ExpNum = atoi(tmpstr); if (P_getstring(CURRENT,"goid",tmpstr,4,255) < 0) { text_error("initacqqueue(): cannot get goid: exp"); psg_abort(1); } strcpy(ExpInfo.AcqBaseBufName,tmpstr); if (P_getstring(GLOBAL,"vnmraddr",tmpstr,1,255) < 0) { text_error("initacqqueue(): cannot get vnmraddr"); psg_abort(1); } strcpy(ExpInfo.MachineID,tmpstr); /* --- interleave parameter 'il' --- */ if (P_getstring(CURRENT,"il",tmpstr,1,4) < 0) { text_error("initacqqueue(): cannot get il"); psg_abort(1); } ExpInfo.IlFlag = ((tmpstr[0] != 'n') && (tmpstr[0] != 'N')) ? 1 : 0; if (ExpInfo.IlFlag) { if (ExpInfo.NumAcodes <= 1) ExpInfo.IlFlag = 0; if (ExpInfo.NumInBS == 0) ExpInfo.IlFlag = 0; if (ExpInfo.NumTrans <= ExpInfo.NumInBS) ExpInfo.IlFlag = 0; } /* --- current element 'celem' --- */ if ((P_getreal(CURRENT,"celem",&tmp,1)) >= 0) ExpInfo.Celem = (int) (tmp + 0.0005); else { text_error("initacqqueue(): cannot set celem."); psg_abort(1); } /* --- Check for valid RA --- */ ExpInfo.RAFlag = 0; /* RaFlag */ if (ra_flag) { /* --- Do RA stuff --- */ ExpInfo.RAFlag = 1; /* RaFlag */ if (ExpInfo.IlFlag) { if ((ExpInfo.CurrentTran % ExpInfo.NumInBS) != 0) ExpInfo.Celem = ExpInfo.Celem - 1; else { if ((ExpInfo.Celem < ExpInfo.NumAcodes) && (ExpInfo.CurrentTran >= ExpInfo.NumInBS)) ExpInfo.CurrentTran = ExpInfo.CurrentTran - ExpInfo.NumInBS; } } else { if ((ExpInfo.CurrentTran > 0) && (ExpInfo.CurrentTran < ExpInfo.NumTrans)) ExpInfo.Celem = ExpInfo.Celem - 1; if ((ExpInfo.CurrentTran == ExpInfo.NumTrans) && (ExpInfo.Celem < ExpInfo.NumAcodes)) ExpInfo.CurrentTran = 0; } if ((ExpInfo.Celem < 0) || (ExpInfo.Celem >= ExpInfo.NumAcodes)) ExpInfo.Celem = 0; ExpInfo.CurrentElem = ExpInfo.Celem; /* fprintf(stdout,"initacqparms: Celem = %d\n",ExpInfo.Celem); */ } /* --- when_mask parameter --- */ if ((P_getreal(CURRENT,"when_mask",&tmp,1)) >= 0) ExpInfo.ProcMask = (int) (tmp + 0.0005); else { text_error("initacqqueue(): cannot set when_mask."); psg_abort(1); } ExpInfo.ProcWait = (option_check("wait")) ? 1 : 0; ExpInfo.DspGainBits = 0; ExpInfo.DspOversamp = 0; ExpInfo.DspOsCoef = 0; ExpInfo.DspSw = 0.0; ExpInfo.DspFb = 0.0; ExpInfo.DspOsskippts = 0; ExpInfo.DspOslsfrq = 0.0; ExpInfo.DspFiltFile[0] = '\0'; ExpInfo.UserUmask = umask(0); umask( ExpInfo.UserUmask ); /* make sure the process umask does not change */ /* fill in the account info */ strcpy(tmpstr,ExpInfo.SysDirFile); strcat(tmpstr,"/adm/accounting/acctLog.xml"); if ( access(tmpstr,F_OK) != 0) { ExpInfo.Billing.enabled = 0; } else { ExpInfo.Billing.enabled = 1; } t = time(0); ExpInfo.Billing.submitTime = t; ExpInfo.Billing.startTime = t; ExpInfo.Billing.doneTime = t; if (P_getstring(GLOBAL, "operator", tmpstr, 1, 255) < 0) ExpInfo.Billing.Operator[0]='\000'; else strncpy(ExpInfo.Billing.Operator,tmpstr,200); if (P_getstring(CURRENT, "account", tmpstr, 1, 255) < 0) ExpInfo.Billing.account[0]='\000'; else strncpy(ExpInfo.Billing.account,tmpstr,200); if (P_getstring(CURRENT, "pslabel", tmpstr, 1, 255) < 0) ExpInfo.Billing.seqfil[0]='\000'; else strncpy(ExpInfo.Billing.seqfil,tmpstr,200); ptr = strrchr(infopath,'/'); if ( ptr ) { ptr++; strncpy(ExpInfo.Billing.goID, ptr ,200); } else { ExpInfo.Billing.goID[0]='\000'; } return(0); } set_acode_size(sz) int sz; { ExpInfo.acode_1_size = sz; } set_max_acode_size(sz) int sz; { ExpInfo.acode_max_size = sz; } setDSPgain(val) int val; { ExpInfo.DspGainBits = val; } /*------------------------------------------------------------------- | | calcdspskip() | +------------------------------------------------------------------*/ int calcdspskip() { char dspflg[2], fsqflg[2]; double dwelldsp=0.0, swval=0.0, oversampval=0.0; double skipdlyadj=0.0, prealfa, rof2val; int osskippts=0, prealfa_defined=0; /* optimize the delay to about 30us if no prealfa defined */ double osskipdly=30.0e-6; dsposskipdelay=0.0; if ( P_getstring(GLOBAL,"dsp",&dspflg,1,2) == 0 ) { if ((dspflg[0] != 'r') && (dspflg[0] != 'i')) return (0); if (dspflg[0] == 'r') { if ( P_getstring(GLOBAL,"fsq",&fsqflg,1,2) == 0 ) { if (fsqflg[0] != 'y') return (0); } else return (0); } } /* check for prealfa defined? */ if ((P_getreal(CURRENT,"prealfa",&prealfa,1)) >= 0) { if (prealfa > 0.0) { osskipdly=prealfa; prealfa_defined=1; } } /* fprintf(stderr,"\nosskipdly=%g\n",osskipdly); */ P_getreal(CURRENT,"sw",&swval,1); P_getreal(CURRENT,"oversamp",&oversampval,1); /* fprintf(stderr,"sw=%g oversamp=%g\n",swval,oversampval); */ if ( (swval > 1.0) && (oversampval >= 4.0) ) { if (dspflg[0] == 'r') { double dsp_il_factor = 4.0; dwelldsp = 1.0/(dsp_il_factor*swval); } else if (dspflg[0] == 'i') { dwelldsp = 1.0/(oversampval*swval); } } else { return (0); } /* calculate skip delay and skip points */ /* osskippts = (int) ((osskipdly/dwelldsp)+1.0001); */ osskippts = (int) ((osskipdly/dwelldsp)+1.0001); if (osskippts < 2) osskippts=2; skipdlyadj=(osskippts-1)*dwelldsp; /* execute skip delay - this is done in test4acquire() if (skipdlyadj >= 0.0) G_Delay(DELAY_TIME, skipdlyadj, 0); */ /* commenting out the subtraction of rof2 below have to subtract rof2 delay of the last pulse before acquire. assuming it is rof2 if ((P_getreal(CURRENT,"rof2",&rof2val,1)) >= 0) { if (rof2val > 0.0) { dsposskipdelay = skipdlyadj - rof2val; if (dsposskipdelay < 0.0) dsposskipdelay = 0.0; } } else { dsposskipdelay = skipdlyadj; } commenting out the subtraction of rof2 */ /* the following is to allow for empirical correction */ dsposskipdelay = skipdlyadj - 7.7e-6 ; if (dsposskipdelay < 0.0) dsposskipdelay = 0.0; /* set the exact prealfa back into Vnmr & parameter set */ if (prealfa_defined == 1) { double realvaluefactor=parmult(CURRENT,"prealfa"); putCmd("setvalue('prealfa',%f)\n",skipdlyadj/realvaluefactor); putCmd("setvalue('prealfa',%f,'processed')\n",skipdlyadj/realvaluefactor); } return (osskippts); } #define OS_MAX_NTAPS 50000 #define OS_MIN_NTAPS 3 /*----------------------------------------------- | | | getDSPinfo()/0 | | | +----------------------------------------------*/ int getDSPinfo(factor,coef,sw,maxlbsw) int factor,coef; double sw; double maxlbsw; { int np, ntaps; double tmp; double maxv, minv, stepv; char osskip[2]; if (sw * (double) factor > maxlbsw+0.1) { text_error("oversamp * sw > %g", maxlbsw); psg_abort(1); } /*if ((P_getreal(CURRENT,"oversamp",&tmp,1)) >= 0) ExpInfo.DspOversamp = (var_active("oversamp",CURRENT)) ? (int) (tmp + 0.0005) : 0; else { text_error("error copying oversamp"); psg_abort(1); }*/ ExpInfo.DspOversamp = factor; if (!newacq && ExpInfo.IlFlag) { text_error("Can't do DSP with il='y'"); psg_abort(1); } np = ExpInfo.NumDataPts; par_maxminstep(CURRENT, "np", &maxv, &minv, &stepv); if (newacq) maxv *= 4.0; if (np*factor + coef/2 > maxv) { text_error("oversamp * np > %g", maxv); psg_abort(1); } if (coef/2 > OS_MAX_NTAPS) { text_error("oscoef must be less than 50000"); psg_abort(1); } if (coef < OS_MIN_NTAPS) { text_error("oscoef must be greater than 3"); psg_abort(1); } if ((P_getreal(CURRENT,"osfb",&tmp,1) >= 0) && var_active("osfb",CURRENT)) { if (sw*(double)factor/(tmp*2.0) > 1.0) { ExpInfo.DspFb = tmp; } } if ((P_getreal(CURRENT,"oscoef",&tmp,1)) >= 0) ExpInfo.DspOsCoef = (int) (tmp + 0.0005); else { text_error("error with oscoef"); psg_abort(1); } if ((P_getreal(CURRENT,"sw",&tmp,1)) >= 0) ExpInfo.DspSw = tmp; else { text_error("error with sw"); psg_abort(1); } if ((P_getreal(CURRENT,"oslsfrq",&tmp,1) >= 0) && var_active("oslsfrq",CURRENT)) ExpInfo.DspOslsfrq = tmp; if ((P_getstring(CURRENT,"filtfile",ExpInfo.DspFiltFile,1,255)) < 0) { ExpInfo.DspFiltFile[0] = '\0'; } ExpInfo.DspOsskippts = 0; if ( P_getstring(GLOBAL,"qcomp",&osskip,1,2) == 0 ) { if ((osskip[0] == 'y')) { ExpInfo.DspOsskippts = calcdspskip(); } } /* fprintf(stderr,"getDSPinfo(): ExpInfo.DspOsskippts = %d\n", ExpInfo.DspOsskippts); fprintf(stderr,"getDSPinfo(): written ExpInfo Dsp info.\n"); */ return(0); } turnoff_swdsp() { if (ix == 1) { text_error("Inline DSP turned off\n"); putCmd("off('oversamp')\n"); putCmd("off('oversamp','processed')\n"); } /*dsp_info[0] = 0; dsp_info[1] = 1; dsp_info[2] = 1; dsp_info[3] = 0;*/ dsp_params.flags = 0; dsp_params.rt_oversamp = 1; dsp_params.rt_extrapts = 0; dsp_params.il_oversamp = 1; dsp_params.il_extrapts = 0; dsp_params.rt_downsamp = 1; ExpInfo.DspOversamp = 0; ExpInfo.DspOsCoef = 0; ExpInfo.DspSw = 0.0; ExpInfo.DspFb = 0.0; ExpInfo.DspOsskippts = 0; ExpInfo.DspOslsfrq = 0.0; ExpInfo.DspFiltFile[0] = '\0'; } turnoff_hwdsp() { codeint *tmpptr; if (ix == 1) { text_error("Real time DSP turned off\n"); putCmd("off('oversamp')\n"); putCmd("off('oversamp','processed')\n"); } /*dsp_info[0] = 0; dsp_info[1] = 1; dsp_info[2] = 1; dsp_info[3] = 0;*/ dsp_params.flags = 0; dsp_params.rt_oversamp = 1; dsp_params.rt_extrapts = 0; dsp_params.il_oversamp = 1; dsp_params.il_extrapts = 0; dsp_params.rt_downsamp = 1; setDSPgain(0); Alc->acqasize = 1; tmpptr = Aacode + multhwlp_ptr -1; /* get address into codes multhwlp flag*/ if (*tmpptr == NOISE) { tmpptr += 3; *tmpptr = 256; } } /* Allow user over ride of exptime calculation */ static double usertime = -1.0; void g_setExpTime(double val) { usertime = val; } double getExpTime() { return(usertime); } write_shr_info(exp_time) double exp_time; { int Infofd; /* file discriptor Code disk file */ int bytes; /* --- write parameter out to acqqueue file --- */ if (usertime < 0.0) ExpInfo.ExpDur = exp_time; else ExpInfo.ExpDur = usertime; if (newacq) { ExpInfo.NumTables = num_tables; /* set number of tables */ strcpy(ExpInfo.WaveFormFile,fileRFpattern); } if (ExpInfo.InteractiveFlag) { char tmppath[256]; sprintf(tmppath,"%s.new",infopath); unlink(tmppath); Infofd = open(tmppath,O_EXCL | O_WRONLY | O_CREAT,0666); } else { Infofd = open(infopath,O_EXCL | O_WRONLY | O_CREAT,0666); } if (Infofd < 0) { text_error("Exp info file already exists. PSG Aborted..\n"); psg_abort(1); } bytes = write(Infofd, (const void *) &ExpInfo, sizeof( SHR_EXP_STRUCT ) ); if (bgflag) fprintf(stderr,"Bytes written to info file: %d (bytes).\n",bytes); close(Infofd); } write_exp_info() { int Infofd; /* file discriptor Code disk file */ int bytes; #ifdef LINUX int cnt; long rt_tab_tmp[RT_TAB_SIZE]; #endif /* --- write parameter out real-time variable file --- */ if (newacq) { /* These seem to not be deleted sometime. */ /* Just delete it now. */ unlink(ExpInfo.RTParmFile); Infofd = open(ExpInfo.RTParmFile,O_EXCL | O_WRONLY | O_CREAT,0666); if (Infofd < 0) { text_error("Exp rt file already exists. PSG Aborted..\n"); psg_abort(1); } #ifdef LINUX for (cnt=0; cnt < RT_TAB_SIZE; cnt++) { rt_tab_tmp[cnt] = htonl(rt_tab[cnt]); } bytes = write(Infofd, rt_tab_tmp, sizeof(long) * get_rt_tab_elems() ); #else bytes = write(Infofd, rt_tab, sizeof(long) * get_rt_tab_elems() ); #endif if (bgflag) fprintf(stderr,"Bytes written to info file: %d (bytes).\n",bytes); close(Infofd); if (num_tables > 0) { writetablefile(ExpInfo.TableFile); } else { ExpInfo.TableFile[0] = '\000'; fprintf(stderr,"PSG: WARNING: write_exp_info(): num_tables=0\n"); } if (acqiflag) write_rtvar_acqi_file(); } } int ra_inovaacqparms(fidn) unsigned long fidn; { char fidpath[512]; int curct; sprintf(fidpath,"%s/fid",ExpInfo.DataFile); if (fidn == 1) { ifile = mOpen(fidpath,ExpInfo.DataSize,O_RDONLY ); if (ifile == NULL) { text_error("Cannot open data file: '%s', RA aborted.\n", ExpInfo.DataFile); psg_abort(1); } /* read in file header */ memcpy((void*) &acqfileheader, (void*) ifile->offsetAddr, sizeof(acqfileheader)); if (ntohl(acqfileheader.np) != ExpInfo.NumDataPts) { text_error("FidFile np: %d not equal NumDataPts: %d, RA aborted.\n", ntohl(acqfileheader.np),ExpInfo.NumDataPts); psg_abort(1); } if (ntohl(acqfileheader.ebytes) != ExpInfo.DataPtSize) { text_error("FidFile dp: %d not equal DataPtSize: %d, RA aborted.\n", ntohl(acqfileheader.ebytes),ExpInfo.DataPtSize); psg_abort(1); } if (ntohl(acqfileheader.ntraces) != ExpInfo.NumFids) { text_error("FidFile nf: %d not equal NumFids: %d, RA aborted.\n", ntohl(acqfileheader.ntraces),ExpInfo.NumFids); psg_abort(1); } ifile->offsetAddr += sizeof(acqfileheader); /* move my file pointers */ savedoffsetAddr = ifile->offsetAddr; } /* offset to fid location */ if (fidn <= getStartFidNum()) { ifile->offsetAddr = savedoffsetAddr + ((ExpInfo.DataPtSize * ExpInfo.NumDataPts * ExpInfo.NumFids) + sizeof(acqblockheader)) * (fidn-1); memcpy((void*) &acqblockheader, (void*) ifile->offsetAddr, sizeof(acqblockheader)); curct = ntohl(acqblockheader.ctcount); if (getIlFlag()) { if (fidn < getStartFidNum()) { if (curct != (((ExpInfo.CurrentTran/ExpInfo.NumInBS)+1) * ExpInfo.NumInBS)) text_error("Warning: File_ct(%d): %d not equal ct+bs: %d\n", fidn,curct,ExpInfo.CurrentTran+ExpInfo.NumInBS); } else { if (curct != ExpInfo.CurrentTran) text_error("Warning: File_ct(%d): %d not equal ct: %d\n", fidn,curct,ExpInfo.CurrentTran); } } else { if (fidn < getStartFidNum()) { if (curct != ExpInfo.NumTrans) text_error("Warning: File_ct(%d): %d not equal nt: %d\n", fidn,curct,ExpInfo.NumTrans); } else { if (curct != ExpInfo.CurrentTran) text_error("Warning: File_ct(%d): %d not equal ct: %d\n", fidn,curct,ExpInfo.CurrentTran); } } } else if (getIlFlag() && (fidn > getStartFidNum()) && (ExpInfo.CurrentTran >= ExpInfo.NumInBS)) { /* Only when interleaving after 1st blocksize */ ifile->offsetAddr = savedoffsetAddr + ((ExpInfo.DataPtSize * ExpInfo.NumDataPts * ExpInfo.NumFids) + sizeof(acqblockheader)) * (fidn-1); memcpy((void*) &acqblockheader, (void*) ifile->offsetAddr, sizeof(acqblockheader)); curct = ntohl(acqblockheader.ctcount); if (curct != ExpInfo.CurrentTran) text_error("Warning: File_ct(%d): %d not equal CurrentTran: %d\n", fidn,curct,ExpInfo.CurrentTran); } else curct = 0; if (fidn >= ExpInfo.NumAcodes) mClose(ifile); Alc->acqct = curct; } int getExpNum() { return(ExpInfo.ExpNum); } int getIlFlag() { return(ExpInfo.IlFlag); } /*--------------------------------------------------------------*/ /* getStartFidNum */ /* Return starting fid number for ra. ExpInfo.Celem goes */ /* from 0 to n-1. getStartFidNum goes from 1 to n */ /*--------------------------------------------------------------*/ int getStartFidNum() { if (newacq) return(ExpInfo.Celem + 1); else return(1); }
1.382813
1
kernel/base/include/los_vm_filemap.h
openharmony-sig-ci/kernel_liteos_a
0
7997115
/* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * @defgroup los_vm_filemap vm filemap definition * @ingroup kernel */ #ifndef __LOS_VM_FILEMAP_H__ #define __LOS_VM_FILEMAP_H__ #ifdef LOSCFG_FS_VFS #include "fs/file.h" #endif #include "los_vm_map.h" #include "los_vm_page.h" #include "los_vm_common.h" #include "los_vm_phys.h" #ifdef __cplusplus #if __cplusplus extern "C" { #endif /* __cplusplus */ #endif /* __cplusplus */ typedef struct FilePage { LOS_DL_LIST node; LOS_DL_LIST lru; LOS_DL_LIST i_mmap; /* list of mappings */ UINT32 n_maps; /* num of mapping */ struct VmPhysSeg *physSeg; /* physical memory that file page belongs to */ struct VmPage *vmPage; struct page_mapping *mapping; VM_OFFSET_T pgoff; UINT32 flags; UINT16 dirtyOff; UINT16 dirtyEnd; } LosFilePage; typedef struct MapInfo { LOS_DL_LIST node; VADDR_T vaddr; LosFilePage *page; LosArchMmu *archMmu; } LosMapInfo; enum OsPageFlags { FILE_PAGE_FREE, FILE_PAGE_LOCKED, FILE_PAGE_REFERENCED, FILE_PAGE_DIRTY, FILE_PAGE_LRU, FILE_PAGE_ACTIVE, FILE_PAGE_SHARED, }; #define PGOFF_MAX 2000 #define MAX_SHRINK_PAGECACHE_TRY 2 #define VM_FILEMAP_MAX_SCAN (SYS_MEM_SIZE_DEFAULT >> PAGE_SHIFT) #define VM_FILEMAP_MIN_SCAN 32 STATIC INLINE VOID OsSetPageLocked(LosVmPage *page) { LOS_BitmapSet(&page->flags, FILE_PAGE_LOCKED); } STATIC INLINE VOID OsCleanPageLocked(LosVmPage *page) { LOS_BitmapClr(&page->flags, FILE_PAGE_LOCKED); } STATIC INLINE VOID OsSetPageDirty(LosVmPage *page) { LOS_BitmapSet(&page->flags, FILE_PAGE_DIRTY); } STATIC INLINE VOID OsCleanPageDirty(LosVmPage *page) { LOS_BitmapClr(&page->flags, FILE_PAGE_DIRTY); } STATIC INLINE VOID OsSetPageActive(LosVmPage *page) { LOS_BitmapSet(&page->flags, FILE_PAGE_ACTIVE); } STATIC INLINE VOID OsCleanPageActive(LosVmPage *page) { LOS_BitmapClr(&page->flags, FILE_PAGE_ACTIVE); } STATIC INLINE VOID OsSetPageLRU(LosVmPage *page) { LOS_BitmapSet(&page->flags, FILE_PAGE_LRU); } STATIC INLINE VOID OsSetPageFree(LosVmPage *page) { LOS_BitmapSet(&page->flags, FILE_PAGE_FREE); } STATIC INLINE VOID OsCleanPageFree(LosVmPage *page) { LOS_BitmapClr(&page->flags, FILE_PAGE_FREE); } STATIC INLINE VOID OsSetPageReferenced(LosVmPage *page) { LOS_BitmapSet(&page->flags, FILE_PAGE_REFERENCED); } STATIC INLINE VOID OsCleanPageReferenced(LosVmPage *page) { LOS_BitmapClr(&page->flags, FILE_PAGE_REFERENCED); } STATIC INLINE BOOL OsIsPageActive(LosVmPage *page) { return BIT_GET(page->flags, FILE_PAGE_ACTIVE); } STATIC INLINE BOOL OsIsPageLocked(LosVmPage *page) { return BIT_GET(page->flags, FILE_PAGE_LOCKED); } STATIC INLINE BOOL OsIsPageReferenced(LosVmPage *page) { return BIT_GET(page->flags, FILE_PAGE_REFERENCED); } STATIC INLINE BOOL OsIsPageDirty(LosVmPage *page) { return BIT_GET(page->flags, FILE_PAGE_DIRTY); } STATIC INLINE BOOL OsIsPageMapped(LosFilePage *page) { return (page->n_maps != 0); } /* The follow three functions is used to SHM module */ STATIC INLINE VOID OsSetPageShared(LosVmPage *page) { LOS_BitmapSet(&page->flags, FILE_PAGE_SHARED); } STATIC INLINE VOID OsCleanPageShared(LosVmPage *page) { LOS_BitmapClr(&page->flags, FILE_PAGE_SHARED); } STATIC INLINE BOOL OsIsPageShared(LosVmPage *page) { return BIT_GET(page->flags, FILE_PAGE_SHARED); } INT32 OsVfsFileMmap(struct file *filep, LosVmMapRegion *region); LosFilePage *OsPageCacheAlloc(struct page_mapping *mapping, VM_OFFSET_T pgoff); LosFilePage *OsFindGetEntry(struct page_mapping *mapping, VM_OFFSET_T pgoff); LosMapInfo *OsGetMapInfo(LosFilePage *page, LosArchMmu *archMmu, VADDR_T vaddr); VOID OsAddMapInfo(LosFilePage *page, LosArchMmu *archMmu, VADDR_T vaddr); VOID OsDelMapInfo(LosVmMapRegion *region, LosVmPgFault *pgFault, BOOL cleanDirty); VOID OsFileCacheFlush(struct page_mapping *mapping); VOID OsFileCacheRemove(struct page_mapping *mapping); VOID OsUnmapPageLocked(LosFilePage *page, LosMapInfo *info); VOID OsUnmapAllLocked(LosFilePage *page); VOID OsLruCacheAdd(LosFilePage *fpage, enum OsLruList lruType); VOID OsLruCacheDel(LosFilePage *fpage); LosFilePage *OsDumpDirtyPage(LosFilePage *oldPage); VOID OsDoFlushDirtyPage(LosFilePage *fpage); VOID OsDeletePageCacheLru(LosFilePage *page); STATUS_T OsNamedMMap(struct file *filep, LosVmMapRegion *region); VOID OsPageRefDecNoLock(LosFilePage *page); VOID OsPageRefIncLocked(LosFilePage *page); int OsTryShrinkMemory(size_t nPage); VOID OsMarkPageDirty(LosFilePage *fpage, LosVmMapRegion *region, int off, int len); typedef struct ProcessCB LosProcessCB; VOID OsVmmFileRegionFree(struct file *filep, LosProcessCB *processCB); #ifdef LOSCFG_DEBUG_VERSION VOID ResetPageCacheHitInfo(int *try, int *hit); struct file_map* GetFileMappingList(void); #endif #ifdef __cplusplus #if __cplusplus } #endif /* __cplusplus */ #endif /* __cplusplus */ #endif /* __LOS_VM_FILEMAP_H__ */
1.109375
1
DBLocationManager/DBLocationManager.h
dengbin9009/DBLocationManager
1
7997123
// // DBLocationManager.h // DBLocationManager // // Created by DengBin on 15/1/30. // Copyright (c) 2015年 dengbin. All rights reserved. // // 适用于百度地图 #import <Foundation/Foundation.h> #import <CoreGraphics/CoreGraphics.h> #import <CoreLocation/CoreLocation.h> typedef void(^CompletionBlock)(CGFloat latitude,CGFloat longitude); typedef void(^ErrorBlock)(); @interface DBLocationManager : NSObject + (DBLocationManager *)sharedInstance; - (void)startUpdateLocation; - (void)stopUpdateLocation; @property (assign, nonatomic) CGFloat latitude; // 维度 @property (assign, nonatomic) CGFloat longitude; // 经度 @property (copy, nonatomic) CompletionBlock completionBlock; @property (copy, nonatomic) ErrorBlock errorBlockBlock; @end
0.46875
0
src/lib/hrtm/out_port.h
r-kurose/OpenRTM-aist
15
7997131
// -*- C++ -*- /*! * @file out_port.h * @brief RTC::OutPort wrapper class for hrtm::OutPort * @date $Date$ * @author <NAME> <<EMAIL>> * * Copyright (C) 2016 * <NAME> * National Institute of * Advanced Industrial Science and Technology (AIST), Japan * All rights reserved. * * $Id$ * */ #ifndef HRTM_OUT_PORT_H #define HRTM_OUT_PORT_H #include <rtm/OutPort.h> namespace hrtm { #ifndef CXX11 template <class DataType> class OutPort : public RTC::OutPort<DataType> { public: OutPort(const char* name, DataType& data) : RTC::OutPort<DataType>(name, data) { } virtual ~OutPort() = default; }; #else template<class DataType> using OutPort = RTC::OutPort<DataType>; #endif } // namespace hrtm #endif // HRT_OUT_PORT_H
0.953125
1
src/vtimer.c
gema-arta/laureline-firmware
33
7997139
/* * Copyright (c) <NAME> <<EMAIL>> * * This file is distributed under the terms of the MIT License. * See the LICENSE file at the top of this tree, or if it is missing a copy can * be found at http://opensource.org/licenses/MIT */ #include "common.h" #include "task.h" #include "eeprom.h" #include "epoch.h" #include "init.h" #include "logging.h" #include "main.h" #include "ntpns.h" #include "pll.h" #include "ppscapture.h" #include "status.h" #include "vtimer.h" #include "stm32/iwdg.h" #include <math.h> unsigned sys_able; TaskHandle_t thread_vtimer; /* (vt_rate / 2^VT_RATE_PREC) NTP fractions per tick of monotonic time */ static uint64_t vt_rate; /* Nominal rate for the current nominal system frequency */ static double vt_rate_nominal; /* VT value at the last timer update */ static uint64_t vt_last; /* Monotonic value at the last timer update */ static uint64_t mono_last; /* Saved corrections from GPS */ static uint32_t utc_next; static float quant_corr, quant_corr_deferred; /* Saved loopstats report for SNMP */ int32_t loopstats_values[LOOPSTATS_VALUES]; #define VT_RATE_PREC 28 static void pll_thread(void *p); static uint64_t vtimer_getI(uint64_t mono_next); static void vtimer_updateI(void); static double vtimer_get_frac_delta(uint64_t mono_capture); static void vtimer_step(double dd); void vtimer_start(void) { init_pllmath(); pll_reset(); quant_corr = quant_corr_deferred = 0.0f; vt_rate_nominal = NTP_TO_FLOAT / system_frequency; ASSERT(xTaskCreate(pll_thread, "vtimer", VTIMER_STACK_SIZE, NULL, THREAD_PRIO_VTIMER, &thread_vtimer)); } static void pll_thread(void *p) { static TickType_t last_pps; static uint64_t tmp, last; static int64_t tmps; static double delta, ppb; static uint8_t desync = 0; static uint16_t old_status; static uint16_t next_report = 0; static float ojit = 0, fjit = 0, ppb_last = 0, ppb_delta; while (1) { tmp = monotonic_get_capture(); old_status = status_flags; if (tmp && !(cfg.flags & FLAG_HOLDOVER_TEST)) { delta = vtimer_get_frac_delta(tmp); if (status_flags & STATUS_PLL_OK) { if (pll_state.st < 3) { log_write(LOG_WARNING, "vtimer", "PLL is not locked!"); clear_status(STATUS_PLL_OK); } } else { if (pll_state.st >= 3 && delta > -SETTLED_THRESH && delta < SETTLED_THRESH) { log_write(LOG_NOTICE, "vtimer", "PLL has become locked"); set_status(STATUS_PLL_OK); } } if (delta < -STEP_THRESH || delta > STEP_THRESH) { if (++desync >= 5) { vtimer_step(-delta); init_pllmath(); pll_reset(); desync = 0; log_write(LOG_NOTICE, "vtimer", "step(PPS) %d us", (int)(-delta * 1e6)); } } else { desync = 0; } if (((xTaskGetTickCount() - last_pps) < pdMS_TO_TICKS(1100)) && !(status_flags & STATUS_PPS_OK)) { log_write(LOG_NOTICE, "vtimer", "PPS detected"); set_status(STATUS_PPS_OK); } last_pps = xTaskGetTickCount(); ppb = pll_math(delta); } else { if (((xTaskGetTickCount() - last_pps) >= pdMS_TO_TICKS(5000)) && (status_flags & STATUS_PPS_OK)) { log_write(LOG_WARNING, "vtimer", "PPS is not valid!"); clear_status(STATUS_PPS_OK); } if (((xTaskGetTickCount() - last_pps) >= (pdMS_TO_TICKS(1000) * cfg.holdover)) && (status_flags & STATUS_PLL_OK)) { log_write(LOG_ERR, "vtimer", "PLL lock timed out due to lack of PPS"); clear_status(STATUS_PLL_OK); } if (tmp && next_report == 0) { /* Holdover test mode */ delta = vtimer_get_frac_delta(tmp); log_write(LOG_WARNING, "vtimer", "HOLDOVER TEST! current offset: %d ns", (int)(delta*1e9)); } ppb = pll_poll(); } kern_freq(ppb); /* Update vtimer */ DISABLE_IRQ(); vtimer_updateI(); tmps = 0; last = vt_last; if (utc_next != 0) { tmps = (int64_t)utc_next - (int64_t)(last >> 32); utc_next = 0; status_flags |= STATUS_TOD_OK; } if (watchdog_main && watchdog_net) { iwdg_clear(); watchdog_main--; watchdog_net--; } ENABLE_IRQ(); if (tmps != 0) { vtimer_step(tmps); if (tmps >> 31) { /* Too big for signed int32 */ log_write(LOG_NOTICE, "vtimer", "step(UTC) %d sec", (uint32_t)tmps); } else { log_write(LOG_NOTICE, "vtimer", "step(UTC) %d sec", (int32_t)tmps); } DISABLE_IRQ(); vtimer_updateI(); last = vt_last; ENABLE_IRQ(); } if (!(old_status & STATUS_TOD_OK) && (status_flags & STATUS_TOD_OK)) { log_write(LOG_NOTICE, "vtimer", "Time of day is correct"); } /* Update loopstats */ ppb_delta = ppb - ppb_last; ppb_last = ppb; if (pll_state.j) { ojit += (pll_state.dy*pll_state.dy - ojit) / pll_state.j; fjit += (ppb_delta*ppb_delta - fjit) / pll_state.j; } { float fjitter = 1e12*sqrtf(fjit); if (fjitter < INT32_MIN || fjitter > INT32_MAX) { fjitter = 0.0f; } loopstats_values[0] = (int)(1e9*pll_state.my); /* timeOffset */ loopstats_values[1] = (int)(1e9*ppb); /* frequencyOffset */ loopstats_values[2] = (int)(1e9*sqrtf(ojit)); /* timeJitter */ loopstats_values[3] = (int)fjitter; /* frequencyJitter */ loopstats_values[4] = (int)pll_state.j; /* loopTimeConstant */ loopstats_values[5] = pll_state.st; /* pllState */ } if (next_report == 0) { next_report = cfg.loopstats_interval - 1; log_write(LOG_INFO, "loopstats", "off:%dns freq:%dppb jit:%dns fjit:%dppt looptc:%ds state:%d flags:%sPPS,%sToD,%sPLL,%sQUANT", loopstats_values[0], loopstats_values[1], loopstats_values[2], loopstats_values[3], loopstats_values[4], loopstats_values[5], (status_flags & STATUS_PPS_OK) ? "" : "!", (status_flags & STATUS_TOD_OK) ? "" : "!", (status_flags & STATUS_PLL_OK) ? "" : "!", (status_flags & STATUS_USED_QUANT) ? "" : "!"); } else { next_report--; } /* Wait until top of second, blink LED, then run the PLL again 100ms * before the next second */ tmp = last & NTP_MASK_SECONDS; tmp += NTP_SECOND; /* top of next second in vtimer time */ vtimer_sleep_until(tmp); if (~status_flags & STATUS_VALID) { GPIO_ON(LED3); if (status_flags & STATUS_PPS_OK) { /* top: solid orange */ GPIO_ON(LED4); } else { /* top: solid red */ GPIO_OFF(LED4); } } else { /* top: solid green */ GPIO_OFF(LED3); GPIO_ON(LED4); } if ((status_flags & STATUS_SETTLED) == STATUS_SETTLED) { /* bottom: flash green */ GPIO_ON(LED2); } else if (status_flags & STATUS_SETTLED) { /* bottom: flash red (PPS but no lock, or holdover but no PPS) */ GPIO_ON(LED1); } else { /* bottom: off (no PPS or holdover) */ } tmp += PPS_BLINK_TIME * NTP_SECOND; vtimer_sleep_until(tmp); GPIO_OFF(LED1); GPIO_OFF(LED2); tmp += (PLL_SUB_TIME - PPS_BLINK_TIME) * NTP_SECOND; vtimer_sleep_until(tmp); } } static uint64_t vtimer_getI(uint64_t mono_next) { /* Returns the current vtimer time given the current monotonic time */ int32_t delta_ticks = mono_next - mono_last; int64_t frac_part = vt_rate * delta_ticks; return vt_last + (frac_part >> VT_RATE_PREC); } static void vtimer_updateI(void) { /* Advance the vtimer's "base". Must be called once per second to maintain * accuracy. */ uint64_t mono_next; mono_next = monotonic_now(); vt_last = vtimer_getI(mono_next); mono_last = mono_next; } static double vtimer_get_frac_delta(uint64_t mono_capture) { /* Convert a PPS capture in monotonic time to vtimer, but only the * fractional second part is kept. */ uint64_t vt_capture; double frac; float corr; DISABLE_IRQ(); vt_capture = vtimer_getI(mono_capture); corr = quant_corr; quant_corr= quant_corr_deferred; quant_corr_deferred = 0.0f; if (corr != 0.0f) { status_flags |= STATUS_USED_QUANT; } else { status_flags &= ~STATUS_USED_QUANT; } ENABLE_IRQ(); vt_capture &= NTP_MASK_FRAC; frac = (double)(uint32_t)vt_capture / NTP_TO_FLOAT; frac += corr; if (frac > 0.5f) { frac -= 1.0f; } return frac; } void kern_freq(double f) { /* Change the rate at which the vtimer ticks */ if (f > 500e-6) { f = 500e-6; } else if (f < -500e-6) { f = -500e-6; } DISABLE_IRQ(); vt_rate = vt_rate_nominal * (1.0 + f) * (1ULL<<VT_RATE_PREC); ENABLE_IRQ(); } static void vtimer_step(double dd) { /* Apply a step change to the vtimer */ DISABLE_IRQ(); vt_last += (int64_t)((double)dd * NTP_TO_FLOAT); vtimer_updateI(); ENABLE_IRQ(); } uint64_t vtimer_now(void) { uint64_t tmp; DISABLE_IRQ(); tmp = monotonic_now(); tmp = vtimer_getI(tmp); ENABLE_IRQ(); return tmp; } void vtimer_set_utc(uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second) { uint32_t ntp_seconds; ntp_seconds = datetime_to_epoch(year, month, day, hour, minute, second); DISABLE_IRQ(); utc_next = ntp_seconds; ENABLE_IRQ(); } void vtimer_set_gps(uint16_t wkn, uint32_t tow) { uint32_t ntp_seconds = gps_to_epoch(wkn, tow); DISABLE_IRQ(); utc_next = ntp_seconds; ENABLE_IRQ(); } void vtimer_set_correction(float corr, quant_leadlag_t leadlag) { DISABLE_IRQ(); if (leadlag == LEADING) { quant_corr_deferred = corr; } else { quant_corr = corr; quant_corr_deferred = 0.0f; } ENABLE_IRQ(); } void vtimer_sleep_until(uint64_t vt_when) { uint64_t mono_when; int64_t delta_vt; DISABLE_IRQ(); delta_vt = (vt_when - vt_last) << VT_RATE_PREC; mono_when = mono_last + (delta_vt / vt_rate); ENABLE_IRQ(); monotonic_sleep_until(mono_when); }
1.289063
1
src/hncp_sd.h
erincandescent/hnetd
32
7997147
/* * $Id: hncp_sd.h $ * * Author: <NAME> <markus <EMAIL>> * * Copyright (c) 2014-2015 cisco Systems, Inc. * * Created: Tue Jan 14 20:09:23 2014 mstenber * Last modified: Tue Sep 15 11:01:26 2015 mstenber * Edit time: 10 min * */ #pragma once #include "dncp.h" #include "hncp_link.h" #include "hncp.h" typedef struct hncp_sd_struct hncp_sd_s, *hncp_sd; /* These are the parameters SD code uses. The whole structure's memory * is owned by the external party, and is assumed to be valid from * sd_create to sd_destroy. */ typedef struct hncp_sd_params_struct { /* Which script is used to prod at dnsmasq (required for SD) */ const char *dnsmasq_script; /* And where to store the dnsmasq.conf (required for SD) */ const char *dnsmasq_bonus_file; /* Which script is used to prod at ohybridproxy (required for SD) */ const char *ohp_script; /* DDZ changed script - helpful with e.g. zonestitcher; it is called * with the locally configured domain as the first argument, and then * each browse zone FQDN as separate arguments. */ const char *ddz_script; /* Which script is used to prod at minimalist-pcproxy (optional) */ const char *pcp_script; /* Router name (if desired, optional) */ const char *router_name; /* Domain name (if desired, optional, copied from others if set there) */ const char *domain_name; } hncp_sd_params_s, *hncp_sd_params; hncp_sd hncp_sd_create(hncp h, hncp_sd_params p, struct hncp_link *l); void hncp_sd_dump_link_fqdn(hncp_sd sd, dncp_ep ep, const char *ifname, char *buf, size_t buf_len); void hncp_sd_destroy(hncp_sd sd); bool hncp_sd_busy(hncp_sd sd);
0.917969
1
code/engine.vc2008/xrEngine/IPHdebug.h
porames25/xray-oxygen
7
7997155
#pragma once xr_pure_interface IPhDebugRender { virtual void open_cashed_draw () = 0; virtual void close_cashed_draw ( u32 remove_time) = 0; virtual void draw_tri ( const Fvector &v0, const Fvector &v1, const Fvector &v2, u32 c, bool solid ) = 0; }; extern ENGINE_API IPhDebugRender* ph_debug_render;
0.75
1
CameraAppTemplate/Supporting Files/Constants.h
ShadeApps/camera-app-template
52
7997163
// // Constants.h // CameraAppTemplate // // Created by <NAME> on 09.02.16. // Copyright © 2016 ShadeApps. All rights reserved. // #ifndef Constants_h #define SHD_DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * M_PI) #define kRotationAnimationDuration 0.3 #define Constants_h static NSString * const kDefaultBackgroundHex = @"F4F4F4"; static NSString * const kSelectedBackgroundHex = @"FFCE21"; static NSString * const kDefaultTextColorHex = @"414141"; static NSString * const kSelectedTextColorHex = @"white"; static NSString * const kDefaultTextFont = @"HelveticaNeue"; static NSString * const kSelectedTextFont = @"HelveticaNeue-Medium"; static NSString * const kIntroStoryboardName = @"Intro"; static NSString * const kCameraStoryboardName = @"Camera"; static NSString * const kSeenTutorialKey = @"seenTutorial"; //seenTutorial static NSString * const kNoAccessErrorDescription = @"Couldn't locate camera, you might need to enable camera access in iOS privacy settings for this app."; #endif /* Constants_h */
0.855469
1
src/core/net/rpc/RPCCommunicationThread.h
Neomer/binc
0
7997171
#ifndef RPCCOMMUNICATIONTHREAD_H #define RPCCOMMUNICATIONTHREAD_H #include <QObject> #include <QThread> #include <QTcpSocket> #include "RPCRequest.h" #include "RPCResponse.h" #include "controllers/IAbstractRpcController.h" /// /// \brief The RPCCommunicationThread class /// class RPCCommunicationThread : public QThread { Q_OBJECT public: RPCCommunicationThread(QTcpSocket *socket, QObject *parent = 0); void setControllers(QList<IAbstractRpcController *> &controller) { _controllers = controller; } signals: void finish(RPCCommunicationThread *); // QThread interface protected: void run() override; private: /// /// \brief getController возвращает контроллер из коллекции по его имени <i>name</i>. /// \param name Наименование контроллера /// \return /// IAbstractRpcController *getController(QString name); QTcpSocket *_socket; QList<IAbstractRpcController *> _controllers; }; #endif // RPCCOMMUNICATIONTHREAD_H
0.867188
1
suricata/decode-ipv4.h
hackers-terabit/ggitm
13
7997179
/* Copyright (C) 2007-2013 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free * Software Foundation. * * This program 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 * version 2 along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ /** * \file * * \author <NAME> <<EMAIL>> * \author <NAME> <<EMAIL>> */ #ifndef __DECODE_IPV4_H__ #define __DECODE_IPV4_H__ #define IPV4_HEADER_LEN 20 /**< Header length */ #define IPV4_OPTMAX 40 /**< Max options length */ #define IPV4_MAXPACKET_LEN 65535 /**< Maximum packet size */ /** IP Option Types */ #define IPV4_OPT_EOL 0x00 /**< Option: End of List */ #define IPV4_OPT_NOP 0x01 /**< Option: No op */ #define IPV4_OPT_RR 0x07 /**< Option: Record Route */ #define IPV4_OPT_QS 0x19 /**< Option: Quick Start */ #define IPV4_OPT_TS 0x44 /**< Option: Timestamp */ #define IPV4_OPT_SEC 0x82 /**< Option: Security */ #define IPV4_OPT_LSRR 0x83 /**< Option: Loose Source Route */ #define IPV4_OPT_CIPSO 0x86 /**< Option: Commercial IP Security */ #define IPV4_OPT_SID 0x88 /**< Option: Stream Identifier */ #define IPV4_OPT_SSRR 0x89 /**< Option: Strict Source Route */ #define IPV4_OPT_RTRALT 0x94 /**< Option: Router Alert */ /** IP Option Lengths (fixed) */ #define IPV4_OPT_SEC_LEN 11 /**< SEC Option Fixed Length */ #define IPV4_OPT_SID_LEN 4 /**< SID Option Fixed Length */ #define IPV4_OPT_RTRALT_LEN 4 /**< RTRALT Option Fixed Length */ /** IP Option Lengths (variable) */ #define IPV4_OPT_ROUTE_MIN 3 /**< RR, SRR, LTRR Option Min Length */ #define IPV4_OPT_QS_MIN 8 /**< QS Option Min Length */ #define IPV4_OPT_TS_MIN 5 /**< TS Option Min Length */ #define IPV4_OPT_CIPSO_MIN 10 /**< CIPSO Option Min Length */ /** IP Option fields */ #define IPV4_OPTS ip4vars.ip_opts #define IPV4_OPTS_CNT ip4vars.ip_opt_cnt typedef struct IPV4Opt_ { /** \todo We may want to break type up into its 3 fields * as the reassembler may want to know which options * must be copied to each fragment. */ uint8_t type; /**< option type */ uint8_t len; /**< option length (type+len+data) */ uint8_t *data; /**< option data */ } IPV4Opt; typedef struct IPV4Hdr_ { uint8_t ip_verhl; /**< version & header length */ uint8_t ip_tos; /**< type of service */ uint16_t ip_len; /**< length */ uint16_t ip_id; /**< id */ uint16_t ip_off; /**< frag offset */ uint8_t ip_ttl; /**< time to live */ uint8_t ip_proto; /**< protocol (tcp, udp, etc) */ uint16_t ip_csum; /**< checksum */ union { struct { struct in_addr ip_src;/**< source address */ struct in_addr ip_dst;/**< destination address */ } ip4_un1; uint16_t ip_addrs[4]; } ip4_hdrun1; } __attribute__((__packed__)) IPV4Hdr; #define s_ip_src ip4_hdrun1.ip4_un1.ip_src #define s_ip_dst ip4_hdrun1.ip4_un1.ip_dst #define s_ip_addrs ip4_hdrun1.ip_addrs #define IPV4_GET_RAW_VER(ip4h) (((ip4h)->ip_verhl & 0xf0) >> 4) #define IPV4_GET_RAW_HLEN(ip4h) ((ip4h)->ip_verhl & 0x0f) #define IPV4_GET_RAW_IPTOS(ip4h) ((ip4h)->ip_tos) #define IPV4_GET_RAW_IPLEN(ip4h) ((ip4h)->ip_len) #define IPV4_GET_RAW_IPID(ip4h) ((ip4h)->ip_id) #define IPV4_GET_RAW_IPOFFSET(ip4h) ((ip4h)->ip_off) #define IPV4_GET_RAW_IPTTL(ip4h) ((ip4h)->ip_ttl) #define IPV4_GET_RAW_IPPROTO(ip4h) ((ip4h)->ip_proto) #define IPV4_GET_RAW_IPSRC(ip4h) ((ip4h)->s_ip_src) #define IPV4_GET_RAW_IPDST(ip4h) ((ip4h)->s_ip_dst) /** return the raw (directly from the header) src ip as uint32_t */ #define IPV4_GET_RAW_IPSRC_U32(ip4h) (uint32_t)((ip4h)->s_ip_src.s_addr) /** return the raw (directly from the header) dst ip as uint32_t */ #define IPV4_GET_RAW_IPDST_U32(ip4h) (uint32_t)((ip4h)->s_ip_dst.s_addr) /* we need to change them as well as get them */ #define IPV4_SET_RAW_VER(ip4h, value) ((ip4h)->ip_verhl = (((ip4h)->ip_verhl & 0x0f) | (value << 4))) #define IPV4_SET_RAW_HLEN(ip4h, value) ((ip4h)->ip_verhl = (((ip4h)->ip_verhl & 0xf0) | (value & 0x0f))) #define IPV4_SET_RAW_IPTOS(ip4h, value) ((ip4h)->ip_tos = value) #define IPV4_SET_RAW_IPLEN(ip4h, value) ((ip4h)->ip_len = value) #define IPV4_SET_RAW_IPPROTO(ip4h, value) ((ip4h)->ip_proto = value) /* ONLY call these functions after making sure that: * 1. p->ip4h is set * 2. p->ip4h is valid (len is correct) */ #define IPV4_GET_VER(p) \ IPV4_GET_RAW_VER((p)->ip4h) #define IPV4_GET_HLEN(p) \ (IPV4_GET_RAW_HLEN((p)->ip4h) << 2) #define IPV4_GET_IPTOS(p) \ IPV4_GET_RAW_IPTOS((p)->ip4h) #define IPV4_GET_IPLEN(p) \ (ntohs(IPV4_GET_RAW_IPLEN((p)->ip4h))) #define IPV4_GET_IPID(p) \ (ntohs(IPV4_GET_RAW_IPID((p)->ip4h))) /* _IPV4_GET_IPOFFSET: get the content of the offset header field in host order */ #define _IPV4_GET_IPOFFSET(p) \ (ntohs(IPV4_GET_RAW_IPOFFSET((p)->ip4h))) /* IPV4_GET_IPOFFSET: get the final offset */ #define IPV4_GET_IPOFFSET(p) \ (_IPV4_GET_IPOFFSET(p) & 0x1fff) /* IPV4_GET_RF: get the RF flag. Use _IPV4_GET_IPOFFSET to save a ntohs call. */ #define IPV4_GET_RF(p) \ (uint8_t)((_IPV4_GET_IPOFFSET((p)) & 0x8000) >> 15) /* IPV4_GET_DF: get the DF flag. Use _IPV4_GET_IPOFFSET to save a ntohs call. */ #define IPV4_GET_DF(p) \ (uint8_t)((_IPV4_GET_IPOFFSET((p)) & 0x4000) >> 14) /* IPV4_GET_MF: get the MF flag. Use _IPV4_GET_IPOFFSET to save a ntohs call. */ #define IPV4_GET_MF(p) \ (uint8_t)((_IPV4_GET_IPOFFSET((p)) & 0x2000) >> 13) #define IPV4_GET_IPTTL(p) \ IPV4_GET_RAW_IPTTL(p->ip4h) #define IPV4_GET_IPPROTO(p) \ IPV4_GET_RAW_IPPROTO((p)->ip4h) #define CLEAR_IPV4_PACKET(p) do { \ (p)->ip4h = NULL; \ (p)->level3_comp_csum = -1; \ memset(&p->ip4vars, 0x00, sizeof(p->ip4vars)); \ } while (0) enum IPV4OptionFlags { IPV4_OPT_FLAG_EOL = 0, IPV4_OPT_FLAG_NOP, IPV4_OPT_FLAG_RR, IPV4_OPT_FLAG_TS, IPV4_OPT_FLAG_QS, IPV4_OPT_FLAG_LSRR, IPV4_OPT_FLAG_SSRR, IPV4_OPT_FLAG_SID, IPV4_OPT_FLAG_SEC, IPV4_OPT_FLAG_CIPSO, IPV4_OPT_FLAG_RTRALT, }; /* helper structure with parsed ipv4 info */ typedef struct IPV4Vars_ { int32_t comp_csum; /* checksum computed over the ipv4 packet */ uint16_t opt_cnt; uint16_t opts_set; } IPV4Vars; void DecodeIPV4RegisterTests(void); /** ----- Inline functions ----- */ static inline uint16_t IPV4CalculateChecksum(uint16_t *, uint16_t); /** * \brief Calculates the checksum for the IP packet * * \param pkt Pointer to the start of the IP packet * \param hlen Length of the IP header * * \retval csum Checksum for the IP packet */ static inline uint16_t IPV4CalculateChecksum(uint16_t *pkt, uint16_t hlen) { uint32_t csum = pkt[0]; csum += pkt[1] + pkt[2] + pkt[3] + pkt[4] + pkt[6] + pkt[7] + pkt[8] + pkt[9]; hlen -= 20; pkt += 10; if (hlen == 0) { ; } else if (hlen == 4) { csum += pkt[0] + pkt[1]; } else if (hlen == 8) { csum += pkt[0] + pkt[1] + pkt[2] + pkt[3]; } else if (hlen == 12) { csum += pkt[0] + pkt[1] + pkt[2] + pkt[3] + pkt[4] + pkt[5]; } else if (hlen == 16) { csum += pkt[0] + pkt[1] + pkt[2] + pkt[3] + pkt[4] + pkt[5] + pkt[6] + pkt[7]; } else if (hlen == 20) { csum += pkt[0] + pkt[1] + pkt[2] + pkt[3] + pkt[4] + pkt[5] + pkt[6] + pkt[7] + pkt[8] + pkt[9]; } else if (hlen == 24) { csum += pkt[0] + pkt[1] + pkt[2] + pkt[3] + pkt[4] + pkt[5] + pkt[6] + pkt[7] + pkt[8] + pkt[9] + pkt[10] + pkt[11]; } else if (hlen == 28) { csum += pkt[0] + pkt[1] + pkt[2] + pkt[3] + pkt[4] + pkt[5] + pkt[6] + pkt[7] + pkt[8] + pkt[9] + pkt[10] + pkt[11] + pkt[12] + pkt[13]; } else if (hlen == 32) { csum += pkt[0] + pkt[1] + pkt[2] + pkt[3] + pkt[4] + pkt[5] + pkt[6] + pkt[7] + pkt[8] + pkt[9] + pkt[10] + pkt[11] + pkt[12] + pkt[13] + pkt[14] + pkt[15]; } else if (hlen == 36) { csum += pkt[0] + pkt[1] + pkt[2] + pkt[3] + pkt[4] + pkt[5] + pkt[6] + pkt[7] + pkt[8] + pkt[9] + pkt[10] + pkt[11] + pkt[12] + pkt[13] + pkt[14] + pkt[15] + pkt[16] + pkt[17]; } else if (hlen == 40) { csum += pkt[0] + pkt[1] + pkt[2] + pkt[3] + pkt[4] + pkt[5] + pkt[6] + pkt[7] + pkt[8] + pkt[9] + pkt[10] + pkt[11] + pkt[12] + pkt[13] + pkt[14] + pkt[15] + pkt[16] + pkt[17] + pkt[18] + pkt[19]; } csum = (csum >> 16) + (csum & 0x0000FFFF); csum += (csum >> 16); return (uint16_t) ~csum; } #endif /* __DECODE_IPV4_H__ */
1.125
1
firmware/coreboot/src/mainboard/google/nyan_blaze/pmic.c
fabiojna02/OpenCellular
1
7997187
/* * This file is part of the coreboot project. * * Copyright 2014 Google Inc. * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved. * * This program 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; version 2 of the License. * * This program 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. */ #include <boardid.h> #include <console/console.h> #include <delay.h> #include <device/i2c_simple.h> #include <stdint.h> #include <stdlib.h> #include <reset.h> #include "pmic.h" enum { AS3722_I2C_ADDR = 0x40 }; struct as3722_init_reg { u8 reg; u8 val; u8 delay; }; static struct as3722_init_reg init_list[] = { {AS3722_SDO0, 0x3C, 1}, {AS3722_SDO1, 0x32, 0}, {AS3722_LDO3, 0x59, 0}, {AS3722_SDO2, 0x3C, 0}, {AS3722_SDO3, 0x00, 0}, {AS3722_SDO4, 0x00, 0}, {AS3722_SDO5, 0x50, 0}, {AS3722_SDO6, 0x28, 1}, {AS3722_LDO0, 0x8A, 0}, {AS3722_LDO1, 0x00, 0}, {AS3722_LDO2, 0x10, 0}, {AS3722_LDO4, 0x00, 0}, {AS3722_LDO5, 0x00, 0}, {AS3722_LDO6, 0x00, 0}, {AS3722_LDO7, 0x00, 0}, {AS3722_LDO9, 0x00, 0}, {AS3722_LDO10, 0x00, 0}, {AS3722_LDO11, 0x00, 1}, }; static void pmic_write_reg(unsigned bus, uint8_t reg, uint8_t val, int do_delay) { if (i2c_writeb(bus, AS3722_I2C_ADDR, reg, val)) { printk(BIOS_ERR, "%s: reg = 0x%02X, value = 0x%02X failed!\n", __func__, reg, val); /* Reset the SoC on any PMIC write error */ hard_reset(); } else { if (do_delay) udelay(500); } } static void pmic_slam_defaults(unsigned bus) { int i; for (i = 0; i < ARRAY_SIZE(init_list); i++) { struct as3722_init_reg *reg = &init_list[i]; pmic_write_reg(bus, reg->reg, reg->val, reg->delay); } } void pmic_init(unsigned bus) { /* * Don't need to set up VDD_CORE - already done - by OTP * Don't write SDCONTROL - it's already 0x7F, i.e. all SDs enabled. * Don't write LDCONTROL - it's already 0xFF, i.e. all LDOs enabled. */ /* Restore PMIC POR defaults, in case kernel changed 'em */ pmic_slam_defaults(bus); /* First set VDD_CPU to 1.2V, then enable the VDD_CPU regulator. */ pmic_write_reg(bus, 0x00, 0x50, 1); /* First set VDD_GPU to 1.0V, then enable the VDD_GPU regulator. */ pmic_write_reg(bus, 0x06, 0x28, 1); /* * First set +1.2V_GEN_AVDD to 1.2V, then enable the +1.2V_GEN_AVDD * regulator. */ pmic_write_reg(bus, 0x12, 0x10, 1); /* * Panel power GPIO O4. Set mode for GPIO4 (0x0c to 7), then set * the value (register 0x20 bit 4) */ pmic_write_reg(bus, 0x0c, 0x07, 0); pmic_write_reg(bus, 0x20, 0x10, 1); }
1.265625
1
src/rime/registry.h
mengzhisuoliu/librime
2,326
7997195
// // Copyright RIME Developers // Distributed under the BSD License // // 2011-05-07 <NAME> <<EMAIL>> // #ifndef RIME_REGISTRY_H_ #define RIME_REGISTRY_H_ #include <rime_api.h> #include <rime/common.h> namespace rime { class ComponentBase; class Registry { public: using ComponentMap = map<string, ComponentBase*>; RIME_API ComponentBase* Find(const string& name); RIME_API void Register(const string& name, ComponentBase* component); RIME_API void Unregister(const string& name); void Clear(); RIME_API static Registry& instance(); private: Registry() = default; ComponentMap map_; }; } // namespace rime #endif // RIME_REGISTRY_H_
0.828125
1
src/tracker.c
sanford1/TapTracker
1
7997203
#include "tracker.h" #include "draw.h" #include "game.h" #include "font.h" #include "joystick.h" #include "inputhistory.h" #include "buttonquads.h" #include "sectiontable.h" #include "gamehistory.h" #include "window.h" #include "layout.h" #include "config.h" #include <stdio.h> #include <zf_log.h> #include <GLFW/glfw3.h> #include <flag.h> #define VERSION "v2.0" #include <incbin.h> INCBIN(PPImage, "src/bin/PP.png"); INCBIN(PPData, "src/bin/PP.bin"); INCBIN(ButtonSheet, "src/bin/key_button.png"); bool runTracker(struct tap_state* dataPtr, int argc, const char* argv[]) { if (glfwInit() == GL_FALSE) { ZF_LOGF("Could not initialize GLFW."); return false; } int arg_enableJoystick = -1; const char* config_path = DEFAULT_CONFIG_FILENAME; const char* pb_path = DEFAULT_GOLD_ST_FILENAME; flag_int(&arg_enableJoystick, "js", "Set to 1 to enable joystick support. This setting has priority over the config file."); flag_str(&config_path, "config", "Set json config file path"); flag_str(&pb_path, "pb", "Set \"Personal Bests\" file path"); flag_parse(argc, argv, VERSION); loadConfig(config_path); if (arg_enableJoystick == 1) { tt_config.enableJoystick = true; } /* // Load then export bitmap font. */ /* struct font_t* font = loadTTF(font_create(), "/usr/share/fonts/TTF/PP821/PragmataPro.ttf", 13.0f); */ /* exportBitmap("PP.png", font); */ /* exportFontData("PP.bin", font); */ /* struct font_t* backupfont = loadTTF(font_create(), "/usr/share/fonts/TTF/DroidSans.ttf", 13.0f); */ /* loadBitmapFontFiles(&font, "PP.png", "PP.bin"); */ struct font_t font; font_init(&font); loadBitmapFontData(&font, gPPImageData, gPPImageSize, gPPDataData, gPPDataSize); struct game_t* game = game_create(); struct joystick_t* joystick = NULL; struct input_history_t* history = input_history_create(); if (tt_config.enableJoystick) { joystick = joystick_create(GLFW_JOYSTICK_1, tt_config.jmap); } struct button_spectrum_t* bspec = button_spectrum_create(gButtonSheetData, gButtonSheetSize); struct section_table_t* table = section_table_create(pb_path); struct game_history_t* gh = game_history_create(); struct draw_data_t drawData = (struct draw_data_t) { .game = game, .font = &font, .history = history, .bspec = bspec, .table = table, .gh = gh }; bindDrawData(drawData); while (!windowSetShouldClose(tt_config.windowset, tt_config.windowCount)) { updateGameState(game, history, table, gh, dataPtr); glfwPollEvents(); // Update input history if (tt_config.enableJoystick && joystick) { updateButtons(joystick); pushInputFromJoystick(history, joystick); } drawWindowSet(tt_config.windowset, tt_config.windowCount); } game_history_destroy(gh); section_table_destroy(table); button_spectrum_destroy(bspec); game_destroy(game); font_terminate(&font); if (history) input_history_destroy(history); if (joystick) joystick_destroy(joystick); windowSet_destroy(tt_config.windowset, tt_config.windowCount); glfwTerminate(); return true; }
1.242188
1
System/Library/PrivateFrameworks/HomeKitDaemon.framework/HMDFMFQuery.h
lechium/iOS1351Headers
2
7997211
/* * This header is generated by classdump-dyld 1.5 * on Wednesday, October 27, 2021 at 3:17:25 PM Mountain Standard Time * Operating System: Version 13.5.1 (Build 17F80) * Image Source: /System/Library/PrivateFrameworks/HomeKitDaemon.framework/HomeKitDaemon * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by <NAME>. Updated by <NAME>. */ #import <HMFoundation/HMFObject.h> @protocol OS_dispatch_queue; @class NSString, NSObject; @interface HMDFMFQuery : HMFObject { NSString* _queryID; NSObject*<OS_dispatch_queue> _responseQueue; /*^block*/id _completion; } @property (nonatomic,readonly) NSString * queryID; //@synthesize queryID=_queryID - In the implementation block @property (nonatomic,readonly) NSObject*<OS_dispatch_queue> responseQueue; //@synthesize responseQueue=_responseQueue - In the implementation block @property (nonatomic,readonly) id completion; //@synthesize completion=_completion - In the implementation block -(id)description; -(id)completion; -(NSString *)queryID; -(NSObject*<OS_dispatch_queue>)responseQueue; -(id)initWithResponseQueue:(id)arg1 completion:(/*^block*/id)arg2 ; @end
0.617188
1
CGXCollectionCategoryView-OC/CGXCollectionCategoryView-OC/SectionView/CGXCollectionCategoryBaseSectionView.h
974794055/CGXCollectionCategoryView-OC
0
7997219
// // CGXCollectionCategoryBaseSectionView.h // CGXCollectionViewCategoryView // // Created by CGX on 2019/05/01. // Copyright © 2019 CGX. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface CGXCollectionCategoryBaseSectionView : UICollectionReusableView - (void)initializeViews NS_REQUIRES_SUPER; @end NS_ASSUME_NONNULL_END
0.46875
0
STM/STM32_LIBRARIES/tm_stm32_usb_host_msc.c
Logan859/Embedded-C
0
7997227
/** * |---------------------------------------------------------------------- * | Copyright (c) 2016 <NAME> * | * | Permission is hereby granted, free of charge, to any person * | obtaining a copy of this software and associated documentation * | files (the "Software"), to deal in the Software without restriction, * | including without limitation the rights to use, copy, modify, merge, * | publish, distribute, sublicense, and/or sell copies of the Software, * | and to permit persons to whom the Software is furnished to do so, * | subject to the following conditions: * | * | The above copyright notice and this permission notice shall be * | included in all copies or substantial portions of the Software. * | * | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE * | AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * | OTHER DEALINGS IN THE SOFTWARE. * |---------------------------------------------------------------------- */ #include "tm_stm32_usb_host_msc.h" TM_USBH_Result_t TM_USBH_MSC_Init(TM_USB_t USB_Mode) { #ifdef USB_USE_FS /* Init HID class for FS */ if (USB_Mode == TM_USB_FS || USB_Mode == TM_USB_Both) { /* Add class for HID to FS */ USBH_RegisterClass(&hUSBHost_FS, USBH_MSC_CLASS); } #endif #ifdef USB_USE_HS /* Init HID class for HS */ if (USB_Mode == TM_USB_HS || USB_Mode == TM_USB_Both) { /* Add class for HID to HS */ USBH_RegisterClass(&hUSBHost_HS, USBH_MSC_CLASS); } #endif /* Return OK */ return TM_USBH_Result_Ok; } TM_USBH_Result_t TM_USBH_MSC_IsConnected(TM_USB_t USB_Mode) { USBH_HandleTypeDef* USBHandle = TM_USBH_GetUSBPointer(USB_Mode); /* Check if device is connected and MSC class is active */ if (USBHandle->device.is_connected && USBH_GetActiveClass(USBHandle) == USB_MSC_CLASS) { /* MSC is connected */ return TM_USBH_Result_Ok; } /* Return error */ return TM_USBH_Result_Error; } TM_USBH_Result_t TM_USBH_MSC_IsReady(TM_USB_t USB_Mode) { USBH_HandleTypeDef* USBHandle = TM_USBH_GetUSBPointer(USB_Mode); /* Check if device is ready */ if (USBH_MSC_IsReady(USBHandle)) { /* MSC is ready */ return TM_USBH_Result_Ok; } /* Return error */ return TM_USBH_Result_Error; }
1.226563
1
frameworks/core/components/grid_layout/render_grid_layout_item.h
openharmony-gitee-mirror/ace_ace_engine
0
7997235
/* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_GRID_LAYOUT_RENDER_GRID_LAYOUT_ITEM_H #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_GRID_LAYOUT_RENDER_GRID_LAYOUT_ITEM_H #include "core/pipeline/base/render_node.h" namespace OHOS::Ace { class RenderGridLayoutItem : public RenderNode { DECLARE_ACE_TYPE(RenderGridLayoutItem, RenderNode); public: static RefPtr<RenderNode> Create(); void Update(const RefPtr<Component>& component) override; void PerformLayout() override; void HandleOnFocus(); void SetColumnIndex(int32_t columnIndex); void SetRowIndex(int32_t rowIndex); void SetColumnSpan(int32_t columnSpan); void SetRowSpan(int32_t rowSpan); void SetForceRebuild(bool forceRebuild) { forceRebuild_ = forceRebuild; } int32_t GetColumnStart() const { return columnIndex_; } int32_t GetRowStart() const { return rowIndex_; } int32_t GetColumnEnd() const { return columnIndex_ + columnSpan_; } int32_t GetRowEnd() const { return rowIndex_ + rowSpan_; } bool GetForceRebuild() const { return forceRebuild_; } void SetBoundary() { TakeBoundary(); } int32_t GetColumnIndex() const { return columnIndex_; } int32_t GetRowIndex() const { return rowIndex_; } int32_t GetColumnSpan() const { return columnSpan_; } int32_t GetRowSpan() const { return rowSpan_; } void SetIndex(int32_t index) { index_ = index; } bool ForceRebuild() const { return forceRebuild_; } int32_t GetIndex() const { return index_; } private: int32_t index_ = -1; int32_t columnIndex_ = -1; int32_t rowIndex_ = -1; int32_t columnSpan_ = 1; int32_t rowSpan_ = 1; bool forceRebuild_ = false; }; } // namespace OHOS::Ace #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_GRID_LAYOUT_RENDER_GRID_LAYOUT_ITEM_H
1.15625
1
ui/CxDev/resource.h
johnzcdGitHub/SuperCxHMI
118
7997243
//{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by CxDev.rc // #define IDC_BACK 3 #define IDC_UP 3 #define IDC_DOWN 4 #define IDR_CXDEVTYPE_CNTR_IP 6 #define IDD_ABOUTBOX 100 #define IDP_OLE_INIT_FAILED 100 #define IDS_STRING101 101 #define IDP_FAILED_TO_CREATE 102 #define IDP_OLE_INIT_FAILED2 103 #define IDD_CUSTZOOM 106 #define IDB_TOOLBOX 110 #define ID_TOOLBOX 111 #define ID_EXPLORER_BAR 114 #define ID_LAYER_1 115 #define ID_LAYER_2 116 #define ID_LAYER_3 117 #define ID_LAYER_4 118 #define ID_LAYER_5 119 #define ID_LAYER_6 120 #define ID_LAYER_7 121 #define ID_LAYER_8 122 #define ID_LAYER_9 123 #define ID_LAYER_10 124 #define ID_LAYER_11 125 #define ID_LAYER_12 126 #define ID_LAYER_13 127 #define ID_LAYER_14 128 #define ID_LAYER_15 129 #define ID_LAYER_16 130 #define IDC_FONTNAME 131 #define IDC_FONTSIZE 132 #define ID_EXPLORER_WND 132 #define ID_VIEW_FORMATBAR 133 #define ID_SYMBOL_WND 133 #define ID_CHAR_BOLD 134 #define ID_MODULE_WND 134 #define ID_PROPERTY_BAR 135 #define ID_BOXCTRL_WND 135 #define ID_CHAR_ITALIC 136 #define ID_CHAR_UNDERLINE 137 #define ID_CHAR_COLOR 138 #define IDR_MAINFRAME 139 #define IDC_TEXTCOLOR 140 #define IDR_CXDEVTYPE 141 #define IDR_LAYOUTFRAME 142 #define IDR_TOOLBAR1 143 #define IDR_SCRIPTFRAME 144 #define IDR_LAYOUTBAR 145 #define IDI_PROJECT 146 #define IDI_PICTURES 147 #define IDI_PICTURE 148 #define IDB_FORMATBAR 149 #define IDR_TOOLBAR5 150 #define IDD_SAVEPROMPT 151 #define IDB_CURSOR 152 #define IDB_BITMAP_PATTERN1 153 #define IDB_BITMAP_PATTERN 154 #define IDI_FORM 155 #define IDR_MENU_TRACK 156 #define IDI_MAINFORM 157 #define IDD_INSERTCONTROL 158 #define IDC_PAUSE 159 #define IDD_PAGE_APP 160 #define IDD_PAGE_GEN 160 #define IDD_PAGE_MAINFORM 161 #define IDD_PAGE_SUBFORM 162 #define IDD_PAGE_OBJECT 163 #define IDB_EXPLORER_ICONS 164 #define IDI_FOLDER_CLOSE 165 #define IDI_FOLDER_OPEN 166 #define IDB_GLIB_LARGE 167 #define IDB_GLIB_SMALL 168 #define IDB_GLIB_TOOL 169 #define IDR_SYMBOLWND 170 #define IDB_SYMBOL_LARGE 171 #define IDR_FULLSCREEN 172 #define IDB_SYMBOL_SMALL 173 #define IDB_FONTTYPE 174 #define IDB_SPLASH 175 #define IDB_LAYER_STATE 176 #define IDD_GROUP_DESIGN 177 #define IDD_EXPROP_ITEM 178 #define IDD_SYMBOL_PROP 178 #define IDR_MENU_LAYOUTINPLACE 179 #define IDD_LAYER 179 #define IDB_LSTATE 180 #define IDR_MODULEWND 180 #define IDR_REPORTFRAME 181 #define IDI_CODEMODULE 182 #define IDB_HANDLE_ROTATE 183 #define IDI_SUBFORM 183 #define IDB_HANDLE_GENERAL 184 #define IDC_ROTATE 184 #define IDD_OPC_DATASOURCE 187 #define IDD_OPC_SERVER 188 #define IDD_DIALOG1 191 #define IDI_REPORT 194 #define IDI_SUBREPORT 195 #define IDD_REPORT_WIZARD 195 #define IDD_REPORT_FIELD 196 #define IDB_COLUMNAR 197 #define IDB_TABULAR 199 #define IDI_PORTRAIT 199 #define ID_DRAW_SELECT 200 #define IDB_JUSTIFIED 200 #define IDI_LANDSCAPE 200 #define IDD_FILE_NEW 200 #define ID_DRAW_LINE 201 #define ID_DRAW_RECT 202 #define ID_DRAW_ROUNDRECT 203 #define ID_DRAW_ELLIPSE 204 #define ID_DRAW_POLYLINE 205 #define ID_DRAW_PIPE 206 #define ID_DRAW_POLYGON 207 #define ID_DRAW_ARC 208 #define ID_DRAW_PIE 209 #define ID_DRAW_CHORD 210 #define ID_DRAW_TEXT 211 #define ID_DRAW_DATALINK 212 #define ID_DRAW_VARIABLE 213 #define ID_DRAW_BUTTON 214 #define ID_DRAW_MENU 215 #define ID_DRAW_TIMER 216 #define ID_DRAW_CHART 217 #define ID_DRAW_ALMSUM 218 #define IDS_HOMEPAGEADDR 219 #define IDS_DEFAULT_FONTCOLOR 220 #define IDC_EDIT1 1000 #define IDC_EDIT2 1001 #define IDC_LIST 1001 #define IDC_CHECK3 1001 #define IDCANCEL2 1002 #define IDC_EDIT3 1002 #define IDC_EDIT_WIDTH 1003 #define IDC_EDIT4 1003 #define IDC_EDIT_HEIGHT 1004 #define IDC_CHECK_GRID 1005 #define IDC_EDIT6 1005 #define IDC_BACKGROUND 1006 #define IDC_FOREGROUND 1007 #define IDC_GRIDCOLOR 1008 #define IDC_TREE_PROP 1008 #define IDC_INSERT_LINE 1009 #define IDC_DELLINE 1011 #define IDC_EDITLINE 1012 #define IDC_STATIC_PREVIEW 1015 #define IDC_GROUP_TAG 1016 #define IDC_EDIT_NAME 1017 #define IDC_COMBO_TYPE 1018 #define IDC_EDIT_DES 1019 #define IDC_EDIT_VALID 1020 #define IDC_CHECK_ALL 1024 #define IDC_BUTTON_ADVANCE 1025 #define IDC_PREVIEW 1026 #define IDC_EDIT_MODDIR 1027 #define IDC_EDIT_SYMDIR 1028 #define IDC_EDIT_WORKDIR 1029 #define IDC_EDIT_FOLDER 1029 #define IDC_FOLDER 1029 #define IDC_EDIT_DEFAULT 1030 #define IDC_PICTURE 1030 #define IDC_BUTTON1 1032 #define IDC_BT_VISIBLE 1032 #define IDC_HIGHLIGHTFILLCOLOR 1032 #define IDC_BUTTON_FOLDER 1032 #define IDC_ADD_SERVER 1032 #define IDC_RIGHT_ONE 1032 #define IDC_LIST2 1033 #define IDC_BUTTON_DEFAULT 1033 #define IDC_BUTTON4 1033 #define IDC_EDIT_SERVER 1033 #define IDC_RIGHT_ALL 1033 #define IDC_BUTTON_PICTURE 1033 #define IDC_STATIC_LAYERGROUP 1034 #define IDC_BUTTON2 1034 #define IDC_BUTTON5 1034 #define IDC_REMOVE_SERVER 1034 #define IDC_LEFT_ONE 1034 #define IDC_BUTTON3 1035 #define IDC_LEFT_ALL 1035 #define IDC_BT_LOCK 1038 #define IDC_BT_HIDDEN 1039 #define IDC_BT_UNLOCK 1040 #define IDC_GROUPTAG_LIST 1041 #define IDC_FILLCOLOR 1042 #define IDC_HIGHLIGHTEDGECOLOR 1043 #define IDC_EDGECOLOR 1044 #define IDC_COMBO1 1045 #define IDC_BUTTON_VALEXP 1047 #define IDC_VALUE 1049 #define IDC_BUTTON_ENUM 1050 #define IDC_CONTROLS 1053 #define IDC_CHECK1 1054 #define IDC_CHECK2 1054 #define IDC_LIST1 1055 #define IDC_IMPLEMENTEDCATEGORIES 1056 #define IDC_WWW 1056 #define IDC_RIGHT 1056 #define IDC_REQUIREDCATEGORIES 1057 #define IDC_PROP_VALUE 1057 #define IDC_IGNOREREQUIREDCATEGORIES 1058 #define IDC_TREE1 1059 #define IDC_PROPERTYCTRL1 1060 #define IDC_TREE2 1061 #define IDC_GRID_COLOR 1066 #define IDC_GRID_ENABLE 1067 #define IDC_GRID_SPACE_WIDTH 1068 #define IDC_GRID_SPACE_HEIGHT 1069 #define IDC_ALIGN_GRID 1070 #define IDC_NEXT 1070 #define IDC_FINISH 1071 #define IDC_RECT 1072 #define IDC_LEFT 1073 #define IDC_COLUMNAR 1075 #define IDC_TABULAR 1076 #define IDC_JUSTIFIED 1077 #define IDC_PORTRAIT 1078 #define IDC_LANDSCAPE 1079 #define IDC_LAYOUT 1080 #define IDC_ORIENTATION 1081 #define IDC_SERVERPATH 1083 #define IDC_CHECK31 1087 #define IDC_USESETTING 1087 #define IDC_APP_NAME 1090 #define IDD_FOLDERNAME 27532 #define IDD_GRID_SETTING 27533 #define IDD_REPORT_LAYOUT 27534 #define IDD_TAB_ORDER 27535 #define IDC_HANDCUR 27537 #define ID_CANCEL_EDIT 32768 #define ID_VIEW_PROPERTY_BAR 32771 #define ID_VIEW_EXPLORER_BAR 32772 #define ID_VIEW_ZOOM50 32779 #define ID_VIEW_ZOOM75 32780 #define ID_VIEW_ZOOM100 32781 #define ID_VIEW_ZOOM150 32782 #define ID_VIEW_ZOOM200 32783 #define ID_VIEW_ZOOM400 32784 #define ID_VIEW_ZOOMCUSTOM 32785 #define ID_ALIGN_BOTTOM 32786 #define ID_ALIGN_HORIZ_CENTER 32787 #define ID_ALIGN_LEFT 32788 #define ID_ALIGN_VERT_CENTER 32789 #define ID_ALIGN_RIGHT 32790 #define ID_ALIGN_TOP 32791 #define ID_UNGROUP_OBJECT 32793 #define ID_ITEM_MOVEFORWARD 32794 #define ID_ITEM_MOVEBACK 32795 #define ID_SPACE_EVENVERT 32797 #define ID_SPACE_EVENHORIZ 32798 #define ID_VIEW_FULL_SCREEN 32799 #define ID_EDIT_SELECTALL 32801 #define ID_VIEW_OBJECT 32802 #define ID_VIEW_SCRIPT 32803 #define ID_INSERT_LIBGRF 32804 #define ID_INSERT_CONTROL 32805 #define ID_EDIT_PROPERTIES 32807 #define ID_GROUP_OBJECT 32808 #define ID_INSERT_BITMAP 32813 #define ID_BUTTON32815 32815 #define ID_ADD_FORM 32818 #define ID_ADD_REPORT 32819 #define ID_ADD_CODE 32820 #define ID_TRACK_MOVE 32821 #define ID_TRACK_COPY 32822 #define ID_FILE_IMPORT 32823 #define ID_FILE_SAVE_ALL 32824 #define ID_FILE_SAVE_PICTURE 32825 #define ID_PICTURE_SETUP 32826 #define ID_TOBE_CHILD 32844 #define ID_TOBE_CHILDMODULE 32845 #define ID_TOBE_MAIN 32846 #define ID_OBJECT_PROPERTY 32847 #define ID_EDIT_CONVERTTOBMP 32849 #define ID_ADDTO_MODULE 32850 #define ID_ADDTO_SYMBOL 32851 #define ID_VIEW_APPEAR_EXPERT 32852 #define ID_LAYER_SETUP 32855 #define ID_VIEW_TOOLBOX 32867 #define ID_ARRAGE_SAMEHIGHT 32869 #define ID_ARRAGE_SAMEWIDTH 32870 #define ID_ARRAGE_BOTH 32871 #define ID_ITEM_FORWARD 32872 #define ID_ITEM_BACKWORD 32873 #define ID_ITEM_FORWARD_MOST 32874 #define ID_ITEM_BACKWORD_MOST 32875 #define ID_VIEW_NORMAL 32876 #define ID_VIEW_SPACE 32877 #define ID_VIEW_STATUS 32878 #define ID_HELP_CONTENT 32879 #define ID_HELP_SEARCH 32880 #define ID_EDIT_SCRIPT 32882 #define ID_TRACKER_RESIZE 32884 #define ID_TRACKER_RESHAPE 32885 #define ID_TRACKER_ROTATE 32886 #define ID_OBJECT_FORWARD_MOST 32887 #define ID_OBJECT_BACKWORD_MOST 32888 #define ID_OBJECT_MOVEFORWARD 32889 #define ID_OBJECT_MOVEBACK 32890 #define ID_EDIT_CLONE 32891 #define ID_FILE_SAVE_PICTURE_AS 32895 #define ID_FILE_EXPORT 32896 #define ID_EDIT_PROPERTY 32897 #define ID_LIB_PROPERTY 32897 #define ID_BUTTON32901 32901 #define ID_BUTTON32902 32902 #define ID_BUTTON32903 32903 #define ID_BUTTON32904 32904 #define ID_BUTTON32905 32905 #define ID_BUTTON32906 32906 #define ID_BUTTON32907 32907 #define ID_BUTTON32908 32908 #define ID_BUTTON32909 32909 #define ID_BUTTON32910 32910 #define ID_BUTTON32911 32911 #define ID_BUTTON32912 32912 #define ID_BUTTON32913 32913 #define ID_BUTTON32914 32914 #define ID_NONE 32915 #define ID_CREATE_SYMBOL 32918 #define ID_DESIGN_SYMBOL 32919 #define ID_PICTURE_RUN 32920 #define ID_VIEW_LAYOUT_BAR 32921 #define ID_VIEW_STAND_BAR 32922 #define ID_LIB_RENAME 32924 #define ID_LIB_NEW 32925 #define ID_LIB_OPEN 32926 #define ID_LIB_DELETE 32927 #define ID_ADD_SUBMODULE 32929 #define ID_PICTURE_OPTIONS 32930 #define ID_PICTURE_OPCSERVER 32931 #define ID_ADD_CONTROL 32934 #define ID_DESIGN_SUBFORM 32935 #define ID_EDIT_SUBFORM 32936 #define ID_CREATE_SUBFORM 32937 #define ID_BREAK_SYMBOL 32938 #define ID_BREAK_SUBFORM 32939 #define ID_BUTTON32945 32945 #define ID_EDIT_GOTO 32946 #define ID_BOOKMARK_TOGGLE 32948 #define ID_BOOKMART_NEXT 32949 #define ID_BOOKMART_PREVIOUS 32950 #define ID_BOOKMARK_CLEAR 32951 #define ID_BOOKMARK_NEXT 32952 #define ID_BOOKMARK_PREVIOUS 32953 #define ID_GRID_SETTING 32954 #define ID_ADD_SUBREPORT 32955 #define ID_PAGE_SETUP 32956 #define ID_VIEW_ACTION_EXPERT 32958 #define ID_VIEW_DYNAMIC_EXPERT 32959 #define ID_EXECUTE_APPMC 32965 #define ID_BUTTON32967 32967 #define ID_INSERT_RUNCTRL 32969 #define ID_BUTTON32971 32971 #define ID_BUTTON32972 32972 #define ID_ADD_BLANK_REPORT 32973 #define ID_ADD_REPORT_WIZARD 32974 #define ID_ROTATE_LEFT 32975 #define ID_ROTATE_RIGHT 32976 #define ID_MIRROR_HORIZ 32977 #define ID_MIRROR_VERT 32978 #define ID_HORIZ_CENTER 32979 #define ID_VERT_CENTER 32980 #define ID_WINDOW_CLOSE 32981 #define ID_WINDOW_CLOSEALL 32982 #define ID_WINDOW_NEXT 32983 #define ID_WINDOW_PREVIOUS 32984 #define ID_TAB_ORDER 32985 #define IDS_INVALID_NUMBER 57346 #define IDS_INVALID_FONTSIZE 57347 #define IDS_TITLE_FORMATBAR 57348 #define IDS_APROPNAME_FONT 57349 #define IDS_DEFAULT_EDGECOLOR 57608 #define IDS_DEFAULT_FILLCOLOR 57610 #define IDS_NEW_PICTURE 57611 #define IDS_CANNOT_OPEN_PICTURE 57612 #define IDS_CANNOT_CREATE_PICTURE 57613 #define IDS_SERVERNOTFOUND 57614 #define IDS_CREATEFAILED 57615 #define IDS_APROPNAME_USERMODE 57645 #define IDS_DEFAULT_FILLSTYLE 57645 #define IDS_DEFAULT_BACKGROUNDCOLOR 57646 #define IDC_COMBOBOX_VAR 60000 #define IDC_COMBOBOX_EVENT 60001 #define IDC_LISTBOX_AUTOCOM 60200 #define IDC_FOLDERNAME 60301 #define ID_ADD_FOLDER 60305 #define ID_REMOVE_FOLDER 60306 #define ID_RENAME_FOLDER 60307 #define ID_ADD_ITEM 60308 #define ID_REMOVE_ITEM 60309 #define IDS_MAINFORM 61446 #define ID_APPEAR_EXPERT 61447 #define ID_DYNAMIC_EXPERT 61448 #define ID_EVENT_EXPERT 61449 #define IDS_BAD_INSTALL 61450 #define ID_INDICATOR_CURSOR 61451 #define IDS_ADDOBJ 61452 #define IDS_SINGLESELECTION 61453 #define IDS_MULTIPLESELECTION 61454 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 #define _APS_NEXT_RESOURCE_VALUE 202 #define _APS_NEXT_COMMAND_VALUE 32986 #define _APS_NEXT_CONTROL_VALUE 1091 #define _APS_NEXT_SYMED_VALUE 178 #endif #endif
0.306641
0
Engine/ui/controls/lineedit.h
Sebbestune/MoltenTempest
19
7997251
#pragma once #include <Tempest/AbstractTextInput> namespace Tempest { class LineEdit : public Tempest::AbstractTextInput { public: LineEdit(); void setText(const char* text) override; using AbstractTextInput::setText; using AbstractTextInput::text; using AbstractTextInput::setFont; using AbstractTextInput::font; using AbstractTextInput::setTextColor; using AbstractTextInput::textColor; Tempest::Signal<void()> onEnter; protected: void keyDownEvent (Tempest::KeyEvent &event) override; void keyRepeatEvent(Tempest::KeyEvent &event) override; private: void filterAndSetText(const char* src); }; }
0.644531
1
kmrrun/kmrrun.c
pf-aics-riken/kmr
7
7997259
/* kmrrun.c (2014-05-29) */ /* Copyright (C) 2012-2018 RIKEN R-CCS */ /** \file kmrrun.c kmrrun is command line version of KMR and it runs a MapReduce program whose mapper and reducers are user specified programs. Both mapper and reducer can be a serial or an MPI program. When kmrrun is used to run a MapReduce program, user should specify a simple program that generates key-value pairs from the output of mapper. The key-value generator program can be specified by '-k' option and can be implemented by reading outputs of mapper and then writing key-value pairs to the standard output. After shuffling the key-value paris, key-value pairs are written to files on each rank with 'key'-named text files whose line represents a key-value separated by a space. The file is passed to the reducer as the last parameter. kmrrun can run Map-only MapReduce where no reducer is run. This is very useful if you want to run multiple tasks as a single job. Options - \c -m mapper [Mandatory]\c - Specify a mapper program (serial, OpenMP or MPI) - \c -k key_value_generator [Optional] \c - Specify a key-value pair generator program (serial) - \c -r reducer [Optional]\c - Specify a reducer program (serial, OpenMP or MPI) - \c -n m_num[:r_num] [Optional] \c - Specify number of MPI processes to run mapper and reducers. When \c r_num \c is specified, each mapper runs with \c m_num \c processes and each reducer runs with \c r_num \c processes. When \c r_num \c is not specified each mapper and reducer runs with \c m_num \c processes. The default is 1, and in this case, the mapper and reducer are assumed to be serial programs. - \c --ckpt [Optional] \c - Enable checkpoint/restart. Usage \code $ mpiexec -machinefile machines -n 4 \ ./kmrrun -n m_num[:r_num] -m mapper [-k kvgenerator] [-r reducer] [--ckpt]\ inputfile \endcode Examples \code e.g.1) Run serial mapper and reducer $ mpirun -np 2 ./kmrrun -m "./pi.mapper" -k "./pi.kvgen.sh" -r "./pi.reducer" ./work e.g.2) Run MPI mapper and MPI reducer with 2 MPI processes each. $ mpirun -np 2 ./kmrrun -n 2 -m "./mpi_pi.mapper" -k "./mpi_pi.kvgen.sh" -r "./mpi_pi.reducer" ./work e.g.3) Run MPI mapper with 2 MPI processes and serial reducer $ mpirun -np 2 ./kmrrun -n 2:1 -m "./mpi_pi.mapper" -k "./mpi_pi.kvgen.sh" -r "./pi.reducer" ./work e.g.4) Only run MPI mapper with 2 MPI processes $ mpirun -np 2 ./kmrrun -n 2 -m "./mpi_pi.mapper" ./work \endcode */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/param.h> #include <dirent.h> #include <unistd.h> #include <getopt.h> #include <time.h> #include <errno.h> #include <mpi.h> #include "kmr.h" /* Maximum number of arguments to mapper and reducer programs. */ #define ARGSIZ 8 /* Buffer string size of arguments to mapper and reducer programs. */ #define ARGSTRLEN (8 * 1024) /* path name length */ #define PATHLEN 1024 /* Default number of processes used in spawned program */ #define DEFAULT_PROCS 1 /* Prefix of a directory where key-named files are generated */ #define TMPDIR_PREFIX "./KMRRUN_TMP" /* Maximum length of line that represents a key-value */ #define LINELEN 32767 static void kmrrun_abort(int, const char *, ...); static int add_command_kv(KMR_KVS *, int, char **, char *, int); static int generate_mapcmd_kvs(const struct kmr_kv_box, const KMR_KVS *, KMR_KVS *, void *, long); static int run_kv_generator(const struct kmr_kv_box, const KMR_KVS *, KMR_KVS *, void *, long); static int write_kvs(const struct kmr_kv_box[], const long, const KMR_KVS *, KMR_KVS *, void *); static int generate_redcmd_kvs(const struct kmr_kv_box, const KMR_KVS *, KMR_KVS *, void *, long); static int delete_file(const struct kmr_kv_box, const KMR_KVS *, KMR_KVS *, void *, long); static void create_tmpdir(KMR *, char *, size_t); static void delete_tmpdir(KMR *, char *); static void parse_args(char *, char *[]); /* A structure that stores command line information. */ struct cmdinfo { char **cmd_args; char *infile; int num_procs; }; /* Abort function */ static void kmrrun_abort(int rank, const char *format, ...) { va_list arg; if (rank == 0) { va_start(arg, format); vfprintf(stderr, format, arg); va_end(arg); } MPI_Abort(MPI_COMM_WORLD, 1); exit(1); } /* This function create a key-value whose key is the specified id and value is command line, and then add it to the KVS. */ static int add_command_kv(KMR_KVS *kvo, int id, char **cmd, char *infile, int n_procs) { int i, cmdlen, vlen; char *cp, *np, *value; char maxprocs[32]; /* set maxprocs parameter */ snprintf(maxprocs, 31, "maxprocs=%d", n_procs); /* construct command line */ for (cmdlen = 0, i = 0; i < ARGSIZ; i++) { if (cmd[i] == NULL) { break; } cmdlen += (int)strlen(cmd[i]) + 1; } vlen = (int)strlen(maxprocs) + 1 + cmdlen + (int)strlen(infile) + 1; value = (char *)malloc((size_t)vlen * sizeof(char)); memcpy(value, maxprocs, strlen(maxprocs)); cp = value + strlen(maxprocs); *cp++ = ' '; for (i = 0; i < ARGSIZ; i++) { if (cmd[i] == NULL) { break; } int len = (int)strlen(cmd[i]); memcpy(cp, cmd[i], (size_t)len); cp += len; *cp++ = ' '; } /* set input file */ memcpy(cp, infile, strlen(infile)); *(cp + strlen(infile)) = '\0'; /* replace all ' ' by '\0' */ cp = value; while (1) { if ((np = strchr((const char*)cp, ' ')) != NULL) { *np++ = '\0'; cp = np; } else { break; } } struct kmr_kv_box nkv = { .klen = sizeof(long), .vlen = vlen * (int)sizeof(char), .k.i = id, .v.p = (void *)value }; int ret = kmr_add_kv(kvo, nkv); free(value); return ret; } /* KMR map function It generates a KVS whose keys are numbers and values are command lines for mapper. */ static int generate_mapcmd_kvs(const struct kmr_kv_box kv, const KMR_KVS *kvi, KMR_KVS *kvo, void *p, long i_) { int ret; struct cmdinfo *info = (struct cmdinfo *)p; char *path = info->infile; struct stat status; if (stat(path, &status) < 0) { fprintf(stderr, "File[%s] error\n", path); return -1; } if (!S_ISDIR(status.st_mode) && !S_ISREG(status.st_mode)) { fprintf(stderr, "File[%s] is not regular file or directory\n", path); return -1; } if (S_ISDIR(status.st_mode)) { /* directory */ size_t direntsz; long nmax = pathconf(path, _PC_NAME_MAX); if (nmax == -1) { direntsz = (64 * 1024); } else { direntsz = (offsetof(struct dirent, d_name) + (size_t)nmax + 1); } DIR *d; struct dirent *dentp; char b[direntsz]; int id = 0; d = opendir(path); if (d == NULL) { perror("opendir"); return -1; } while (readdir_r(d, (void *)b, &dentp) >= 0) { struct stat substat; char fullpath[MAXPATHLEN]; if (dentp == NULL) { break; } ret = snprintf(fullpath, sizeof(fullpath), "%s/%s", path, dentp->d_name); if (ret <= 0) { perror("snprintf"); continue; } if (stat(fullpath, &substat) < 0) { continue; } if (S_ISREG(substat.st_mode)) { ret = add_command_kv(kvo, id, info->cmd_args, fullpath, info->num_procs); if (ret != MPI_SUCCESS) { return ret; } id += 1; } } closedir(d); ret = MPI_SUCCESS; } else { /* file */ ret = add_command_kv(kvo, 0, info->cmd_args, path, info->num_procs); } return ret; } /* KMR map function It generates key-values for shuffling after mapper programs has been executed. */ static int run_kv_generator(const struct kmr_kv_box kv, const KMR_KVS *kvi, KMR_KVS *kvo, void *p, long i_) { struct cmdinfo *info = (struct cmdinfo *)p; if (info->cmd_args[0] != NULL) { int ret, pipefd[2]; ret = pipe(pipefd); if (ret < 0) { perror("pipe for kv generator"); return ret; } pid_t pid = fork(); if (pid < 0) { perror("fork kv generator"); return -1; } else if (pid == 0) { // child process ret = close(pipefd[0]); if (ret < 0) { perror("pipe close kv generator"); return ret; } ret = dup2(pipefd[1], STDOUT_FILENO); if (ret < 0) { perror("dup2 pipe kv generator"); return ret; } ret = close(pipefd[1]); if (ret < 0) { perror("pipe close kv generator"); return ret; } // get the input filename from key-value char *cp, *infile = NULL; for (cp = (char *)kv.v.p; cp < kv.v.p + kv.vlen - 1; cp++) { if (*cp == '\0') { infile = cp + 1; } } char *cmd_args[ARGSIZ+1] = { NULL }; int i; for (i = 0; i <= ARGSIZ; i++) { if (info->cmd_args[i] != NULL) { cmd_args[i] = info->cmd_args[i]; } else { cmd_args[i] = infile; break; } } ret = execv(cmd_args[0], cmd_args); if (ret < 0) { perror("execv kv generator"); return ret; } } else { // parent process ret = close(pipefd[1]); if (ret < 0) { perror("pipe close kv generator"); return ret; } char line[LINELEN]; long missingnl = 0; long badlines = 0; FILE* chld_out = fdopen(pipefd[0], "r"); while (fgets(line, sizeof(line), chld_out) != NULL) { char *cp = strchr(line, '\n'); if (cp != NULL) { assert(*cp == '\n'); *cp = '\0'; } else { missingnl++; } cp = strchr(line, ' '); if (cp == NULL) { /* No value field. */ badlines++; continue; } *cp = '\0'; char *key = line; char *value = (cp + 1); struct kmr_kv_box nkv; nkv.klen = (int)strlen(key) + 1; nkv.vlen = (int)strlen(value) + 1; nkv.k.p = key; nkv.v.p = value; ret = kmr_add_kv(kvo, nkv); if (ret != MPI_SUCCESS) { return ret; } if (missingnl) { fprintf(stderr, ("warning: Line too long or " "missing last newline.\n")); } if (badlines) { fprintf(stderr, ("warning: Some lines have " "no key-value pairs (ignored).\n")); } } ret = close(pipefd[0]); if (ret < 0) { perror("pipe close kv generator"); return ret; } } } return MPI_SUCCESS; } /* KMR reduce function Write key-value pairs in KVS to key-named files. */ static int write_kvs(const struct kmr_kv_box kv[], const long n, const KMR_KVS *kvs, KMR_KVS *kvo, void *p) { FILE *fp; int ret; char filename[PATHLEN]; snprintf(filename, PATHLEN, "%s/%d/%s", (char *)p, kvs->c.mr->rank, kv[0].k.p); if ((fp = fopen(filename, "w")) == NULL) { perror("open file with write mode"); return -1; } for (long i = 0; i < n; i++) { fprintf(fp, "%s %s\n", kv[i].k.p, kv[i].v.p); } fclose(fp); // key is key, value is file path struct kmr_kv_box nkv; nkv.klen = kv[0].klen; nkv.k.p = kv[0].k.p; nkv.vlen = (int)strlen(filename) + 1; nkv.v.p = filename; ret = kmr_add_kv(kvo, nkv); if (ret != MPI_SUCCESS) { return ret; } return MPI_SUCCESS; } /* KMR map function It generates a KVS whose keys are numbers and values are command lines for reducer. */ static int generate_redcmd_kvs(const struct kmr_kv_box kv, const KMR_KVS *kvi, KMR_KVS *kvo, void *p, long i_) { int ret; struct cmdinfo *info = (struct cmdinfo *)p; ret = add_command_kv(kvo, (int)i_, info->cmd_args, (char *)kv.v.p, info->num_procs); return ret; } /* KMR map function It deletes a key-named file. */ static int delete_file(const struct kmr_kv_box kv, const KMR_KVS *kvi, KMR_KVS *kvo, void *p, long i_) { char *file_name = (char*)kv.v.p; int ret = access(file_name, F_OK); if (ret == 0) { unlink(file_name); } return MPI_SUCCESS; } /* Parses command parameters given for mapper and reducer arguments. It scans an argument string like "mapper arg0 arg1" for the -m and -r options, and generates an argv array {"mapper", "arg0", "arg1", NULL}. The separator is a whitespace. \param argstr string given for -m or -r options. \param argary array to be filled by argument strings. */ static void parse_args(char *argstr, char *argary[]) { if (!(argstr[0] == '.' || argstr[0] == '/')) { /* insert './' in front of command name */ int len = (int)strlen(argstr) + 1; if (len + 2 > ARGSTRLEN) { fprintf(stderr, "command line is too long.\n"); MPI_Abort(MPI_COMM_WORLD, 1); } fprintf(stderr, "The command is assumed to be located in " "the current directory.\n"); for (int i = len; i >= 0; i--) { argstr[i+2] = argstr[i]; } argstr[0] = '.'; argstr[1] = '/'; } char *cp, *np; char **ap; ap = argary; cp = argstr; while (1) { *ap = cp; if ((np = strchr((const char*)cp, ' ')) != NULL) { *np++ = '\0'; } if (++ap >= &argary[ARGSIZ-1]) { *ap = NULL; break; } else { if (np == NULL) { *ap = NULL; break; } } while (*np == ' ') { np++; } cp = np; } } /* Create temporal directories for storing key files for reducers. */ static void create_tmpdir(KMR *mr, char *tmpdir, size_t tmpdir_len) { /* create root directory on rank 0 */ if (mr->rank == 0) { int cur_time = (int)time(NULL); snprintf(tmpdir, tmpdir_len, TMPDIR_PREFIX"%d", cur_time); int ret = mkdir(tmpdir, 0777); if (ret != 0) { char *errmsg = strerror(errno); kmrrun_abort(0, "Error on creating the temporal directory: %s\n", errmsg); } } int ret = MPI_Bcast(tmpdir, (int)tmpdir_len, MPI_CHAR, 0, mr->comm); if (ret != MPI_SUCCESS) { kmrrun_abort(mr->rank, "MPI_Bcast failed.\n"); } /* create rank local directory */ char rankdir[PATHLEN]; snprintf(rankdir, PATHLEN, "%s/%d", tmpdir, mr->rank); ret = mkdir(rankdir, 0777); if (ret != 0) { char *errmsg = strerror(errno); kmrrun_abort(mr->rank, "Error on creating the rank local temporal directory: " "%s\n", errmsg); } } /* Delete temporal directories for storing key files for reducers. */ static void delete_tmpdir(KMR *mr, char *tmpdir) { /* delete rank local directory */ char rankdir[PATHLEN]; snprintf(rankdir, PATHLEN, "%s/%d", tmpdir, mr->rank); int ret = rmdir(rankdir); if (ret != 0) { char *errmsg = strerror(errno); fprintf(stderr, "Rank[%05d] Failed to delete rank local temporal directory: " "%s\n", mr->rank, errmsg); } MPI_Barrier(mr->comm); /* delete root directory on rank 0 */ if (mr->rank == 0) { ret = rmdir(tmpdir); if (ret != 0) { char *errmsg = strerror(errno); fprintf(stderr, "Failed to delete the temporal directory: %s\n", errmsg); } } } int main(int argc, char *argv[]) { int rank, ret, opt; char *mapper = NULL, *reducer = NULL, *infile = NULL; char *margv[ARGSIZ] = { NULL }, margbuf[ARGSTRLEN]; char *rargv[ARGSIZ] = { NULL }, rargbuf[ARGSTRLEN]; char *kargv[ARGSIZ] = { NULL }, kargbuf[ARGSTRLEN]; int map_procs = DEFAULT_PROCS, red_procs = DEFAULT_PROCS; int ckpt_enable = 0; char *usage_msg = "Usage %s [-n m_num[:r_num]] -m mapper [-k kvgenerator]\n" " [-r reducer] [--ckpt]\n" " inputfile\n"; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); while (1) { int option_index = 0; static struct option long_options[] = { {"ckpt", no_argument, 0, 0}, {0, 0, 0, 0} }; opt = getopt_long(argc, argv, "m:r:k:n:", long_options, &option_index); if (opt == -1) { break; } switch (opt) { size_t asz; case 0: if (strcmp("ckpt", long_options[option_index].name) == 0) { ckpt_enable = 1; } break; case 'm': asz = (strlen(optarg) + 1); if (asz >= ARGSTRLEN) { kmrrun_abort(rank, "Argument too long for mapper (%s)\n", optarg); } memcpy(margbuf, optarg, asz); parse_args(margbuf, &margv[0]); mapper = margv[0]; break; case 'r': asz = (strlen(optarg) + 1); if (asz >= ARGSTRLEN) { kmrrun_abort(rank, "Argument too long for reducer (%s)\n", optarg); } memcpy(rargbuf, optarg, asz); parse_args(rargbuf, &rargv[0]); reducer = rargv[0]; break; case 'n': asz = (strlen(optarg) + 1); char para_arg[ARGSTRLEN], *cp; memcpy(para_arg, optarg, asz); cp = strchr(para_arg, ':'); if (cp == NULL) { /* use the same # of processes in map & reduce */ map_procs = (int)strtol(para_arg, NULL, 10); red_procs = map_procs; } else { /* use the different # of processes */ *cp = '\0'; char *np = cp + 1; map_procs = (int)strtol(para_arg, NULL, 10); red_procs = (int)strtol(np, NULL, 10); } break; case 'k': asz = (strlen(optarg) + 1); if (asz >= ARGSTRLEN) { kmrrun_abort(rank, "Argument too long for key-value " "generator (%s)\n", optarg); } memcpy(kargbuf, optarg, asz); parse_args(kargbuf, &kargv[0]); break; default: kmrrun_abort(rank, usage_msg, argv[0]); } } if ((argc - optind) != 1) { kmrrun_abort(rank, usage_msg, argv[0]); } else { infile = argv[optind]; optind++; } if (mapper == NULL) { kmrrun_abort(rank, usage_msg, argv[0]); } kmr_init(); MPI_Info info; MPI_Info_create(&info); if (ckpt_enable == 1) { ret = MPI_Info_set(info, "ckpt_enable", "1"); } KMR *mr = kmr_create_context(MPI_COMM_WORLD, info, 0); MPI_Info_free(&info); mr->spawn_gap_msec[0] = 500; mr->spawn_gap_msec[1] = 1000; //mr->trace_map_spawn = 1; /* Assign mapper command lines to static processes */ _Bool nonmpi = (map_procs == 1) ? 1 : 0; struct cmdinfo mapinfo = { margv, infile, map_procs }; KMR_KVS *kvs_commands = kmr_create_kvs(mr, KMR_KV_INTEGER, KMR_KV_OPAQUE); ret = kmr_map_once(kvs_commands, &mapinfo, kmr_noopt, 1, generate_mapcmd_kvs); if (ret != MPI_SUCCESS) { kmrrun_abort(rank, "kmr_map_once failed.\n"); } KMR_KVS *kvs_commands2 = kmr_create_kvs(mr, KMR_KV_INTEGER, KMR_KV_OPAQUE); ret = kmr_shuffle(kvs_commands, kvs_commands2, kmr_noopt); if (ret != MPI_SUCCESS) { kmrrun_abort(rank, "kmr_shuffle failed.\n"); } /* Run mapper */ KMR_KVS *kvs_map = kmr_create_kvs(mr, KMR_KV_OPAQUE, KMR_KV_OPAQUE); struct cmdinfo gkvinfo = { kargv, NULL, 1 }; ret = kmr_map_processes(nonmpi, kvs_commands2, kvs_map, &gkvinfo, MPI_INFO_NULL, kmr_snoopt, run_kv_generator); if (ret != MPI_SUCCESS) { kmrrun_abort(rank, "executing mapper failed.\n"); } if (reducer != NULL) { /* Shuffle key-value */ KMR_KVS *kvs_red = kmr_create_kvs(mr, KMR_KV_OPAQUE, KMR_KV_OPAQUE); ret = kmr_shuffle(kvs_map, kvs_red, kmr_noopt); if (ret != MPI_SUCCESS) { kmrrun_abort(rank, "shuffling failed.\n"); } /* Create a temporal directory for storing key files */ char tmpdir[PATHLEN]; create_tmpdir(mr, tmpdir, PATHLEN); /* Write key-values to files whose name is key */ KMR_KVS *kvs_file = kmr_create_kvs(mr, KMR_KV_OPAQUE, KMR_KV_OPAQUE); ret = kmr_reduce(kvs_red, kvs_file, tmpdir, kmr_noopt, write_kvs); if (ret != MPI_SUCCESS) { kmrrun_abort(rank, "writing key-values to files failed.\n"); } /* Generate commands for reducer */ nonmpi = (red_procs == 1) ? 1 : 0; struct cmdinfo redinfo = { rargv, NULL, red_procs }; kvs_commands = kmr_create_kvs(mr, KMR_KV_INTEGER, KMR_KV_OPAQUE); struct kmr_option kmr_inspect = { .inspect = 1 }; ret = kmr_map(kvs_file, kvs_commands, &redinfo, kmr_inspect, generate_redcmd_kvs); if (ret != MPI_SUCCESS) { kmrrun_abort(rank, "kmr_map failed.\n"); } /* Run reducer */ ret = kmr_map_processes(nonmpi, kvs_commands, NULL, NULL, MPI_INFO_NULL, kmr_snoopt, NULL); if (ret != MPI_SUCCESS) { kmrrun_abort(rank, "executing reducer failed.\n"); } /* Delete key files */ ret = kmr_map(kvs_file, NULL, NULL, kmr_noopt, delete_file); if (ret != MPI_SUCCESS) { kmrrun_abort(rank, "deleting file failed.\n"); } /* Delete the temporal directory */ delete_tmpdir(mr, tmpdir); } else { kmr_free_kvs(kvs_map); } kmr_free_context(mr); kmr_fin(); MPI_Finalize(); return 0; } /* Copyright (C) 2012-2018 RIKEN R-CCS This library is distributed WITHOUT ANY WARRANTY. This library can be redistributed and/or modified under the terms of the BSD 2-Clause License. */
1.726563
2
DeviceCode/Include/COM_decl.h
Sirokujira/MicroFrameworkPK_v4_3
4
7997267
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Copyright (c) Microsoft Corporation. All rights reserved. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef _DRIVERS_COM_DIRECTOR_DECL_H_ #define _DRIVERS_COM_DIRECTOR_DECL_H_ 1 //--// extern INT32 g_DebuggerPort_SslCtx_Handle; BOOL DebuggerPort_Initialize ( COM_HANDLE ComPortNum ); BOOL DebuggerPort_Uninitialize( COM_HANDLE ComPortNum ); int DebuggerPort_Write( COM_HANDLE ComPortNum, const char* Data, size_t size ); int DebuggerPort_Read ( COM_HANDLE ComPortNum, char* Data, size_t size ); BOOL DebuggerPort_Flush( COM_HANDLE ComPortNum ); BOOL DebuggerPort_IsSslSupported( COM_HANDLE ComPortNum ); BOOL DebuggerPort_UpgradeToSsl( COM_HANDLE ComPortNum, UINT32 flags ); BOOL DebuggerPort_IsUsingSsl( COM_HANDLE ComPortNum ); struct IDebuggerPortSslConfig { BOOL (*GetCertificateAuthority)( UINT8** caCert, UINT32* pCertLen ); BOOL (*GetTargetHostName )( LPCSTR* strTargHost ); BOOL (*GetDeviceCertificate )( UINT8** deviceCert, UINT32* pCertLen ); }; extern IDebuggerPortSslConfig g_DebuggerPortSslConfig; //--// void CPU_ProtectCommunicationGPIOs( BOOL On ); //--// void CPU_InitializeCommunication(); void CPU_UninitializeCommunication(); //--// #endif // _DRIVERS_COM_DIRECTOR_DECL_H_
0.617188
1
srcs/ft_string/ft_strsplit_str.c
etrobert/libft
0
7997275
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strsplit_str.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: mverdier <<EMAIL>> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/16 14:51:27 by mverdier #+# #+# */ /* Updated: 2017/02/16 14:51:50 by mverdier ### ########.fr */ /* */ /* ************************************************************************** */ #include "ft_string.h" static int ft_word_len(const char *s, char *chars) { int n; n = 0; while (!ft_strchr(chars, s[n]) && s[n] != '\0') n++; return (n); } static const char *ft_next_word(const char *s, char *chars) { while (!ft_strchr(chars, *s) && *s != '\0') s++; while (ft_strchr(chars, *s) && *s != '\0') s++; return (s); } static char *ft_get_word(const char *s, char *chars) { char *res; int i; if ((res = malloc(sizeof(char) * (ft_word_len(s, chars) + 1))) == NULL) return (NULL); i = 0; while (!ft_strchr(chars, s[i]) && s[i] != '\0') { res[i] = s[i]; i++; } res[i] = '\0'; return (res); } static int ft_count_words(const char *s, char *chars) { int n; if (s == NULL) return (-1); n = 0; while (*s != '\0') { s = ft_next_word(s, chars); n++; } return (n); } char **ft_strsplit_str(const char *s, char *chars) { char **tab; int i; if (s == NULL) return (NULL); while (ft_strchr(chars, *s) && *s != '\0') s++; if ((tab = malloc(sizeof(char *) * (ft_count_words(s, chars) + 1))) == NULL) return (NULL); i = 0; while (*s != '\0') { tab[i] = ft_get_word(s, chars); s = ft_next_word(s, chars); i++; } tab[i] = NULL; return (tab); }
1.320313
1
ESP32/images/lora.h
SnowGlobeio/LoraWan
0
7997283
#define lorawan_Nok_width 25 #define lorawan_Nok_height 17 const char lorawan_Nok_bits[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xf0, 0x01, 0x00, 0x06, 0x30, 0x03, 0x00, 0x86, 0x33, 0xf2, 0x00, 0xc6, 0xf6, 0x83, 0x00, 0x46, 0xf4, 0xf1, 0x00, 0xde, 0x36, 0x93, 0x00, 0x9e, 0x33, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; #define lorawan_ok_width 25 #define lorawan_ok_height 17 const char lorawan_ok_bits[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x46, 0xf4, 0x01, 0x00, 0x06, 0x31, 0x03, 0x00, 0x86, 0x33, 0xf2, 0x00, 0xc6, 0xf6, 0x83, 0x00, 0x46, 0xf4, 0xf1, 0x00, 0xde, 0x36, 0x93, 0x00, 0x9e, 0x33, 0xf3, 0x00, 0x00, 0x01, 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00 };
0.785156
1
ports/nxp_rt1050_60/dcmc.h
Corsair-cxs/micropython-rocky
181
7997291
#include "py/obj.h" #include "fsl_pwm.h" #include "fsl_qtmr.h" //based on flexpwm #define MICROPY_HW_DCMC0_NAME 'dcmc0' #define MICROPY_HW_DCMC_0 pin_EMC_27 #define MICROPY_HW_DCMC_0N pin_EMC_28 #define MICROPY_HW_DCMC1_NAME 'dcmc1' #define MICROPY_HW_DCMC_1 pin_EMC_29 #define MICROPY_HW_DCMC_1N pin_EMC_30 #define MICROPY_HW_DCMC2_NAME 'dcmc2' #define MICROPY_HW_DCMC_2 pin_EMC_21 #define MICROPY_HW_DCMC_2N pin_EMC_22 typedef enum { PYB_DCMC_0 = 0, // index 0 is not exist on RT10xx! PYB_DCMC_1 = 1, PYB_DCMC_2 = 2, } pyb_dcmc_t; typedef struct _dcmc_obj_t{ mp_obj_base_t base; PWM_Type* pwm_base; pwm_submodule_t flexidex; pwm_module_control_t control_t; float pwm_width; uint32_t inverted; uint32_t freq; uint32_t prescale; float err; const pin_obj_t *pin[2]; } pyb_dcmc_obj_t; void dcmc_init0(); extern const mp_obj_type_t pyb_dcmc_type;
1.007813
1
dev/Gems/CloudGemDefectReporter/v1/Code/Source/PostDefectReportsJob.h
Kezryk/lumberyard
1
7997299
#pragma once #include <AzCore/Jobs/Job.h> #include <AzCore/std/string/string.h> #include <AzCore/std/smart_ptr/shared_ptr.h> #include <AzCore/std/containers/vector.h> #include <AzCore/std/containers/map.h> #include "DefectReportManager.h" namespace CloudGemDefectReporter { namespace ServiceAPI { struct EncryptedPresignedPostFields; } class PostDefectReportsJob : public AZ::Job { public: AZ_CLASS_ALLOCATOR(PostDefectReportsJob, AZ::SystemAllocator, 0); PostDefectReportsJob(AZ::JobContext* jobContext, AZStd::vector<ReportWrapper> reports); void Process() override; private: void UploadAttachment(const char* filePath, bool isAutoDelete,const AZStd::string& url, const ServiceAPI::EncryptedPresignedPostFields& fields); AZStd::vector<ReportWrapper> m_reports; }; }
1.03125
1
include/etl/hfsm.h
fractalembedded/etl
1,159
7997307
/****************************************************************************** The MIT License(MIT) Embedded Template Library. https://github.com/ETLCPP/etl https://www.etlcpp.com Copyright(c) 2021 <NAME>, <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions : The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************************/ #ifndef ETL_HFSM_INCLUDED #define ETL_HFSM_INCLUDED #include "fsm.h" namespace etl { //*************************************************************************** /// The HFSM class. /// Builds on the FSM class by overriding the receive function and adding /// state hierarchy walking functions. //*************************************************************************** class hfsm : public etl::fsm { public: //******************************************* /// Constructor. //******************************************* hfsm(etl::message_router_id_t id) : fsm(id) { } using fsm::receive; //******************************************* /// Top level message handler for the HFSM. //******************************************* void receive(const etl::imessage& message) ETL_OVERRIDE { etl::fsm_state_id_t next_state_id = p_state->process_event(message); if (next_state_id != ifsm_state::No_State_Change) { ETL_ASSERT(next_state_id < number_of_states, ETL_ERROR(etl::fsm_state_id_exception)); etl::ifsm_state* p_next_state = state_list[next_state_id]; // Have we changed state? if (p_next_state != p_state) { etl::ifsm_state* p_root = common_ancestor(p_state, p_next_state); do_exits(p_root, p_state); p_state = p_next_state; next_state_id = do_enters(p_root, p_next_state, true); if (next_state_id != ifsm_state::No_State_Change) { ETL_ASSERT(next_state_id < number_of_states, ETL_ERROR(etl::fsm_state_id_exception)); p_state = state_list[next_state_id]; } } } } private: //******************************************* /// Return the first common ancester of the two states. //******************************************* static etl::ifsm_state* common_ancestor(etl::ifsm_state* s1, etl::ifsm_state* s2) { size_t depth1 = get_depth(s1); size_t depth2 = get_depth(s2); // Adjust s1 and s2 to the same depth. if (depth1 > depth2) { s1 = adjust_depth(s1, depth1 - depth2); } else { s2 = adjust_depth(s2, depth2 - depth1); } // Now they're aligned to the same depth they can step towards the root together. while (s1 != s2) { s1 = s1->p_parent; s2 = s2->p_parent; } return s1; } //******************************************* /// Find the depth of the state. //******************************************* static size_t get_depth(etl::ifsm_state* s) { size_t depth = 0UL; while (s != ETL_NULLPTR) { s = s->p_parent; ++depth; } return depth; } //******************************************* /// Align the depths of the states. //******************************************* static etl::ifsm_state* adjust_depth(etl::ifsm_state* s, size_t offset) { while (offset != 0U) { s = s->p_parent; --offset; } return s; } //******************************************* /// Entering the state. //******************************************* static etl::fsm_state_id_t do_enters(const etl::ifsm_state* p_root, etl::ifsm_state* p_target, bool activate_default_children) { ETL_ASSERT(p_target != ETL_NULLPTR, ETL_ERROR(etl::fsm_null_state_exception)); // We need to go recursively up the tree if the target and root don't match if ((p_root != p_target) && (p_target->p_parent != ETL_NULLPTR)) { if (p_target->p_parent != p_root) { // The parent we're calling shouldn't activate its defaults, or this state will be deactivated. do_enters(p_root, p_target->p_parent, false); } // Set us as our parent's active child p_target->p_parent->p_active_child = p_target; } etl::fsm_state_id_t next_state = p_target->on_enter_state(); ETL_ASSERT(ifsm_state::No_State_Change == next_state, ETL_ERROR(etl::fsm_state_composite_state_change_forbidden)); // Activate default child if we need to activate any initial states in an active composite state. if (activate_default_children) { while (p_target->p_default_child != ETL_NULLPTR) { p_target = p_target->p_default_child; p_target->p_parent->p_active_child = p_target; next_state = p_target->on_enter_state(); ETL_ASSERT(ifsm_state::No_State_Change == next_state, ETL_ERROR(etl::fsm_state_composite_state_change_forbidden)); } next_state = p_target->get_state_id(); } return next_state; } //******************************************* /// Exiting the state. //******************************************* static void do_exits(const etl::ifsm_state* p_root, etl::ifsm_state* p_source) { etl::ifsm_state* p_current = p_source; // Iterate down to the lowest child while (p_current->p_active_child != ETL_NULLPTR) { p_current = p_current->p_active_child; } // Run exit state on all states up to the root while (p_current != p_root) { p_current->on_exit_state(); p_current = p_current->p_parent; } } }; } #endif
1.359375
1
tools/perf/util/block-info.c
CPU-Code/-Linux_kernel
2
7997315
// SPDX-License-Identifier: GPL-2.0 #include <stdlib.h> #include <string.h> #include <linux/zalloc.h> #include "block-info.h" #include "sort.h" #include "annotate.h" #include "symbol.h" #include "dso.h" #include "map.h" #include "srcline.h" #include "evlist.h" #include "hist.h" #include "ui/browsers/hists.h" static struct block_header_column { const char *name; int width; } block_columns[PERF_HPP_REPORT__BLOCK_MAX_INDEX] = { [PERF_HPP_REPORT__BLOCK_TOTAL_CYCLES_PCT] = { .name = "Sampled Cycles%", .width = 15, }, [PERF_HPP_REPORT__BLOCK_LBR_CYCLES] = { .name = "Sampled Cycles", .width = 14, }, [PERF_HPP_REPORT__BLOCK_CYCLES_PCT] = { .name = "Avg Cycles%", .width = 11, }, [PERF_HPP_REPORT__BLOCK_AVG_CYCLES] = { .name = "Avg Cycles", .width = 10, }, [PERF_HPP_REPORT__BLOCK_RANGE] = { .name = "[Program Block Range]", .width = 70, }, [PERF_HPP_REPORT__BLOCK_DSO] = { .name = "Shared Object", .width = 20, } }; struct block_info *block_info__get(struct block_info *bi) { if (bi) refcount_inc(&bi->refcnt); return bi; } void block_info__put(struct block_info *bi) { if (bi && refcount_dec_and_test(&bi->refcnt)) free(bi); } struct block_info *block_info__new(void) { struct block_info *bi = zalloc(sizeof(*bi)); if (bi) refcount_set(&bi->refcnt, 1); return bi; } int64_t block_info__cmp(struct perf_hpp_fmt *fmt __maybe_unused, struct hist_entry *left, struct hist_entry *right) { struct block_info *bi_l = left->block_info; struct block_info *bi_r = right->block_info; int cmp; if (!bi_l->sym || !bi_r->sym) { if (!bi_l->sym && !bi_r->sym) return 0; else if (!bi_l->sym) return -1; else return 1; } if (bi_l->sym == bi_r->sym) { if (bi_l->start == bi_r->start) { if (bi_l->end == bi_r->end) return 0; else return (int64_t)(bi_r->end - bi_l->end); } else return (int64_t)(bi_r->start - bi_l->start); } else { cmp = strcmp(bi_l->sym->name, bi_r->sym->name); return cmp; } if (bi_l->sym->start != bi_r->sym->start) return (int64_t)(bi_r->sym->start - bi_l->sym->start); return (int64_t)(bi_r->sym->end - bi_l->sym->end); } static void init_block_info(struct block_info *bi, struct symbol *sym, struct cyc_hist *ch, int offset, u64 total_cycles) { bi->sym = sym; bi->start = ch->start; bi->end = offset; bi->cycles = ch->cycles; bi->cycles_aggr = ch->cycles_aggr; bi->num = ch->num; bi->num_aggr = ch->num_aggr; bi->total_cycles = total_cycles; memcpy(bi->cycles_spark, ch->cycles_spark, NUM_SPARKS * sizeof(u64)); } int block_info__process_sym(struct hist_entry *he, struct block_hist *bh, u64 *block_cycles_aggr, u64 total_cycles) { struct annotation *notes; struct cyc_hist *ch; static struct addr_location al; u64 cycles = 0; if (!he->ms.map || !he->ms.sym) return 0; memset(&al, 0, sizeof(al)); al.map = he->ms.map; al.sym = he->ms.sym; notes = symbol__annotation(he->ms.sym); if (!notes || !notes->src || !notes->src->cycles_hist) return 0; ch = notes->src->cycles_hist; for (unsigned int i = 0; i < symbol__size(he->ms.sym); i++) { if (ch[i].num_aggr) { struct block_info *bi; struct hist_entry *he_block; bi = block_info__new(); if (!bi) return -1; init_block_info(bi, he->ms.sym, &ch[i], i, total_cycles); cycles += bi->cycles_aggr / bi->num_aggr; he_block = hists__add_entry_block(&bh->block_hists, &al, bi); if (!he_block) { block_info__put(bi); return -1; } } } if (block_cycles_aggr) *block_cycles_aggr += cycles; return 0; } static int block_column_header(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hists *hists __maybe_unused, int line __maybe_unused, int *span __maybe_unused) { struct block_fmt *block_fmt = container_of(fmt, struct block_fmt, fmt); return scnprintf(hpp->buf, hpp->size, "%*s", block_fmt->width, block_fmt->header); } static int block_column_width(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp __maybe_unused, struct hists *hists __maybe_unused) { struct block_fmt *block_fmt = container_of(fmt, struct block_fmt, fmt); return block_fmt->width; } static int block_total_cycles_pct_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he) { struct block_fmt *block_fmt = container_of(fmt, struct block_fmt, fmt); struct block_info *bi = he->block_info; double ratio = 0.0; char buf[16]; if (block_fmt->total_cycles) ratio = (double)bi->cycles / (double)block_fmt->total_cycles; sprintf(buf, "%.2f%%", 100.0 * ratio); return scnprintf(hpp->buf, hpp->size, "%*s", block_fmt->width, buf); } static int64_t block_total_cycles_pct_sort(struct perf_hpp_fmt *fmt, struct hist_entry *left, struct hist_entry *right) { struct block_fmt *block_fmt = container_of(fmt, struct block_fmt, fmt); struct block_info *bi_l = left->block_info; struct block_info *bi_r = right->block_info; double l, r; if (block_fmt->total_cycles) { l = ((double)bi_l->cycles / (double)block_fmt->total_cycles) * 100000.0; r = ((double)bi_r->cycles / (double)block_fmt->total_cycles) * 100000.0; return (int64_t)l - (int64_t)r; } return 0; } static void cycles_string(u64 cycles, char *buf, int size) { if (cycles >= 1000000) scnprintf(buf, size, "%.1fM", (double)cycles / 1000000.0); else if (cycles >= 1000) scnprintf(buf, size, "%.1fK", (double)cycles / 1000.0); else scnprintf(buf, size, "%1d", cycles); } static int block_cycles_lbr_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he) { struct block_fmt *block_fmt = container_of(fmt, struct block_fmt, fmt); struct block_info *bi = he->block_info; char cycles_buf[16]; cycles_string(bi->cycles_aggr, cycles_buf, sizeof(cycles_buf)); return scnprintf(hpp->buf, hpp->size, "%*s", block_fmt->width, cycles_buf); } static int block_cycles_pct_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he) { struct block_fmt *block_fmt = container_of(fmt, struct block_fmt, fmt); struct block_info *bi = he->block_info; double ratio = 0.0; u64 avg; char buf[16]; if (block_fmt->block_cycles && bi->num_aggr) { avg = bi->cycles_aggr / bi->num_aggr; ratio = (double)avg / (double)block_fmt->block_cycles; } sprintf(buf, "%.2f%%", 100.0 * ratio); return scnprintf(hpp->buf, hpp->size, "%*s", block_fmt->width, buf); } static int block_avg_cycles_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he) { struct block_fmt *block_fmt = container_of(fmt, struct block_fmt, fmt); struct block_info *bi = he->block_info; char cycles_buf[16]; cycles_string(bi->cycles_aggr / bi->num_aggr, cycles_buf, sizeof(cycles_buf)); return scnprintf(hpp->buf, hpp->size, "%*s", block_fmt->width, cycles_buf); } static int block_range_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he) { struct block_fmt *block_fmt = container_of(fmt, struct block_fmt, fmt); struct block_info *bi = he->block_info; char buf[128]; char *start_line, *end_line; symbol_conf.disable_add2line_warn = true; start_line = map__srcline(he->ms.map, bi->sym->start + bi->start, he->ms.sym); end_line = map__srcline(he->ms.map, bi->sym->start + bi->end, he->ms.sym); if ((start_line != SRCLINE_UNKNOWN) && (end_line != SRCLINE_UNKNOWN)) { scnprintf(buf, sizeof(buf), "[%s -> %s]", start_line, end_line); } else { scnprintf(buf, sizeof(buf), "[%7lx -> %7lx]", bi->start, bi->end); } free_srcline(start_line); free_srcline(end_line); return scnprintf(hpp->buf, hpp->size, "%*s", block_fmt->width, buf); } static int block_dso_entry(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp, struct hist_entry *he) { struct block_fmt *block_fmt = container_of(fmt, struct block_fmt, fmt); struct map *map = he->ms.map; if (map && map->dso) { return scnprintf(hpp->buf, hpp->size, "%*s", block_fmt->width, map->dso->short_name); } return scnprintf(hpp->buf, hpp->size, "%*s", block_fmt->width, "[unknown]"); } static void init_block_header(struct block_fmt *block_fmt) { struct perf_hpp_fmt *fmt = &block_fmt->fmt; BUG_ON(block_fmt->idx >= PERF_HPP_REPORT__BLOCK_MAX_INDEX); block_fmt->header = block_columns[block_fmt->idx].name; block_fmt->width = block_columns[block_fmt->idx].width; fmt->header = block_column_header; fmt->width = block_column_width; } static void hpp_register(struct block_fmt *block_fmt, int idx, struct perf_hpp_list *hpp_list) { struct perf_hpp_fmt *fmt = &block_fmt->fmt; block_fmt->idx = idx; INIT_LIST_HEAD(&fmt->list); INIT_LIST_HEAD(&fmt->sort_list); switch (idx) { case PERF_HPP_REPORT__BLOCK_TOTAL_CYCLES_PCT: fmt->entry = block_total_cycles_pct_entry; fmt->cmp = block_info__cmp; fmt->sort = block_total_cycles_pct_sort; break; case PERF_HPP_REPORT__BLOCK_LBR_CYCLES: fmt->entry = block_cycles_lbr_entry; break; case PERF_HPP_REPORT__BLOCK_CYCLES_PCT: fmt->entry = block_cycles_pct_entry; break; case PERF_HPP_REPORT__BLOCK_AVG_CYCLES: fmt->entry = block_avg_cycles_entry; break; case PERF_HPP_REPORT__BLOCK_RANGE: fmt->entry = block_range_entry; break; case PERF_HPP_REPORT__BLOCK_DSO: fmt->entry = block_dso_entry; break; default: return; } init_block_header(block_fmt); perf_hpp_list__column_register(hpp_list, fmt); } static void register_block_columns(struct perf_hpp_list *hpp_list, struct block_fmt *block_fmts) { for (int i = 0; i < PERF_HPP_REPORT__BLOCK_MAX_INDEX; i++) hpp_register(&block_fmts[i], i, hpp_list); } static void init_block_hist(struct block_hist *bh, struct block_fmt *block_fmts) { __hists__init(&bh->block_hists, &bh->block_list); perf_hpp_list__init(&bh->block_list); bh->block_list.nr_header_lines = 1; register_block_columns(&bh->block_list, block_fmts); perf_hpp_list__register_sort_field(&bh->block_list, &block_fmts[PERF_HPP_REPORT__BLOCK_TOTAL_CYCLES_PCT].fmt); } static void process_block_report(struct hists *hists, struct block_report *block_report, u64 total_cycles) { struct rb_node *next = rb_first_cached(&hists->entries); struct block_hist *bh = &block_report->hist; struct hist_entry *he; init_block_hist(bh, block_report->fmts); while (next) { he = rb_entry(next, struct hist_entry, rb_node); block_info__process_sym(he, bh, &block_report->cycles, total_cycles); next = rb_next(&he->rb_node); } for (int i = 0; i < PERF_HPP_REPORT__BLOCK_MAX_INDEX; i++) { block_report->fmts[i].total_cycles = total_cycles; block_report->fmts[i].block_cycles = block_report->cycles; } hists__output_resort(&bh->block_hists, NULL); } struct block_report *block_info__create_report(struct evlist *evlist, u64 total_cycles) { struct block_report *block_reports; int nr_hists = evlist->core.nr_entries, i = 0; struct evsel *pos; block_reports = calloc(nr_hists, sizeof(struct block_report)); if (!block_reports) return NULL; evlist__for_each_entry(evlist, pos) { struct hists *hists = evsel__hists(pos); process_block_report(hists, &block_reports[i], total_cycles); i++; } return block_reports; } int report__browse_block_hists(struct block_hist *bh, float min_percent, struct evsel *evsel, struct perf_env *env, struct annotation_options *annotation_opts) { int ret; switch (use_browser) { case 0: symbol_conf.report_individual_block = true; hists__fprintf(&bh->block_hists, true, 0, 0, min_percent, stdout, true); hists__delete_entries(&bh->block_hists); return 0; case 1: symbol_conf.report_individual_block = true; ret = block_hists_tui_browse(bh, evsel, min_percent, env, annotation_opts); hists__delete_entries(&bh->block_hists); return ret; default: return -1; } return 0; } float block_info__total_cycles_percent(struct hist_entry *he) { struct block_info *bi = he->block_info; if (bi->total_cycles) return bi->cycles * 100.0 / bi->total_cycles; return 0.0; }
1.320313
1
Pods/PINRemoteImage/Pod/Classes/PINDataTaskOperation.h
Valpertui/mealtingpot-ios
15
7997323
// // PINDataTaskOperation.h // Pods // // Created by <NAME> on 3/12/15. // // @import Foundation; #import "PINURLSessionManager.h" @interface PINDataTaskOperation : NSOperation @property (nonatomic, readonly) NSURLSessionDataTask *dataTask; + (instancetype)dataTaskOperationWithSessionManager:(PINURLSessionManager *)sessionManager request:(NSURLRequest *)request completionHandler:(void (^)(NSURLResponse *response, NSError *error))completionHandler; @end
0.283203
0
project/OFEC_sc2/instance/problem/continuous/multi_modal/CEC2015/F15_composition2015_C7.h
BaiChunhui-9803/bch_sc2_OFEC
0
7997331
//Register CEC2015_MMOP_F15 "MMOP_CEC2015_F15" MMOP,ConOP,SOP /************************************************************************* * Project:Open Frameworks for Evolutionary Computation (OFEC) ************************************************************************* * Author: <NAME> and <NAME> * Email: <EMAIL>, <EMAIL> * Language: C++ ************************************************************************* * This file is part of OFEC. This library 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 2, or (at your option) any later version. ****************************************************************************************** * Paper: Problem Definitions and Evaluation Criteria for the CEC 2015 * Competition on Single Objective Multi-Niche Optimization. *******************************************************************************************/ #ifndef OFEC_CEC2015_F15_COMPOSITION7_H #define OFEC_CEC2015_F15_COMPOSITION7_H #include "../../expensive/CEC2015/composition_2015.h" namespace OFEC { namespace CEC2015 { class F15_composition2015_C7 final : public composition_2015 { public: F15_composition2015_C7(const ParamMap &v); F15_composition2015_C7(const std::string &name, size_t size_var, size_t size_obj); Real pre_opt_distance(); void initialize(); protected: void evaluateObjective(Real *x, std::vector<Real>& obj) override; void setFunction(); void rotate(size_t num, Real *x); void scale(size_t num, Real *x); bool loadTranslation(const std::string &path); void setTranslation(); void set_weight(std::vector<Real>& weight, const std::vector<Real>&x); private: Real m_pre_opt_distance; }; } using CEC2015_MMOP_F15 = CEC2015::F15_composition2015_C7; } #endif // !OFEC_CEC2015_F15_COMPOSITION7_H
0.902344
1
src/UMEImageCache.h
nagyistoce/umekit
1
7997339
// // UMEImageCache.h // UMEKit // // Created by <NAME> on 6/27/10. // Copyright 2010 <NAME>. All rights reserved. // #import <Cocoa/Cocoa.h> extern NSImage *UMEImageNamed(NSString *name); #define UMEIMG(name) UMEImageNamed((name))
0.24707
0
pyxelen.c
Steven-Wilson/pyxelen
0
7997347
/* Generated by Cython 0.28.1 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [ "include\\SDL.h", "include\\SDL_image.h", "include\\SDL_mixer.h" ], "include_dirs": [ "include" ], "libraries": [ "SDL2", "SDL2_mixer", "SDL2_image" ], "library_dirs": [ "lib\\x64" ], "name": "pyxelen", "sources": [ "pyxelen.pyx" ] }, "module_name": "pyxelen" } END: Cython Metadata */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else #define CYTHON_ABI "0_28_1" #define CYTHON_FUTURE_DIVISION 0 #include <stddef.h> #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x02070000 #define HAVE_LONG_LONG #endif #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #ifndef Py_HUGE_VAL #define Py_HUGE_VAL HUGE_VAL #endif #ifdef PYPY_VERSION #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000) #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR # if defined(__cplusplus) template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } # else # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; #endif #endif #else #include <stdint.h> #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) && __cplusplus >= 201103L #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #elif __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__ ) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyClass_Type #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_FAST_PYCCALL #define __Pyx_PyFastCFunction_Check(func)\ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))))) #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_PYSTON #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; // PyThread_create_key reports success always } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif // TSS (Thread Specific Storage) API #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) #else #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) #endif #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #define __Pyx_PyUnicode_READY(op) (0) #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) #else #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) #endif #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) #else #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #else #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyNumber_Int PyNumber_Long #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #endif #if PY_VERSION_HEX < 0x030200A4 typedef long Py_hash_t; #define __Pyx_PyInt_FromHash_t PyInt_FromLong #define __Pyx_PyInt_AsHash_t PyInt_AsLong #else #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include <math.h> #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { \ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ } #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__pyxelen #define __PYX_HAVE_API__pyxelen /* Early includes */ #include <stdint.h> #include <math.h> #include "SDL.h" #include "SDL_image.h" #include "SDL_mixer.h" #ifdef _OPENMP #include <omp.h> #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) #if defined (__cplusplus) && __cplusplus >= 201103L #include <cstdlib> #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #if PY_MAJOR_VERSION < 3 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #else #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize #endif #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { const Py_UNICODE *u_end = u; while (*u_end++) ; return (size_t)(u_end - u - 1); } #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_ASSUME_SAFE_MACROS #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #else #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) #endif #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII static int __Pyx_sys_getdefaultencoding_not_ascii; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; PyObject* ascii_chars_u = NULL; PyObject* ascii_chars_b = NULL; const char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; if (strcmp(default_encoding_c, "ascii") == 0) { __Pyx_sys_getdefaultencoding_not_ascii = 0; } else { char ascii_chars[128]; int c; for (c = 0; c < 128; c++) { ascii_chars[c] = c; } __Pyx_sys_getdefaultencoding_not_ascii = 1; ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); if (!ascii_chars_u) goto bad; ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { PyErr_Format( PyExc_ValueError, "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", default_encoding_c); goto bad; } Py_DECREF(ascii_chars_u); Py_DECREF(ascii_chars_b); } Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); Py_XDECREF(ascii_chars_u); Py_XDECREF(ascii_chars_b); return -1; } #endif #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) #else #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT static char* __PYX_DEFAULT_STRING_ENCODING; static int __Pyx_init_sys_getdefaultencoding_params(void) { PyObject* sys; PyObject* default_encoding = NULL; char* default_encoding_c; sys = PyImport_ImportModule("sys"); if (!sys) goto bad; default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); Py_DECREF(sys); if (!default_encoding) goto bad; default_encoding_c = PyBytes_AsString(default_encoding); if (!default_encoding_c) goto bad; __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); Py_DECREF(default_encoding); return 0; bad: Py_XDECREF(default_encoding); return -1; } #endif #endif /* Test for GCC > 2.95 */ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* !__GNUC__ or GCC < 2.95 */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_cython_runtime; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "pyxelen.pyx", "stringsource", }; /*--- Type declarations ---*/ struct __pyx_obj_7pyxelen_Effect; struct __pyx_obj_7pyxelen_Music; struct __pyx_obj_7pyxelen_Window; struct __pyx_obj_7pyxelen_Surface; struct __pyx_obj_7pyxelen_Texture; struct __pyx_obj_7pyxelen_Renderer; /* "pyxelen.pyx":884 * * * cdef class Effect: # <<<<<<<<<<<<<< * * cdef Mix_Chunk *chunk */ struct __pyx_obj_7pyxelen_Effect { PyObject_HEAD Mix_Chunk *chunk; }; /* "pyxelen.pyx":892 * * * cdef class Music: # <<<<<<<<<<<<<< * * cdef Mix_Music *music */ struct __pyx_obj_7pyxelen_Music { PyObject_HEAD Mix_Music *music; }; /* "pyxelen.pyx":1004 * * * cdef class Window: # <<<<<<<<<<<<<< * * cdef SDL_Window *window */ struct __pyx_obj_7pyxelen_Window { PyObject_HEAD struct SDL_Window *window; }; /* "pyxelen.pyx":1031 * * * cdef class Surface: # <<<<<<<<<<<<<< * * cdef SDL_Surface *surface */ struct __pyx_obj_7pyxelen_Surface { PyObject_HEAD struct SDL_Surface *surface; }; /* "pyxelen.pyx":1039 * * * cdef class Texture: # <<<<<<<<<<<<<< * * cdef SDL_Texture *texture */ struct __pyx_obj_7pyxelen_Texture { PyObject_HEAD struct SDL_Texture *texture; }; /* "pyxelen.pyx":1056 * * * cdef class Renderer: # <<<<<<<<<<<<<< * * cdef SDL_Renderer *renderer */ struct __pyx_obj_7pyxelen_Renderer { PyObject_HEAD struct SDL_Renderer *renderer; }; /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; #ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ PyGILState_Release(__pyx_gilstate_save);\ } else {\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ } #else #define __Pyx_RefNannySetupContext(name, acquire_gil)\ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #endif #define __Pyx_RefNannyFinishContext()\ __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) #else #define __Pyx_RefNannyDeclarations #define __Pyx_RefNannySetupContext(name, acquire_gil) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XINCREF(r) Py_XINCREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #define __Pyx_XGOTREF(r) #define __Pyx_XGIVEREF(r) #endif #define __Pyx_XDECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_XDECREF(tmp);\ } while (0) #define __Pyx_DECREF_SET(r, v) do {\ PyObject *tmp = (PyObject *) r;\ r = v; __Pyx_DECREF(tmp);\ } while (0) #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value); #else #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n) #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); #else #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* UnpackUnboundCMethod.proto */ typedef struct { PyObject *type; PyObject **method_name; PyCFunction func; PyObject *method; int flag; } __Pyx_CachedCFunction; /* CallUnboundCMethod1.proto */ static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #else #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) #endif /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* GetModuleGlobalName.proto */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); PyList_SET_ITEM(list, len, x); Py_SIZE(list) = len+1; return 0; } return PyList_Append(list, x); } #else #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) #endif /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg); /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); /* GetItemInt.proto */ #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\ __Pyx_GetItemInt_Generic(o, to_py_func(i)))) #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int wraparound, int boundscheck); static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, int wraparound, int boundscheck); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* HasAttr.proto */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* IncludeStringH.proto */ #include <string.h> /* decode_c_string_utf16.proto */ static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 0; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = -1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) { int byteorder = 1; return PyUnicode_DecodeUTF16(s, size, errors, &byteorder); } /* decode_c_string.proto */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ static int __Pyx_setup_reduce(PyObject* type_obj); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* CalculateMetaclass.proto */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); /* SetNameInClass.proto */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value)) #elif CYTHON_COMPILING_IN_CPYTHON #define __Pyx_SetNameInClass(ns, name, value)\ (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value)) #else #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value) #endif /* Py3ClassCreate.proto */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc); static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); /* CythonFunction.proto */ #define __Pyx_CyFunction_USED 1 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 #define __Pyx_CYFUNCTION_CCLASS 0x04 #define __Pyx_CyFunction_GetClosure(f)\ (((__pyx_CyFunctionObject *) (f))->func_closure) #define __Pyx_CyFunction_GetClassObj(f)\ (((__pyx_CyFunctionObject *) (f))->func_classobj) #define __Pyx_CyFunction_Defaults(type, f)\ ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\ ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) typedef struct { PyCFunctionObject func; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\ __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *self, PyObject *module, PyObject *globals, PyObject* code); static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, size_t size, int pyobjects); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, PyObject *tuple); static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, PyObject *dict); static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, PyObject *dict); static int __pyx_CyFunction_init(void); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; }; static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); static PyCodeObject *__pyx_find_code_object(int code_line); static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* Print.proto */ static int __Pyx_Print(PyObject*, PyObject *, int); #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 static PyObject* __pyx_print = 0; static PyObject* __pyx_print_kwargs = 0; #endif /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); /* PrintOne.proto */ static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.stdint' */ /* Module declarations from 'libc.math' */ /* Module declarations from 'pyxelen' */ static PyTypeObject *__pyx_ptype_7pyxelen_Effect = 0; static PyTypeObject *__pyx_ptype_7pyxelen_Music = 0; static PyTypeObject *__pyx_ptype_7pyxelen_Window = 0; static PyTypeObject *__pyx_ptype_7pyxelen_Surface = 0; static PyTypeObject *__pyx_ptype_7pyxelen_Texture = 0; static PyTypeObject *__pyx_ptype_7pyxelen_Renderer = 0; #define __Pyx_MODULE_NAME "pyxelen" extern int __pyx_module_is_main_pyxelen; int __pyx_module_is_main_pyxelen = 0; /* Implementation of 'pyxelen' */ static PyObject *__pyx_builtin_property; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_RuntimeError; static PyObject *__pyx_builtin_NotImplemented; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_IndexError; static const char __pyx_k_A[] = "A"; static const char __pyx_k_B[] = "B"; static const char __pyx_k_C[] = "C"; static const char __pyx_k_D[] = "D"; static const char __pyx_k_E[] = "E"; static const char __pyx_k_F[] = "F"; static const char __pyx_k_G[] = "G"; static const char __pyx_k_H[] = "H"; static const char __pyx_k_I[] = "I"; static const char __pyx_k_J[] = "J"; static const char __pyx_k_K[] = "K"; static const char __pyx_k_L[] = "L"; static const char __pyx_k_M[] = "M"; static const char __pyx_k_N[] = "N"; static const char __pyx_k_O[] = "O"; static const char __pyx_k_P[] = "P"; static const char __pyx_k_Q[] = "Q"; static const char __pyx_k_R[] = "R"; static const char __pyx_k_S[] = "S"; static const char __pyx_k_T[] = "T"; static const char __pyx_k_U[] = "U"; static const char __pyx_k_V[] = "V"; static const char __pyx_k_W[] = "W"; static const char __pyx_k_X[] = "X"; static const char __pyx_k_Y[] = "Y"; static const char __pyx_k_Z[] = "Z"; static const char __pyx_k_c[] = "c"; static const char __pyx_k_h[] = "h"; static const char __pyx_k_i[] = "i"; static const char __pyx_k_w[] = "w"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_y[] = "y"; static const char __pyx_k_AT[] = "AT"; static const char __pyx_k_F1[] = "F1"; static const char __pyx_k_F2[] = "F2"; static const char __pyx_k_F3[] = "F3"; static const char __pyx_k_F4[] = "F4"; static const char __pyx_k_F5[] = "F5"; static const char __pyx_k_F6[] = "F6"; static const char __pyx_k_F7[] = "F7"; static const char __pyx_k_F8[] = "F8"; static const char __pyx_k_F9[] = "F9"; static const char __pyx_k_K0[] = "K0"; static const char __pyx_k_K1[] = "K1"; static const char __pyx_k_K2[] = "K2"; static const char __pyx_k_K3[] = "K3"; static const char __pyx_k_K4[] = "K4"; static const char __pyx_k_K5[] = "K5"; static const char __pyx_k_K6[] = "K6"; static const char __pyx_k_K7[] = "K7"; static const char __pyx_k_K8[] = "K8"; static const char __pyx_k_K9[] = "K9"; static const char __pyx_k_UP[] = "UP"; static const char __pyx_k_X1[] = "X1"; static const char __pyx_k_X2[] = "X2"; static const char __pyx_k_CUT[] = "CUT"; static const char __pyx_k_END[] = "END"; static const char __pyx_k_F10[] = "F10"; static const char __pyx_k_F11[] = "F11"; static const char __pyx_k_F12[] = "F12"; static const char __pyx_k_F13[] = "F13"; static const char __pyx_k_F14[] = "F14"; static const char __pyx_k_F15[] = "F15"; static const char __pyx_k_F16[] = "F16"; static const char __pyx_k_F17[] = "F17"; static const char __pyx_k_F18[] = "F18"; static const char __pyx_k_F19[] = "F19"; static const char __pyx_k_F20[] = "F20"; static const char __pyx_k_F21[] = "F21"; static const char __pyx_k_F22[] = "F22"; static const char __pyx_k_F23[] = "F23"; static const char __pyx_k_F24[] = "F24"; static const char __pyx_k_Key[] = "Key"; static const char __pyx_k_OUT[] = "OUT"; static const char __pyx_k_TAB[] = "TAB"; static const char __pyx_k_WWW[] = "WWW"; static const char __pyx_k__44[] = "_"; static const char __pyx_k_alt[] = "alt"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_end[] = "end"; static const char __pyx_k_fps[] = "fps"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_mod[] = "mod"; static const char __pyx_k_run[] = "run"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_APP1[] = "APP1"; static const char __pyx_k_APP2[] = "APP2"; static const char __pyx_k_COPY[] = "COPY"; static const char __pyx_k_DOWN[] = "DOWN"; static const char __pyx_k_FIND[] = "FIND"; static const char __pyx_k_HASH[] = "HASH"; static const char __pyx_k_HELP[] = "HELP"; static const char __pyx_k_HOME[] = "HOME"; static const char __pyx_k_KP_0[] = "KP_0"; static const char __pyx_k_KP_1[] = "KP_1"; static const char __pyx_k_KP_2[] = "KP_2"; static const char __pyx_k_KP_3[] = "KP_3"; static const char __pyx_k_KP_4[] = "KP_4"; static const char __pyx_k_KP_5[] = "KP_5"; static const char __pyx_k_KP_6[] = "KP_6"; static const char __pyx_k_KP_7[] = "KP_7"; static const char __pyx_k_KP_8[] = "KP_8"; static const char __pyx_k_KP_9[] = "KP_9"; static const char __pyx_k_KP_A[] = "KP_A"; static const char __pyx_k_KP_B[] = "KP_B"; static const char __pyx_k_KP_C[] = "KP_C"; static const char __pyx_k_KP_D[] = "KP_D"; static const char __pyx_k_KP_E[] = "KP_E"; static const char __pyx_k_KP_F[] = "KP_F"; static const char __pyx_k_LALT[] = "LALT"; static const char __pyx_k_LEFT[] = "LEFT"; static const char __pyx_k_LESS[] = "LESS"; static const char __pyx_k_LGUI[] = "LGUI"; static const char __pyx_k_MAIL[] = "MAIL"; static const char __pyx_k_MENU[] = "MENU"; static const char __pyx_k_MODE[] = "MODE"; static const char __pyx_k_MUTE[] = "MUTE"; static const char __pyx_k_OPER[] = "OPER"; static const char __pyx_k_PLUS[] = "PLUS"; static const char __pyx_k_RALT[] = "RALT"; static const char __pyx_k_RGUI[] = "RGUI"; static const char __pyx_k_STOP[] = "STOP"; static const char __pyx_k_UNDO[] = "UNDO"; static const char __pyx_k_ctrl[] = "ctrl"; static const char __pyx_k_enum[] = "enum"; static const char __pyx_k_file[] = "file"; static const char __pyx_k_init[] = "__init__"; static const char __pyx_k_left[] = "left"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_mods[] = "mods"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_quit[] = "quit"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_AGAIN[] = "AGAIN"; static const char __pyx_k_Audio[] = "Audio"; static const char __pyx_k_CARET[] = "CARET"; static const char __pyx_k_CLEAR[] = "CLEAR"; static const char __pyx_k_COLON[] = "COLON"; static const char __pyx_k_COMMA[] = "COMMA"; static const char __pyx_k_CRSEL[] = "CRSEL"; static const char __pyx_k_EJECT[] = "EJECT"; static const char __pyx_k_EXSEL[] = "EXSEL"; static const char __pyx_k_KP_00[] = "KP_00"; static const char __pyx_k_KP_AT[] = "KP_AT"; static const char __pyx_k_LCTRL[] = "LCTRL"; static const char __pyx_k_MINUS[] = "MINUS"; static const char __pyx_k_Mouse[] = "Mouse"; static const char __pyx_k_PASTE[] = "PASTE"; static const char __pyx_k_PAUSE[] = "PAUSE"; static const char __pyx_k_POWER[] = "POWER"; static const char __pyx_k_PRIOR[] = "PRIOR"; static const char __pyx_k_QUOTE[] = "QUOTE"; static const char __pyx_k_RCTRL[] = "RCTRL"; static const char __pyx_k_RIGHT[] = "RIGHT"; static const char __pyx_k_SLASH[] = "SLASH"; static const char __pyx_k_SLEEP[] = "SLEEP"; static const char __pyx_k_SPACE[] = "SPACE"; static const char __pyx_k_START[] = "START"; static const char __pyx_k_audio[] = "audio"; static const char __pyx_k_dst_h[] = "dst_h"; static const char __pyx_k_dst_w[] = "dst_w"; static const char __pyx_k_dst_x[] = "dst_x"; static const char __pyx_k_dst_y[] = "dst_y"; static const char __pyx_k_event[] = "event"; static const char __pyx_k_mouse[] = "mouse"; static const char __pyx_k_music[] = "music"; static const char __pyx_k_print[] = "print"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_right[] = "right"; static const char __pyx_k_shift[] = "shift"; static const char __pyx_k_src_h[] = "src_h"; static const char __pyx_k_src_w[] = "src_w"; static const char __pyx_k_src_x[] = "src_x"; static const char __pyx_k_src_y[] = "src_y"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_title[] = "title"; static const char __pyx_k_utf_8[] = "utf-8"; static const char __pyx_k_width[] = "width"; static const char __pyx_k_CANCEL[] = "CANCEL"; static const char __pyx_k_DELETE[] = "DELETE"; static const char __pyx_k_DOLLAR[] = "DOLLAR"; static const char __pyx_k_EQUALS[] = "EQUALS"; static const char __pyx_k_ESCAPE[] = "ESCAPE"; static const char __pyx_k_INSERT[] = "INSERT"; static const char __pyx_k_KP_000[] = "KP_000"; static const char __pyx_k_KP_TAB[] = "KP_TAB"; static const char __pyx_k_KP_XOR[] = "KP_XOR"; static const char __pyx_k_LSHIFT[] = "LSHIFT"; static const char __pyx_k_MIDDLE[] = "MIDDLE"; static const char __pyx_k_PAGEUP[] = "PAGEUP"; static const char __pyx_k_PERIOD[] = "PERIOD"; static const char __pyx_k_RETURN[] = "RETURN"; static const char __pyx_k_RSHIFT[] = "RSHIFT"; static const char __pyx_k_SELECT[] = "SELECT"; static const char __pyx_k_SYSREQ[] = "SYSREQ"; static const char __pyx_k_append[] = "append"; static const char __pyx_k_button[] = "button"; static const char __pyx_k_effect[] = "effect"; static const char __pyx_k_encode[] = "encode"; static const char __pyx_k_height[] = "height"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_init_2[] = "init"; static const char __pyx_k_middle[] = "middle"; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_result[] = "result"; static const char __pyx_k_volume[] = "volume"; static const char __pyx_k_window[] = "window"; static const char __pyx_k_AC_BACK[] = "AC_BACK"; static const char __pyx_k_AC_HOME[] = "AC_HOME"; static const char __pyx_k_AC_STOP[] = "AC_STOP"; static const char __pyx_k_EXCLAIM[] = "EXCLAIM"; static const char __pyx_k_EXECUTE[] = "EXECUTE"; static const char __pyx_k_GREATER[] = "GREATER"; static const char __pyx_k_IntEnum[] = "IntEnum"; static const char __pyx_k_KP_HASH[] = "KP_HASH"; static const char __pyx_k_KP_LESS[] = "KP_LESS"; static const char __pyx_k_KP_PLUS[] = "KP_PLUS"; static const char __pyx_k_PERCENT[] = "PERCENT"; static const char __pyx_k_Pyxelen[] = "Pyxelen"; static const char __pyx_k_RETURN2[] = "RETURN2"; static const char __pyx_k_UNKNOWN[] = "UNKNOWN"; static const char __pyx_k_button4[] = "button4"; static const char __pyx_k_button5[] = "button5"; static const char __pyx_k_on_quit[] = "on_quit"; static const char __pyx_k_prepare[] = "__prepare__"; static const char __pyx_k_pyxelen[] = "pyxelen"; static const char __pyx_k_texture[] = "texture"; static const char __pyx_k_windows[] = "_windows"; static const char __pyx_k_ALTERASE[] = "ALTERASE"; static const char __pyx_k_ASTERISK[] = "ASTERISK"; static const char __pyx_k_CAPSLOCK[] = "CAPSLOCK"; static const char __pyx_k_COMPUTER[] = "COMPUTER"; static const char __pyx_k_Controls[] = "Controls"; static const char __pyx_k_KP_CLEAR[] = "KP_CLEAR"; static const char __pyx_k_KP_COLON[] = "KP_COLON"; static const char __pyx_k_KP_COMMA[] = "KP_COMMA"; static const char __pyx_k_KP_ENTER[] = "KP_ENTER"; static const char __pyx_k_KP_MINUS[] = "KP_MINUS"; static const char __pyx_k_KP_OCTAL[] = "KP_OCTAL"; static const char __pyx_k_KP_POWER[] = "KP_POWER"; static const char __pyx_k_KP_SPACE[] = "KP_SPACE"; static const char __pyx_k_PAGEDOWN[] = "PAGEDOWN"; static const char __pyx_k_QUESTION[] = "QUESTION"; static const char __pyx_k_QUOTEDBL[] = "QUOTEDBL"; static const char __pyx_k_VOLUMEUP[] = "VOLUMEUP"; static const char __pyx_k_controls[] = "controls"; static const char __pyx_k_filename[] = "filename"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_instance[] = "instance"; static const char __pyx_k_property[] = "property"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_AC_SEARCH[] = "AC_SEARCH"; static const char __pyx_k_AMPERSAND[] = "AMPERSAND"; static const char __pyx_k_AUDIOMUTE[] = "AUDIOMUTE"; static const char __pyx_k_AUDIONEXT[] = "AUDIONEXT"; static const char __pyx_k_AUDIOPLAY[] = "AUDIOPLAY"; static const char __pyx_k_AUDIOPREV[] = "AUDIOPREV"; static const char __pyx_k_AUDIOSTOP[] = "AUDIOSTOP"; static const char __pyx_k_BACKQUOTE[] = "BACKQUOTE"; static const char __pyx_k_BACKSLASH[] = "BACKSLASH"; static const char __pyx_k_BACKSPACE[] = "BACKSPACE"; static const char __pyx_k_KP_BINARY[] = "KP_BINARY"; static const char __pyx_k_KP_DIVIDE[] = "KP_DIVIDE"; static const char __pyx_k_KP_EQUALS[] = "KP_EQUALS"; static const char __pyx_k_KP_EXCLAM[] = "KP_EXCLAM"; static const char __pyx_k_KP_MEMADD[] = "KP_MEMADD"; static const char __pyx_k_KP_PERIOD[] = "KP_PERIOD"; static const char __pyx_k_LEFTPAREN[] = "LEFTPAREN"; static const char __pyx_k_SEMICOLON[] = "SEMICOLON"; static const char __pyx_k_SEPARATOR[] = "SEPARATOR"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_get_error[] = "get_error"; static const char __pyx_k_importlib[] = "importlib"; static const char __pyx_k_metaclass[] = "__metaclass__"; static const char __pyx_k_on_key_up[] = "on_key_up"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_window_id[] = "window_id"; static const char __pyx_k_AC_FORWARD[] = "AC_FORWARD"; static const char __pyx_k_AC_REFRESH[] = "AC_REFRESH"; static const char __pyx_k_CALCULATOR[] = "CALCULATOR"; static const char __pyx_k_CLEARAGAIN[] = "CLEARAGAIN"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_KBDILLUMUP[] = "KBDILLUMUP"; static const char __pyx_k_KP_DECIMAL[] = "KP_DECIMAL"; static const char __pyx_k_KP_GREATER[] = "KP_GREATER"; static const char __pyx_k_KP_PERCENT[] = "KP_PERCENT"; static const char __pyx_k_LEFT_STICK[] = "LEFT_STICK"; static const char __pyx_k_RIGHTPAREN[] = "RIGHTPAREN"; static const char __pyx_k_SCROLLLOCK[] = "SCROLLLOCK"; static const char __pyx_k_UNDERSCORE[] = "UNDERSCORE"; static const char __pyx_k_VOLUMEDOWN[] = "VOLUMEDOWN"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_controller[] = "controller"; static const char __pyx_k_load_music[] = "load_music"; static const char __pyx_k_play_music[] = "play_music"; static const char __pyx_k_stop_music[] = "stop_music"; static const char __pyx_k_APPLICATION[] = "APPLICATION"; static const char __pyx_k_AUDIOREWIND[] = "AUDIOREWIND"; static const char __pyx_k_KP_MEMCLEAR[] = "KP_MEMCLEAR"; static const char __pyx_k_KP_MEMSTORE[] = "KP_MEMSTORE"; static const char __pyx_k_KP_MULTIPLY[] = "KP_MULTIPLY"; static const char __pyx_k_LEFTBRACKET[] = "LEFTBRACKET"; static const char __pyx_k_MEDIASELECT[] = "MEDIASELECT"; static const char __pyx_k_MouseButton[] = "MouseButton"; static const char __pyx_k_PRINTSCREEN[] = "PRINTSCREEN"; static const char __pyx_k_Pyxelen_run[] = "Pyxelen.run"; static const char __pyx_k_RIGHT_STICK[] = "RIGHT_STICK"; static const char __pyx_k_controllers[] = "_controllers"; static const char __pyx_k_find_window[] = "_find_window"; static const char __pyx_k_load_effect[] = "load_effect"; static const char __pyx_k_on_key_down[] = "on_key_down"; static const char __pyx_k_open_window[] = "open_window"; static const char __pyx_k_play_effect[] = "play_effect"; static const char __pyx_k_pyxelen_pyx[] = "pyxelen.pyx"; static const char __pyx_k_AC_BOOKMARKS[] = "AC_BOOKMARKS"; static const char __pyx_k_Audio___init[] = "Audio.__init__"; static const char __pyx_k_BRIGHTNESSUP[] = "BRIGHTNESSUP"; static const char __pyx_k_CURRENCYUNIT[] = "CURRENCYUNIT"; static const char __pyx_k_KBDILLUMDOWN[] = "KBDILLUMDOWN"; static const char __pyx_k_KP_AMPERSAND[] = "KP_AMPERSAND"; static const char __pyx_k_KP_BACKSPACE[] = "KP_BACKSPACE"; static const char __pyx_k_KP_LEFTBRACE[] = "KP_LEFTBRACE"; static const char __pyx_k_KP_LEFTPAREN[] = "KP_LEFTPAREN"; static const char __pyx_k_KP_MEMDIVIDE[] = "KP_MEMDIVIDE"; static const char __pyx_k_KP_MEMRECALL[] = "KP_MEMRECALL"; static const char __pyx_k_KP_PLUSMINUS[] = "KP_PLUSMINUS"; static const char __pyx_k_KeyModifiers[] = "KeyModifiers"; static const char __pyx_k_Mouse___init[] = "Mouse.__init__"; static const char __pyx_k_NUMLOCKCLEAR[] = "NUMLOCKCLEAR"; static const char __pyx_k_RIGHTBRACKET[] = "RIGHTBRACKET"; static const char __pyx_k_RuntimeError[] = "RuntimeError"; static const char __pyx_k_close_window[] = "close_window"; static const char __pyx_k_window_event[] = "window_event"; static const char __pyx_k_DISPLAYSWITCH[] = "DISPLAYSWITCH"; static const char __pyx_k_KP_CLEARENTRY[] = "KP_CLEARENTRY"; static const char __pyx_k_KP_RIGHTBRACE[] = "KP_RIGHTBRACE"; static const char __pyx_k_KP_RIGHTPAREN[] = "KP_RIGHTPAREN"; static const char __pyx_k_LEFT_SHOULDER[] = "LEFT_SHOULDER"; static const char __pyx_k_controllers_2[] = "controllers"; static const char __pyx_k_current_ticks[] = "current_ticks"; static const char __pyx_k_event_handler[] = "event_handler"; static const char __pyx_k_key_modifiers[] = "key_modifiers"; static const char __pyx_k_music_playing[] = "music_playing"; static const char __pyx_k_on_text_input[] = "on_text_input"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_BRIGHTNESSDOWN[] = "BRIGHTNESSDOWN"; static const char __pyx_k_Controls_mouse[] = "Controls.mouse"; static const char __pyx_k_KBDILLUMTOGGLE[] = "KBDILLUMTOGGLE"; static const char __pyx_k_KP_EQUALSAS400[] = "KP_EQUALSAS400"; static const char __pyx_k_KP_HEXADECIMAL[] = "KP_HEXADECIMAL"; static const char __pyx_k_KP_MEMMULTIPLY[] = "KP_MEMMULTIPLY"; static const char __pyx_k_KP_MEMSUBTRACT[] = "KP_MEMSUBTRACT"; static const char __pyx_k_KP_VERTICALBAR[] = "KP_VERTICALBAR"; static const char __pyx_k_NotImplemented[] = "NotImplemented"; static const char __pyx_k_Pyxelen___init[] = "Pyxelen.__init__"; static const char __pyx_k_RIGHT_SHOULDER[] = "RIGHT_SHOULDER"; static const char __pyx_k_add_controller[] = "add_controller"; static const char __pyx_k_on_mouse_wheel[] = "on_mouse_wheel"; static const char __pyx_k_CURRENCYSUBUNIT[] = "CURRENCYSUBUNIT"; static const char __pyx_k_Controls___init[] = "Controls.__init__"; static const char __pyx_k_KP_DBLAMPERSAND[] = "KP_DBLAMPERSAND"; static const char __pyx_k_find_controller[] = "find_controller"; static const char __pyx_k_on_mouse_motion[] = "on_mouse_motion"; static const char __pyx_k_on_window_close[] = "on_window_close"; static const char __pyx_k_on_window_enter[] = "on_window_enter"; static const char __pyx_k_on_window_leave[] = "on_window_leave"; static const char __pyx_k_on_window_moved[] = "on_window_moved"; static const char __pyx_k_on_window_shown[] = "on_window_shown"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_ticks_per_frame[] = "ticks_per_frame"; static const char __pyx_k_AUDIOFASTFORWARD[] = "AUDIOFASTFORWARD"; static const char __pyx_k_Audio_load_music[] = "Audio.load_music"; static const char __pyx_k_Audio_play_music[] = "Audio.play_music"; static const char __pyx_k_Audio_stop_music[] = "Audio.stop_music"; static const char __pyx_k_ControllerButton[] = "ControllerButton"; static const char __pyx_k_DECIMALSEPARATOR[] = "DECIMALSEPARATOR"; static const char __pyx_k_Device_not_found[] = "Device not found"; static const char __pyx_k_HAT_TO_DIRECTION[] = "HAT_TO_DIRECTION"; static const char __pyx_k_last_frame_ticks[] = "last_frame_ticks"; static const char __pyx_k_on_window_hidden[] = "on_window_hidden"; static const char __pyx_k_set_music_volume[] = "set_music_volume"; static const char __pyx_k_Audio_load_effect[] = "Audio.load_effect"; static const char __pyx_k_Audio_play_effect[] = "Audio.play_effect"; static const char __pyx_k_KP_DBLVERTICALBAR[] = "KP_DBLVERTICALBAR"; static const char __pyx_k_on_window_exposed[] = "on_window_exposed"; static const char __pyx_k_remove_controller[] = "remove_controller"; static const char __pyx_k_THOUSANDSSEPARATOR[] = "THOUSANDSSEPARATOR"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_on_controller_dpad[] = "on_controller_dpad"; static const char __pyx_k_on_mouse_button_up[] = "on_mouse_button_up"; static const char __pyx_k_on_window_restored[] = "on_window_restored"; static const char __pyx_k_KeyModifiers___init[] = "KeyModifiers.__init__"; static const char __pyx_k_Pyxelen_open_window[] = "Pyxelen.open_window"; static const char __pyx_k_on_window_maximized[] = "on_window_maximized"; static const char __pyx_k_on_window_minimized[] = "on_window_minimized"; static const char __pyx_k_Pyxelen__find_window[] = "Pyxelen._find_window"; static const char __pyx_k_Pyxelen_close_window[] = "Pyxelen.close_window"; static const char __pyx_k_fps_must_be_positive[] = "fps must be positive"; static const char __pyx_k_on_mouse_button_down[] = "on_mouse_button_down"; static const char __pyx_k_on_update_and_render[] = "on_update_and_render"; static const char __pyx_k_on_window_focus_lost[] = "on_window_focus_lost"; static const char __pyx_k_on_audio_device_added[] = "on_audio_device_added"; static const char __pyx_k_Audio_set_music_volume[] = "Audio.set_music_volume"; static const char __pyx_k_Controls_key_modifiers[] = "Controls.key_modifiers"; static const char __pyx_k_on_window_focus_gained[] = "on_window_focus_gained"; static const char __pyx_k_on_window_size_changed[] = "on_window_size_changed"; static const char __pyx_k_Controls_add_controller[] = "Controls.add_controller"; static const char __pyx_k_on_audio_device_removed[] = "on_audio_device_removed"; static const char __pyx_k_on_controller_button_up[] = "on_controller_button_up"; static const char __pyx_k_on_render_targets_reset[] = "on_render_targets_reset"; static const char __pyx_k_Controls_find_controller[] = "Controls.find_controller"; static const char __pyx_k_NOTIFICATION_unknown_key[] = "NOTIFICATION: unknown key:"; static const char __pyx_k_on_controller_button_down[] = "on_controller_button_down"; static const char __pyx_k_Controls_remove_controller[] = "Controls.remove_controller"; static const char __pyx_k_on_controller_device_added[] = "on_controller_device_added"; static const char __pyx_k_Cannot_add_a_17th_controller[] = "Cannot add a 17th controller"; static const char __pyx_k_on_controller_device_removed[] = "on_controller_device_removed"; static const char __pyx_k_NOTIFICATION_unknown_controller[] = "NOTIFICATION: unknown controller button:"; static const char __pyx_k_self_window_cannot_be_converted[] = "self.window cannot be converted to a Python object for pickling"; static const char __pyx_k_NOTIFICATION_unknown_mouse_butto[] = "NOTIFICATION: unknown mouse button:"; static const char __pyx_k_self_chunk_cannot_be_converted_t[] = "self.chunk cannot be converted to a Python object for pickling"; static const char __pyx_k_self_music_cannot_be_converted_t[] = "self.music cannot be converted to a Python object for pickling"; static const char __pyx_k_self_renderer_cannot_be_converte[] = "self.renderer cannot be converted to a Python object for pickling"; static const char __pyx_k_self_surface_cannot_be_converted[] = "self.surface cannot be converted to a Python object for pickling"; static const char __pyx_k_self_texture_cannot_be_converted[] = "self.texture cannot be converted to a Python object for pickling"; static PyObject *__pyx_n_s_A; static PyObject *__pyx_n_s_AC_BACK; static PyObject *__pyx_n_s_AC_BOOKMARKS; static PyObject *__pyx_n_s_AC_FORWARD; static PyObject *__pyx_n_s_AC_HOME; static PyObject *__pyx_n_s_AC_REFRESH; static PyObject *__pyx_n_s_AC_SEARCH; static PyObject *__pyx_n_s_AC_STOP; static PyObject *__pyx_n_s_AGAIN; static PyObject *__pyx_n_s_ALTERASE; static PyObject *__pyx_n_s_AMPERSAND; static PyObject *__pyx_n_s_APP1; static PyObject *__pyx_n_s_APP2; static PyObject *__pyx_n_s_APPLICATION; static PyObject *__pyx_n_s_ASTERISK; static PyObject *__pyx_n_s_AT; static PyObject *__pyx_n_s_AUDIOFASTFORWARD; static PyObject *__pyx_n_s_AUDIOMUTE; static PyObject *__pyx_n_s_AUDIONEXT; static PyObject *__pyx_n_s_AUDIOPLAY; static PyObject *__pyx_n_s_AUDIOPREV; static PyObject *__pyx_n_s_AUDIOREWIND; static PyObject *__pyx_n_s_AUDIOSTOP; static PyObject *__pyx_n_s_Audio; static PyObject *__pyx_n_s_Audio___init; static PyObject *__pyx_n_s_Audio_load_effect; static PyObject *__pyx_n_s_Audio_load_music; static PyObject *__pyx_n_s_Audio_play_effect; static PyObject *__pyx_n_s_Audio_play_music; static PyObject *__pyx_n_s_Audio_set_music_volume; static PyObject *__pyx_n_s_Audio_stop_music; static PyObject *__pyx_n_s_B; static PyObject *__pyx_n_s_BACKQUOTE; static PyObject *__pyx_n_s_BACKSLASH; static PyObject *__pyx_n_s_BACKSPACE; static PyObject *__pyx_n_s_BRIGHTNESSDOWN; static PyObject *__pyx_n_s_BRIGHTNESSUP; static PyObject *__pyx_n_s_C; static PyObject *__pyx_n_s_CALCULATOR; static PyObject *__pyx_n_s_CANCEL; static PyObject *__pyx_n_s_CAPSLOCK; static PyObject *__pyx_n_s_CARET; static PyObject *__pyx_n_s_CLEAR; static PyObject *__pyx_n_s_CLEARAGAIN; static PyObject *__pyx_n_s_COLON; static PyObject *__pyx_n_s_COMMA; static PyObject *__pyx_n_s_COMPUTER; static PyObject *__pyx_n_s_COPY; static PyObject *__pyx_n_s_CRSEL; static PyObject *__pyx_n_s_CURRENCYSUBUNIT; static PyObject *__pyx_n_s_CURRENCYUNIT; static PyObject *__pyx_n_s_CUT; static PyObject *__pyx_kp_s_Cannot_add_a_17th_controller; static PyObject *__pyx_n_s_ControllerButton; static PyObject *__pyx_n_s_Controls; static PyObject *__pyx_n_s_Controls___init; static PyObject *__pyx_n_s_Controls_add_controller; static PyObject *__pyx_n_s_Controls_find_controller; static PyObject *__pyx_n_s_Controls_key_modifiers; static PyObject *__pyx_n_s_Controls_mouse; static PyObject *__pyx_n_s_Controls_remove_controller; static PyObject *__pyx_n_s_D; static PyObject *__pyx_n_s_DECIMALSEPARATOR; static PyObject *__pyx_n_s_DELETE; static PyObject *__pyx_n_s_DISPLAYSWITCH; static PyObject *__pyx_n_s_DOLLAR; static PyObject *__pyx_n_s_DOWN; static PyObject *__pyx_kp_s_Device_not_found; static PyObject *__pyx_n_s_E; static PyObject *__pyx_n_s_EJECT; static PyObject *__pyx_n_s_END; static PyObject *__pyx_n_s_EQUALS; static PyObject *__pyx_n_s_ESCAPE; static PyObject *__pyx_n_s_EXCLAIM; static PyObject *__pyx_n_s_EXECUTE; static PyObject *__pyx_n_s_EXSEL; static PyObject *__pyx_n_s_F; static PyObject *__pyx_n_s_F1; static PyObject *__pyx_n_s_F10; static PyObject *__pyx_n_s_F11; static PyObject *__pyx_n_s_F12; static PyObject *__pyx_n_s_F13; static PyObject *__pyx_n_s_F14; static PyObject *__pyx_n_s_F15; static PyObject *__pyx_n_s_F16; static PyObject *__pyx_n_s_F17; static PyObject *__pyx_n_s_F18; static PyObject *__pyx_n_s_F19; static PyObject *__pyx_n_s_F2; static PyObject *__pyx_n_s_F20; static PyObject *__pyx_n_s_F21; static PyObject *__pyx_n_s_F22; static PyObject *__pyx_n_s_F23; static PyObject *__pyx_n_s_F24; static PyObject *__pyx_n_s_F3; static PyObject *__pyx_n_s_F4; static PyObject *__pyx_n_s_F5; static PyObject *__pyx_n_s_F6; static PyObject *__pyx_n_s_F7; static PyObject *__pyx_n_s_F8; static PyObject *__pyx_n_s_F9; static PyObject *__pyx_n_s_FIND; static PyObject *__pyx_n_s_G; static PyObject *__pyx_n_s_GREATER; static PyObject *__pyx_n_s_H; static PyObject *__pyx_n_s_HASH; static PyObject *__pyx_n_s_HAT_TO_DIRECTION; static PyObject *__pyx_n_s_HELP; static PyObject *__pyx_n_s_HOME; static PyObject *__pyx_n_s_I; static PyObject *__pyx_n_s_INSERT; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_n_s_IntEnum; static PyObject *__pyx_n_s_J; static PyObject *__pyx_n_s_K; static PyObject *__pyx_n_s_K0; static PyObject *__pyx_n_s_K1; static PyObject *__pyx_n_s_K2; static PyObject *__pyx_n_s_K3; static PyObject *__pyx_n_s_K4; static PyObject *__pyx_n_s_K5; static PyObject *__pyx_n_s_K6; static PyObject *__pyx_n_s_K7; static PyObject *__pyx_n_s_K8; static PyObject *__pyx_n_s_K9; static PyObject *__pyx_n_s_KBDILLUMDOWN; static PyObject *__pyx_n_s_KBDILLUMTOGGLE; static PyObject *__pyx_n_s_KBDILLUMUP; static PyObject *__pyx_n_s_KP_0; static PyObject *__pyx_n_s_KP_00; static PyObject *__pyx_n_s_KP_000; static PyObject *__pyx_n_s_KP_1; static PyObject *__pyx_n_s_KP_2; static PyObject *__pyx_n_s_KP_3; static PyObject *__pyx_n_s_KP_4; static PyObject *__pyx_n_s_KP_5; static PyObject *__pyx_n_s_KP_6; static PyObject *__pyx_n_s_KP_7; static PyObject *__pyx_n_s_KP_8; static PyObject *__pyx_n_s_KP_9; static PyObject *__pyx_n_s_KP_A; static PyObject *__pyx_n_s_KP_AMPERSAND; static PyObject *__pyx_n_s_KP_AT; static PyObject *__pyx_n_s_KP_B; static PyObject *__pyx_n_s_KP_BACKSPACE; static PyObject *__pyx_n_s_KP_BINARY; static PyObject *__pyx_n_s_KP_C; static PyObject *__pyx_n_s_KP_CLEAR; static PyObject *__pyx_n_s_KP_CLEARENTRY; static PyObject *__pyx_n_s_KP_COLON; static PyObject *__pyx_n_s_KP_COMMA; static PyObject *__pyx_n_s_KP_D; static PyObject *__pyx_n_s_KP_DBLAMPERSAND; static PyObject *__pyx_n_s_KP_DBLVERTICALBAR; static PyObject *__pyx_n_s_KP_DECIMAL; static PyObject *__pyx_n_s_KP_DIVIDE; static PyObject *__pyx_n_s_KP_E; static PyObject *__pyx_n_s_KP_ENTER; static PyObject *__pyx_n_s_KP_EQUALS; static PyObject *__pyx_n_s_KP_EQUALSAS400; static PyObject *__pyx_n_s_KP_EXCLAM; static PyObject *__pyx_n_s_KP_F; static PyObject *__pyx_n_s_KP_GREATER; static PyObject *__pyx_n_s_KP_HASH; static PyObject *__pyx_n_s_KP_HEXADECIMAL; static PyObject *__pyx_n_s_KP_LEFTBRACE; static PyObject *__pyx_n_s_KP_LEFTPAREN; static PyObject *__pyx_n_s_KP_LESS; static PyObject *__pyx_n_s_KP_MEMADD; static PyObject *__pyx_n_s_KP_MEMCLEAR; static PyObject *__pyx_n_s_KP_MEMDIVIDE; static PyObject *__pyx_n_s_KP_MEMMULTIPLY; static PyObject *__pyx_n_s_KP_MEMRECALL; static PyObject *__pyx_n_s_KP_MEMSTORE; static PyObject *__pyx_n_s_KP_MEMSUBTRACT; static PyObject *__pyx_n_s_KP_MINUS; static PyObject *__pyx_n_s_KP_MULTIPLY; static PyObject *__pyx_n_s_KP_OCTAL; static PyObject *__pyx_n_s_KP_PERCENT; static PyObject *__pyx_n_s_KP_PERIOD; static PyObject *__pyx_n_s_KP_PLUS; static PyObject *__pyx_n_s_KP_PLUSMINUS; static PyObject *__pyx_n_s_KP_POWER; static PyObject *__pyx_n_s_KP_RIGHTBRACE; static PyObject *__pyx_n_s_KP_RIGHTPAREN; static PyObject *__pyx_n_s_KP_SPACE; static PyObject *__pyx_n_s_KP_TAB; static PyObject *__pyx_n_s_KP_VERTICALBAR; static PyObject *__pyx_n_s_KP_XOR; static PyObject *__pyx_n_s_Key; static PyObject *__pyx_n_s_KeyModifiers; static PyObject *__pyx_n_s_KeyModifiers___init; static PyObject *__pyx_n_s_L; static PyObject *__pyx_n_s_LALT; static PyObject *__pyx_n_s_LCTRL; static PyObject *__pyx_n_s_LEFT; static PyObject *__pyx_n_s_LEFTBRACKET; static PyObject *__pyx_n_s_LEFTPAREN; static PyObject *__pyx_n_s_LEFT_SHOULDER; static PyObject *__pyx_n_s_LEFT_STICK; static PyObject *__pyx_n_s_LESS; static PyObject *__pyx_n_s_LGUI; static PyObject *__pyx_n_s_LSHIFT; static PyObject *__pyx_n_s_M; static PyObject *__pyx_n_s_MAIL; static PyObject *__pyx_n_s_MEDIASELECT; static PyObject *__pyx_n_s_MENU; static PyObject *__pyx_n_s_MIDDLE; static PyObject *__pyx_n_s_MINUS; static PyObject *__pyx_n_s_MODE; static PyObject *__pyx_n_s_MUTE; static PyObject *__pyx_n_s_Mouse; static PyObject *__pyx_n_s_MouseButton; static PyObject *__pyx_n_s_Mouse___init; static PyObject *__pyx_n_s_N; static PyObject *__pyx_kp_s_NOTIFICATION_unknown_controller; static PyObject *__pyx_kp_s_NOTIFICATION_unknown_key; static PyObject *__pyx_kp_s_NOTIFICATION_unknown_mouse_butto; static PyObject *__pyx_n_s_NUMLOCKCLEAR; static PyObject *__pyx_n_s_NotImplemented; static PyObject *__pyx_n_s_O; static PyObject *__pyx_n_s_OPER; static PyObject *__pyx_n_s_OUT; static PyObject *__pyx_n_s_P; static PyObject *__pyx_n_s_PAGEDOWN; static PyObject *__pyx_n_s_PAGEUP; static PyObject *__pyx_n_s_PASTE; static PyObject *__pyx_n_s_PAUSE; static PyObject *__pyx_n_s_PERCENT; static PyObject *__pyx_n_s_PERIOD; static PyObject *__pyx_n_s_PLUS; static PyObject *__pyx_n_s_POWER; static PyObject *__pyx_n_s_PRINTSCREEN; static PyObject *__pyx_n_s_PRIOR; static PyObject *__pyx_n_s_Pyxelen; static PyObject *__pyx_n_s_Pyxelen___init; static PyObject *__pyx_n_s_Pyxelen__find_window; static PyObject *__pyx_n_s_Pyxelen_close_window; static PyObject *__pyx_n_s_Pyxelen_open_window; static PyObject *__pyx_n_s_Pyxelen_run; static PyObject *__pyx_n_s_Q; static PyObject *__pyx_n_s_QUESTION; static PyObject *__pyx_n_s_QUOTE; static PyObject *__pyx_n_s_QUOTEDBL; static PyObject *__pyx_n_s_R; static PyObject *__pyx_n_s_RALT; static PyObject *__pyx_n_s_RCTRL; static PyObject *__pyx_n_s_RETURN; static PyObject *__pyx_n_s_RETURN2; static PyObject *__pyx_n_s_RGUI; static PyObject *__pyx_n_s_RIGHT; static PyObject *__pyx_n_s_RIGHTBRACKET; static PyObject *__pyx_n_s_RIGHTPAREN; static PyObject *__pyx_n_s_RIGHT_SHOULDER; static PyObject *__pyx_n_s_RIGHT_STICK; static PyObject *__pyx_n_s_RSHIFT; static PyObject *__pyx_n_s_RuntimeError; static PyObject *__pyx_n_s_S; static PyObject *__pyx_n_s_SCROLLLOCK; static PyObject *__pyx_n_s_SELECT; static PyObject *__pyx_n_s_SEMICOLON; static PyObject *__pyx_n_s_SEPARATOR; static PyObject *__pyx_n_s_SLASH; static PyObject *__pyx_n_s_SLEEP; static PyObject *__pyx_n_s_SPACE; static PyObject *__pyx_n_s_START; static PyObject *__pyx_n_s_STOP; static PyObject *__pyx_n_s_SYSREQ; static PyObject *__pyx_n_s_T; static PyObject *__pyx_n_s_TAB; static PyObject *__pyx_n_s_THOUSANDSSEPARATOR; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_U; static PyObject *__pyx_n_s_UNDERSCORE; static PyObject *__pyx_n_s_UNDO; static PyObject *__pyx_n_s_UNKNOWN; static PyObject *__pyx_n_s_UP; static PyObject *__pyx_n_s_V; static PyObject *__pyx_n_s_VOLUMEDOWN; static PyObject *__pyx_n_s_VOLUMEUP; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_n_s_W; static PyObject *__pyx_n_s_WWW; static PyObject *__pyx_n_s_X; static PyObject *__pyx_n_s_X1; static PyObject *__pyx_n_s_X2; static PyObject *__pyx_n_s_Y; static PyObject *__pyx_n_s_Z; static PyObject *__pyx_n_s__44; static PyObject *__pyx_n_s_add_controller; static PyObject *__pyx_n_s_alt; static PyObject *__pyx_n_s_append; static PyObject *__pyx_n_s_audio; static PyObject *__pyx_n_s_button; static PyObject *__pyx_n_s_button4; static PyObject *__pyx_n_s_button5; static PyObject *__pyx_n_s_c; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_close_window; static PyObject *__pyx_n_s_controller; static PyObject *__pyx_n_s_controllers; static PyObject *__pyx_n_s_controllers_2; static PyObject *__pyx_n_s_controls; static PyObject *__pyx_n_s_ctrl; static PyObject *__pyx_n_s_current_ticks; static PyObject *__pyx_n_s_doc; static PyObject *__pyx_n_s_dst_h; static PyObject *__pyx_n_s_dst_w; static PyObject *__pyx_n_s_dst_x; static PyObject *__pyx_n_s_dst_y; static PyObject *__pyx_n_s_effect; static PyObject *__pyx_n_s_encode; static PyObject *__pyx_n_s_end; static PyObject *__pyx_n_s_enum; static PyObject *__pyx_n_s_enumerate; static PyObject *__pyx_n_s_event; static PyObject *__pyx_n_s_event_handler; static PyObject *__pyx_n_s_file; static PyObject *__pyx_n_s_filename; static PyObject *__pyx_n_s_find_controller; static PyObject *__pyx_n_s_find_window; static PyObject *__pyx_n_s_fps; static PyObject *__pyx_kp_s_fps_must_be_positive; static PyObject *__pyx_n_s_get; static PyObject *__pyx_n_s_get_error; static PyObject *__pyx_n_s_getstate; static PyObject *__pyx_n_s_h; static PyObject *__pyx_n_s_height; static PyObject *__pyx_n_s_i; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_importlib; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_init_2; static PyObject *__pyx_n_s_instance; static PyObject *__pyx_n_s_key; static PyObject *__pyx_n_s_key_modifiers; static PyObject *__pyx_n_s_last_frame_ticks; static PyObject *__pyx_n_s_left; static PyObject *__pyx_n_s_load_effect; static PyObject *__pyx_n_s_load_music; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_metaclass; static PyObject *__pyx_n_s_middle; static PyObject *__pyx_n_s_mod; static PyObject *__pyx_n_s_mods; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_s_mouse; static PyObject *__pyx_n_s_music; static PyObject *__pyx_n_s_music_playing; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_on_audio_device_added; static PyObject *__pyx_n_s_on_audio_device_removed; static PyObject *__pyx_n_s_on_controller_button_down; static PyObject *__pyx_n_s_on_controller_button_up; static PyObject *__pyx_n_s_on_controller_device_added; static PyObject *__pyx_n_s_on_controller_device_removed; static PyObject *__pyx_n_s_on_controller_dpad; static PyObject *__pyx_n_s_on_key_down; static PyObject *__pyx_n_s_on_key_up; static PyObject *__pyx_n_s_on_mouse_button_down; static PyObject *__pyx_n_s_on_mouse_button_up; static PyObject *__pyx_n_s_on_mouse_motion; static PyObject *__pyx_n_s_on_mouse_wheel; static PyObject *__pyx_n_s_on_quit; static PyObject *__pyx_n_s_on_render_targets_reset; static PyObject *__pyx_n_s_on_text_input; static PyObject *__pyx_n_s_on_update_and_render; static PyObject *__pyx_n_s_on_window_close; static PyObject *__pyx_n_s_on_window_enter; static PyObject *__pyx_n_s_on_window_exposed; static PyObject *__pyx_n_s_on_window_focus_gained; static PyObject *__pyx_n_s_on_window_focus_lost; static PyObject *__pyx_n_s_on_window_hidden; static PyObject *__pyx_n_s_on_window_leave; static PyObject *__pyx_n_s_on_window_maximized; static PyObject *__pyx_n_s_on_window_minimized; static PyObject *__pyx_n_s_on_window_moved; static PyObject *__pyx_n_s_on_window_restored; static PyObject *__pyx_n_s_on_window_shown; static PyObject *__pyx_n_s_on_window_size_changed; static PyObject *__pyx_n_s_open_window; static PyObject *__pyx_n_s_play_effect; static PyObject *__pyx_n_s_play_music; static PyObject *__pyx_n_s_prepare; static PyObject *__pyx_n_s_print; static PyObject *__pyx_n_s_property; static PyObject *__pyx_n_s_pyxelen; static PyObject *__pyx_kp_s_pyxelen_pyx; static PyObject *__pyx_n_s_qualname; static PyObject *__pyx_n_s_quit; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_reduce; static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_reduce_ex; static PyObject *__pyx_n_s_remove_controller; static PyObject *__pyx_n_s_result; static PyObject *__pyx_n_s_right; static PyObject *__pyx_n_s_run; static PyObject *__pyx_n_s_self; static PyObject *__pyx_kp_s_self_chunk_cannot_be_converted_t; static PyObject *__pyx_kp_s_self_music_cannot_be_converted_t; static PyObject *__pyx_kp_s_self_renderer_cannot_be_converte; static PyObject *__pyx_kp_s_self_surface_cannot_be_converted; static PyObject *__pyx_kp_s_self_texture_cannot_be_converted; static PyObject *__pyx_kp_s_self_window_cannot_be_converted; static PyObject *__pyx_n_s_set_music_volume; static PyObject *__pyx_n_s_setstate; static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_shift; static PyObject *__pyx_n_s_src_h; static PyObject *__pyx_n_s_src_w; static PyObject *__pyx_n_s_src_x; static PyObject *__pyx_n_s_src_y; static PyObject *__pyx_n_s_state; static PyObject *__pyx_n_s_stop_music; static PyObject *__pyx_n_s_sys; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_texture; static PyObject *__pyx_n_s_ticks_per_frame; static PyObject *__pyx_n_s_title; static PyObject *__pyx_kp_s_utf_8; static PyObject *__pyx_n_s_volume; static PyObject *__pyx_n_s_w; static PyObject *__pyx_n_s_width; static PyObject *__pyx_n_s_window; static PyObject *__pyx_n_s_window_event; static PyObject *__pyx_n_s_window_id; static PyObject *__pyx_n_s_windows; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_y; static void __pyx_pf_7pyxelen_6Effect___dealloc__(struct __pyx_obj_7pyxelen_Effect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_6Effect_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Effect *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_6Effect_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Effect *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static void __pyx_pf_7pyxelen_5Music___dealloc__(struct __pyx_obj_7pyxelen_Music *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_5Music_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Music *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_5Music_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Music *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7pyxelen_5Audio___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_5Audio_2set_music_volume(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, int __pyx_v_volume); /* proto */ static PyObject *__pyx_pf_7pyxelen_5Audio_4play_music(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7pyxelen_Music *__pyx_v_music); /* proto */ static PyObject *__pyx_pf_7pyxelen_5Audio_6stop_music(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_5Audio_8play_effect(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, struct __pyx_obj_7pyxelen_Effect *__pyx_v_effect, int __pyx_v_volume); /* proto */ static PyObject *__pyx_pf_7pyxelen_5Audio_10load_music(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */ static PyObject *__pyx_pf_7pyxelen_5Audio_12load_effect(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */ static PyObject *__pyx_pf_7pyxelen_12KeyModifiers___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ctrl, PyObject *__pyx_v_shift, PyObject *__pyx_v_alt); /* proto */ static PyObject *__pyx_pf_7pyxelen_5Mouse___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_left, PyObject *__pyx_v_middle, PyObject *__pyx_v_right, PyObject *__pyx_v_button4, PyObject *__pyx_v_button5); /* proto */ static PyObject *__pyx_pf_7pyxelen_8Controls___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_8Controls_2find_controller(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_instance); /* proto */ static PyObject *__pyx_pf_7pyxelen_8Controls_4add_controller(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_instance); /* proto */ static PyObject *__pyx_pf_7pyxelen_8Controls_6remove_controller(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_instance); /* proto */ static PyObject *__pyx_pf_7pyxelen_8Controls_8mouse(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_8Controls_10key_modifiers(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ static void __pyx_pf_7pyxelen_6Window___dealloc__(struct __pyx_obj_7pyxelen_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_6Window_2create_renderer(struct __pyx_obj_7pyxelen_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_6Window_9window_id___get__(struct __pyx_obj_7pyxelen_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_6Window_4size___get__(struct __pyx_obj_7pyxelen_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_6Window_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_6Window_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static void __pyx_pf_7pyxelen_7Surface___dealloc__(struct __pyx_obj_7pyxelen_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_7Surface_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Surface *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_7Surface_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static void __pyx_pf_7pyxelen_7Texture___dealloc__(struct __pyx_obj_7pyxelen_Texture *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_7Texture_4size___get__(struct __pyx_obj_7pyxelen_Texture *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_7Texture_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Texture *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_7Texture_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Texture *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static void __pyx_pf_7pyxelen_8Renderer___dealloc__(struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_8Renderer_2create_texture(struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self, int __pyx_v_w, int __pyx_v_h); /* proto */ static PyObject *__pyx_pf_7pyxelen_8Renderer_4create_texture_from_surface(struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self, struct __pyx_obj_7pyxelen_Surface *__pyx_v_surface); /* proto */ static PyObject *__pyx_pf_7pyxelen_8Renderer_6create_texture_from_image(struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */ static PyObject *__pyx_pf_7pyxelen_8Renderer_10draw_color___get__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self); /* proto */ static int __pyx_pf_7pyxelen_8Renderer_10draw_color_2__set__(struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self, PyObject *__pyx_v_color); /* proto */ static PyObject *__pyx_pf_7pyxelen_8Renderer_8copy(struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self, struct __pyx_obj_7pyxelen_Texture *__pyx_v_texture, int __pyx_v_src_x, int __pyx_v_src_y, int __pyx_v_src_w, int __pyx_v_src_h, int __pyx_v_dst_x, int __pyx_v_dst_y, int __pyx_v_dst_w, int __pyx_v_dst_h); /* proto */ static PyObject *__pyx_pf_7pyxelen_8Renderer_6target___get__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self); /* proto */ static int __pyx_pf_7pyxelen_8Renderer_6target_2__set__(struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self, struct __pyx_obj_7pyxelen_Texture *__pyx_v_target); /* proto */ static PyObject *__pyx_pf_7pyxelen_8Renderer_10clear(struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_8Renderer_12present(struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_8Renderer_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_8Renderer_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7pyxelen_7Pyxelen___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_7Pyxelen_2open_window(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_title, int __pyx_v_width, int __pyx_v_height); /* proto */ static PyObject *__pyx_pf_7pyxelen_7Pyxelen_4close_window(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7pyxelen_Window *__pyx_v_window); /* proto */ static PyObject *__pyx_pf_7pyxelen_7Pyxelen_6_find_window(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_window_id); /* proto */ static PyObject *__pyx_pf_7pyxelen_7Pyxelen_8run(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event_handler, PyObject *__pyx_v_fps); /* proto */ static PyObject *__pyx_pf_7pyxelen_get_error(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_2init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_7pyxelen_4quit(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_tp_new_7pyxelen_Effect(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7pyxelen_Music(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7pyxelen_Window(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7pyxelen_Surface(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7pyxelen_Texture(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7pyxelen_Renderer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyString_Type_encode = {0, &__pyx_n_s_encode, 0, 0, 0}; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_1000; static PyObject *__pyx_int_neg_1; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__6; static PyObject *__pyx_tuple__7; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__12; static PyObject *__pyx_tuple__13; static PyObject *__pyx_tuple__14; static PyObject *__pyx_tuple__15; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__17; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__19; static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__21; static PyObject *__pyx_tuple__22; static PyObject *__pyx_tuple__23; static PyObject *__pyx_tuple__24; static PyObject *__pyx_tuple__25; static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__30; static PyObject *__pyx_tuple__32; static PyObject *__pyx_tuple__34; static PyObject *__pyx_tuple__36; static PyObject *__pyx_tuple__38; static PyObject *__pyx_tuple__40; static PyObject *__pyx_tuple__42; static PyObject *__pyx_tuple__45; static PyObject *__pyx_tuple__47; static PyObject *__pyx_tuple__49; static PyObject *__pyx_tuple__51; static PyObject *__pyx_tuple__53; static PyObject *__pyx_tuple__55; static PyObject *__pyx_tuple__57; static PyObject *__pyx_tuple__59; static PyObject *__pyx_tuple__61; static PyObject *__pyx_tuple__63; static PyObject *__pyx_tuple__65; static PyObject *__pyx_codeobj__27; static PyObject *__pyx_codeobj__29; static PyObject *__pyx_codeobj__31; static PyObject *__pyx_codeobj__33; static PyObject *__pyx_codeobj__35; static PyObject *__pyx_codeobj__37; static PyObject *__pyx_codeobj__39; static PyObject *__pyx_codeobj__41; static PyObject *__pyx_codeobj__43; static PyObject *__pyx_codeobj__46; static PyObject *__pyx_codeobj__48; static PyObject *__pyx_codeobj__50; static PyObject *__pyx_codeobj__52; static PyObject *__pyx_codeobj__54; static PyObject *__pyx_codeobj__56; static PyObject *__pyx_codeobj__58; static PyObject *__pyx_codeobj__60; static PyObject *__pyx_codeobj__62; static PyObject *__pyx_codeobj__64; static PyObject *__pyx_codeobj__66; static PyObject *__pyx_codeobj__67; static PyObject *__pyx_codeobj__68; static PyObject *__pyx_codeobj__69; /* Late includes */ /* "pyxelen.pyx":888 * cdef Mix_Chunk *chunk * * def __dealloc__(self): # <<<<<<<<<<<<<< * Mix_FreeChunk(self.chunk) * */ /* Python wrapper */ static void __pyx_pw_7pyxelen_6Effect_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_7pyxelen_6Effect_1__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_7pyxelen_6Effect___dealloc__(((struct __pyx_obj_7pyxelen_Effect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_7pyxelen_6Effect___dealloc__(struct __pyx_obj_7pyxelen_Effect *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pyxelen.pyx":889 * * def __dealloc__(self): * Mix_FreeChunk(self.chunk) # <<<<<<<<<<<<<< * * */ Mix_FreeChunk(__pyx_v_self->chunk); /* "pyxelen.pyx":888 * cdef Mix_Chunk *chunk * * def __dealloc__(self): # <<<<<<<<<<<<<< * Mix_FreeChunk(self.chunk) * */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("self.chunk cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_6Effect_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7pyxelen_6Effect_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_6Effect_2__reduce_cython__(((struct __pyx_obj_7pyxelen_Effect *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_6Effect_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Effect *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("self.chunk cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.chunk cannot be converted to a Python object for pickling") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("self.chunk cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Effect.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("self.chunk cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("self.chunk cannot be converted to a Python object for pickling") */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_6Effect_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_7pyxelen_6Effect_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_6Effect_4__setstate_cython__(((struct __pyx_obj_7pyxelen_Effect *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_6Effect_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Effect *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("self.chunk cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.chunk cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("self.chunk cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("self.chunk cannot be converted to a Python object for pickling") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Effect.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":896 * cdef Mix_Music *music * * def __dealloc__(self): # <<<<<<<<<<<<<< * Mix_FreeMusic(self.music) * */ /* Python wrapper */ static void __pyx_pw_7pyxelen_5Music_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_7pyxelen_5Music_1__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_7pyxelen_5Music___dealloc__(((struct __pyx_obj_7pyxelen_Music *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_7pyxelen_5Music___dealloc__(struct __pyx_obj_7pyxelen_Music *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pyxelen.pyx":897 * * def __dealloc__(self): * Mix_FreeMusic(self.music) # <<<<<<<<<<<<<< * * */ Mix_FreeMusic(__pyx_v_self->music); /* "pyxelen.pyx":896 * cdef Mix_Music *music * * def __dealloc__(self): # <<<<<<<<<<<<<< * Mix_FreeMusic(self.music) * */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("self.music cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_5Music_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7pyxelen_5Music_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_5Music_2__reduce_cython__(((struct __pyx_obj_7pyxelen_Music *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_5Music_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Music *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("self.music cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.music cannot be converted to a Python object for pickling") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("self.music cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Music.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("self.music cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("self.music cannot be converted to a Python object for pickling") */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_5Music_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_7pyxelen_5Music_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_5Music_4__setstate_cython__(((struct __pyx_obj_7pyxelen_Music *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_5Music_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Music *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("self.music cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.music cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("self.music cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("self.music cannot be converted to a Python object for pickling") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Music.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":902 * class Audio: * * def __init__(self): # <<<<<<<<<<<<<< * self.music_playing = False * */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_5Audio_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_5Audio_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7pyxelen_5Audio_1__init__, METH_O, 0}; static PyObject *__pyx_pw_7pyxelen_5Audio_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_5Audio___init__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_5Audio___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* "pyxelen.pyx":903 * * def __init__(self): * self.music_playing = False # <<<<<<<<<<<<<< * * def set_music_volume(self, int volume): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_music_playing, Py_False) < 0) __PYX_ERR(0, 903, __pyx_L1_error) /* "pyxelen.pyx":902 * class Audio: * * def __init__(self): # <<<<<<<<<<<<<< * self.music_playing = False * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pyxelen.Audio.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":905 * self.music_playing = False * * def set_music_volume(self, int volume): # <<<<<<<<<<<<<< * Mix_VolumeMusic(volume) * */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_5Audio_3set_music_volume(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_5Audio_3set_music_volume = {"set_music_volume", (PyCFunction)__pyx_pw_7pyxelen_5Audio_3set_music_volume, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7pyxelen_5Audio_3set_music_volume(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; int __pyx_v_volume; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_music_volume (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_volume,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_volume)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("set_music_volume", 1, 2, 2, 1); __PYX_ERR(0, 905, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_music_volume") < 0)) __PYX_ERR(0, 905, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_volume = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_volume == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 905, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("set_music_volume", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 905, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxelen.Audio.set_music_volume", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7pyxelen_5Audio_2set_music_volume(__pyx_self, __pyx_v_self, __pyx_v_volume); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_5Audio_2set_music_volume(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, int __pyx_v_volume) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("set_music_volume", 0); /* "pyxelen.pyx":906 * * def set_music_volume(self, int volume): * Mix_VolumeMusic(volume) # <<<<<<<<<<<<<< * * def play_music(self, Music music): */ (void)(Mix_VolumeMusic(__pyx_v_volume)); /* "pyxelen.pyx":905 * self.music_playing = False * * def set_music_volume(self, int volume): # <<<<<<<<<<<<<< * Mix_VolumeMusic(volume) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":908 * Mix_VolumeMusic(volume) * * def play_music(self, Music music): # <<<<<<<<<<<<<< * self.stop_music() * Mix_PlayMusic(music.music, -1) */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_5Audio_5play_music(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_5Audio_5play_music = {"play_music", (PyCFunction)__pyx_pw_7pyxelen_5Audio_5play_music, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7pyxelen_5Audio_5play_music(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; struct __pyx_obj_7pyxelen_Music *__pyx_v_music = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("play_music (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_music,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_music)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("play_music", 1, 2, 2, 1); __PYX_ERR(0, 908, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "play_music") < 0)) __PYX_ERR(0, 908, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_music = ((struct __pyx_obj_7pyxelen_Music *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("play_music", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 908, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxelen.Audio.play_music", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_music), __pyx_ptype_7pyxelen_Music, 1, "music", 0))) __PYX_ERR(0, 908, __pyx_L1_error) __pyx_r = __pyx_pf_7pyxelen_5Audio_4play_music(__pyx_self, __pyx_v_self, __pyx_v_music); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_5Audio_4play_music(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7pyxelen_Music *__pyx_v_music) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("play_music", 0); /* "pyxelen.pyx":909 * * def play_music(self, Music music): * self.stop_music() # <<<<<<<<<<<<<< * Mix_PlayMusic(music.music, -1) * self.music_playing = True */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_stop_music); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 909, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 909, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 909, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":910 * def play_music(self, Music music): * self.stop_music() * Mix_PlayMusic(music.music, -1) # <<<<<<<<<<<<<< * self.music_playing = True * */ (void)(Mix_PlayMusic(__pyx_v_music->music, -1)); /* "pyxelen.pyx":911 * self.stop_music() * Mix_PlayMusic(music.music, -1) * self.music_playing = True # <<<<<<<<<<<<<< * * def stop_music(self): */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_music_playing, Py_True) < 0) __PYX_ERR(0, 911, __pyx_L1_error) /* "pyxelen.pyx":908 * Mix_VolumeMusic(volume) * * def play_music(self, Music music): # <<<<<<<<<<<<<< * self.stop_music() * Mix_PlayMusic(music.music, -1) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pyxelen.Audio.play_music", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":913 * self.music_playing = True * * def stop_music(self): # <<<<<<<<<<<<<< * if self.music_playing: * self.music_playing = False */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_5Audio_7stop_music(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_5Audio_7stop_music = {"stop_music", (PyCFunction)__pyx_pw_7pyxelen_5Audio_7stop_music, METH_O, 0}; static PyObject *__pyx_pw_7pyxelen_5Audio_7stop_music(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("stop_music (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_5Audio_6stop_music(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_5Audio_6stop_music(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; __Pyx_RefNannySetupContext("stop_music", 0); /* "pyxelen.pyx":914 * * def stop_music(self): * if self.music_playing: # <<<<<<<<<<<<<< * self.music_playing = False * Mix_HaltMusic() */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_music_playing); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 914, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "pyxelen.pyx":915 * def stop_music(self): * if self.music_playing: * self.music_playing = False # <<<<<<<<<<<<<< * Mix_HaltMusic() * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_music_playing, Py_False) < 0) __PYX_ERR(0, 915, __pyx_L1_error) /* "pyxelen.pyx":916 * if self.music_playing: * self.music_playing = False * Mix_HaltMusic() # <<<<<<<<<<<<<< * * def play_effect(self, Effect effect, int volume): */ (void)(Mix_HaltMusic()); /* "pyxelen.pyx":914 * * def stop_music(self): * if self.music_playing: # <<<<<<<<<<<<<< * self.music_playing = False * Mix_HaltMusic() */ } /* "pyxelen.pyx":913 * self.music_playing = True * * def stop_music(self): # <<<<<<<<<<<<<< * if self.music_playing: * self.music_playing = False */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Audio.stop_music", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":918 * Mix_HaltMusic() * * def play_effect(self, Effect effect, int volume): # <<<<<<<<<<<<<< * Mix_VolumeChunk(effect.chunk, volume) * Mix_PlayChannelTimed(-1, effect.chunk, 0, -1) */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_5Audio_9play_effect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_5Audio_9play_effect = {"play_effect", (PyCFunction)__pyx_pw_7pyxelen_5Audio_9play_effect, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7pyxelen_5Audio_9play_effect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; struct __pyx_obj_7pyxelen_Effect *__pyx_v_effect = 0; int __pyx_v_volume; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("play_effect (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_effect,&__pyx_n_s_volume,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_effect)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("play_effect", 1, 3, 3, 1); __PYX_ERR(0, 918, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_volume)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("play_effect", 1, 3, 3, 2); __PYX_ERR(0, 918, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "play_effect") < 0)) __PYX_ERR(0, 918, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_self = values[0]; __pyx_v_effect = ((struct __pyx_obj_7pyxelen_Effect *)values[1]); __pyx_v_volume = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_volume == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 918, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("play_effect", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 918, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxelen.Audio.play_effect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_effect), __pyx_ptype_7pyxelen_Effect, 1, "effect", 0))) __PYX_ERR(0, 918, __pyx_L1_error) __pyx_r = __pyx_pf_7pyxelen_5Audio_8play_effect(__pyx_self, __pyx_v_self, __pyx_v_effect, __pyx_v_volume); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_5Audio_8play_effect(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, struct __pyx_obj_7pyxelen_Effect *__pyx_v_effect, int __pyx_v_volume) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("play_effect", 0); /* "pyxelen.pyx":919 * * def play_effect(self, Effect effect, int volume): * Mix_VolumeChunk(effect.chunk, volume) # <<<<<<<<<<<<<< * Mix_PlayChannelTimed(-1, effect.chunk, 0, -1) * */ (void)(Mix_VolumeChunk(__pyx_v_effect->chunk, __pyx_v_volume)); /* "pyxelen.pyx":920 * def play_effect(self, Effect effect, int volume): * Mix_VolumeChunk(effect.chunk, volume) * Mix_PlayChannelTimed(-1, effect.chunk, 0, -1) # <<<<<<<<<<<<<< * * def load_music(self, str filename): */ (void)(Mix_PlayChannelTimed(-1, __pyx_v_effect->chunk, 0, -1)); /* "pyxelen.pyx":918 * Mix_HaltMusic() * * def play_effect(self, Effect effect, int volume): # <<<<<<<<<<<<<< * Mix_VolumeChunk(effect.chunk, volume) * Mix_PlayChannelTimed(-1, effect.chunk, 0, -1) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":922 * Mix_PlayChannelTimed(-1, effect.chunk, 0, -1) * * def load_music(self, str filename): # <<<<<<<<<<<<<< * result = Music() * result.music = Mix_LoadMUS(filename.encode('utf-8')) */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_5Audio_11load_music(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_5Audio_11load_music = {"load_music", (PyCFunction)__pyx_pw_7pyxelen_5Audio_11load_music, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7pyxelen_5Audio_11load_music(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; PyObject *__pyx_v_filename = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load_music (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filename,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("load_music", 1, 2, 2, 1); __PYX_ERR(0, 922, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_music") < 0)) __PYX_ERR(0, 922, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_filename = ((PyObject*)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load_music", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 922, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxelen.Audio.load_music", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filename), (&PyString_Type), 1, "filename", 1))) __PYX_ERR(0, 922, __pyx_L1_error) __pyx_r = __pyx_pf_7pyxelen_5Audio_10load_music(__pyx_self, __pyx_v_self, __pyx_v_filename); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_5Audio_10load_music(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_filename) { struct __pyx_obj_7pyxelen_Music *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; __Pyx_RefNannySetupContext("load_music", 0); /* "pyxelen.pyx":923 * * def load_music(self, str filename): * result = Music() # <<<<<<<<<<<<<< * result.music = Mix_LoadMUS(filename.encode('utf-8')) * return result */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyxelen_Music)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((struct __pyx_obj_7pyxelen_Music *)__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":924 * def load_music(self, str filename): * result = Music() * result.music = Mix_LoadMUS(filename.encode('utf-8')) # <<<<<<<<<<<<<< * return result * */ __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_filename, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 924, __pyx_L1_error) __pyx_v_result->music = Mix_LoadMUS(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":925 * result = Music() * result.music = Mix_LoadMUS(filename.encode('utf-8')) * return result # <<<<<<<<<<<<<< * * def load_effect(self, str filename): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "pyxelen.pyx":922 * Mix_PlayChannelTimed(-1, effect.chunk, 0, -1) * * def load_music(self, str filename): # <<<<<<<<<<<<<< * result = Music() * result.music = Mix_LoadMUS(filename.encode('utf-8')) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Audio.load_music", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":927 * return result * * def load_effect(self, str filename): # <<<<<<<<<<<<<< * result = Effect() * result.chunk = Mix_LoadWAV_RW(SDL_RWFromFile(filename.encode('utf-8'), "rb"), 1) */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_5Audio_13load_effect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_5Audio_13load_effect = {"load_effect", (PyCFunction)__pyx_pw_7pyxelen_5Audio_13load_effect, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7pyxelen_5Audio_13load_effect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_self = 0; PyObject *__pyx_v_filename = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("load_effect (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_filename,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("load_effect", 1, 2, 2, 1); __PYX_ERR(0, 927, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_effect") < 0)) __PYX_ERR(0, 927, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_filename = ((PyObject*)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("load_effect", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 927, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxelen.Audio.load_effect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filename), (&PyString_Type), 1, "filename", 1))) __PYX_ERR(0, 927, __pyx_L1_error) __pyx_r = __pyx_pf_7pyxelen_5Audio_12load_effect(__pyx_self, __pyx_v_self, __pyx_v_filename); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_5Audio_12load_effect(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_filename) { struct __pyx_obj_7pyxelen_Effect *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; __Pyx_RefNannySetupContext("load_effect", 0); /* "pyxelen.pyx":928 * * def load_effect(self, str filename): * result = Effect() # <<<<<<<<<<<<<< * result.chunk = Mix_LoadWAV_RW(SDL_RWFromFile(filename.encode('utf-8'), "rb"), 1) * return result */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyxelen_Effect)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 928, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((struct __pyx_obj_7pyxelen_Effect *)__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":929 * def load_effect(self, str filename): * result = Effect() * result.chunk = Mix_LoadWAV_RW(SDL_RWFromFile(filename.encode('utf-8'), "rb"), 1) # <<<<<<<<<<<<<< * return result * */ __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_filename, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 929, __pyx_L1_error) __pyx_v_result->chunk = Mix_LoadWAV_RW(SDL_RWFromFile(__pyx_t_2, ((char const *)"rb")), 1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":930 * result = Effect() * result.chunk = Mix_LoadWAV_RW(SDL_RWFromFile(filename.encode('utf-8'), "rb"), 1) * return result # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "pyxelen.pyx":927 * return result * * def load_effect(self, str filename): # <<<<<<<<<<<<<< * result = Effect() * result.chunk = Mix_LoadWAV_RW(SDL_RWFromFile(filename.encode('utf-8'), "rb"), 1) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Audio.load_effect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":935 * class KeyModifiers: * * def __init__(self, ctrl, shift, alt): # <<<<<<<<<<<<<< * self.ctrl = ctrl * self.shift = shift */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_12KeyModifiers_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_12KeyModifiers_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7pyxelen_12KeyModifiers_1__init__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7pyxelen_12KeyModifiers_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_ctrl = 0; PyObject *__pyx_v_shift = 0; PyObject *__pyx_v_alt = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctrl,&__pyx_n_s_shift,&__pyx_n_s_alt,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ctrl)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 935, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shift)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 935, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alt)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 935, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 935, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_self = values[0]; __pyx_v_ctrl = values[1]; __pyx_v_shift = values[2]; __pyx_v_alt = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 935, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxelen.KeyModifiers.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7pyxelen_12KeyModifiers___init__(__pyx_self, __pyx_v_self, __pyx_v_ctrl, __pyx_v_shift, __pyx_v_alt); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_12KeyModifiers___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_ctrl, PyObject *__pyx_v_shift, PyObject *__pyx_v_alt) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* "pyxelen.pyx":936 * * def __init__(self, ctrl, shift, alt): * self.ctrl = ctrl # <<<<<<<<<<<<<< * self.shift = shift * self.alt = alt */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ctrl, __pyx_v_ctrl) < 0) __PYX_ERR(0, 936, __pyx_L1_error) /* "pyxelen.pyx":937 * def __init__(self, ctrl, shift, alt): * self.ctrl = ctrl * self.shift = shift # <<<<<<<<<<<<<< * self.alt = alt * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shift, __pyx_v_shift) < 0) __PYX_ERR(0, 937, __pyx_L1_error) /* "pyxelen.pyx":938 * self.ctrl = ctrl * self.shift = shift * self.alt = alt # <<<<<<<<<<<<<< * * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_alt, __pyx_v_alt) < 0) __PYX_ERR(0, 938, __pyx_L1_error) /* "pyxelen.pyx":935 * class KeyModifiers: * * def __init__(self, ctrl, shift, alt): # <<<<<<<<<<<<<< * self.ctrl = ctrl * self.shift = shift */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pyxelen.KeyModifiers.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":943 * class Mouse: * * def __init__(self, x, y, left, middle, right, button4, button5): # <<<<<<<<<<<<<< * self.x = x * self.y = y */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_5Mouse_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_5Mouse_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7pyxelen_5Mouse_1__init__, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7pyxelen_5Mouse_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_v_y = 0; PyObject *__pyx_v_left = 0; PyObject *__pyx_v_middle = 0; PyObject *__pyx_v_right = 0; PyObject *__pyx_v_button4 = 0; PyObject *__pyx_v_button5 = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_left,&__pyx_n_s_middle,&__pyx_n_s_right,&__pyx_n_s_button4,&__pyx_n_s_button5,0}; PyObject* values[8] = {0,0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 1); __PYX_ERR(0, 943, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 2); __PYX_ERR(0, 943, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 3); __PYX_ERR(0, 943, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_middle)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 4); __PYX_ERR(0, 943, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 5); __PYX_ERR(0, 943, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_button4)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 6); __PYX_ERR(0, 943, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_button5)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 7); __PYX_ERR(0, 943, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 943, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 8) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); values[7] = PyTuple_GET_ITEM(__pyx_args, 7); } __pyx_v_self = values[0]; __pyx_v_x = values[1]; __pyx_v_y = values[2]; __pyx_v_left = values[3]; __pyx_v_middle = values[4]; __pyx_v_right = values[5]; __pyx_v_button4 = values[6]; __pyx_v_button5 = values[7]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 943, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxelen.Mouse.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7pyxelen_5Mouse___init__(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y, __pyx_v_left, __pyx_v_middle, __pyx_v_right, __pyx_v_button4, __pyx_v_button5); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_5Mouse___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_left, PyObject *__pyx_v_middle, PyObject *__pyx_v_right, PyObject *__pyx_v_button4, PyObject *__pyx_v_button5) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* "pyxelen.pyx":944 * * def __init__(self, x, y, left, middle, right, button4, button5): * self.x = x # <<<<<<<<<<<<<< * self.y = y * self.left = left */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_v_x) < 0) __PYX_ERR(0, 944, __pyx_L1_error) /* "pyxelen.pyx":945 * def __init__(self, x, y, left, middle, right, button4, button5): * self.x = x * self.y = y # <<<<<<<<<<<<<< * self.left = left * self.middle = middle */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_v_y) < 0) __PYX_ERR(0, 945, __pyx_L1_error) /* "pyxelen.pyx":946 * self.x = x * self.y = y * self.left = left # <<<<<<<<<<<<<< * self.middle = middle * self.right = right */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_left, __pyx_v_left) < 0) __PYX_ERR(0, 946, __pyx_L1_error) /* "pyxelen.pyx":947 * self.y = y * self.left = left * self.middle = middle # <<<<<<<<<<<<<< * self.right = right * self.button4 = button4 */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_middle, __pyx_v_middle) < 0) __PYX_ERR(0, 947, __pyx_L1_error) /* "pyxelen.pyx":948 * self.left = left * self.middle = middle * self.right = right # <<<<<<<<<<<<<< * self.button4 = button4 * self.button5 = button5 */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_right, __pyx_v_right) < 0) __PYX_ERR(0, 948, __pyx_L1_error) /* "pyxelen.pyx":949 * self.middle = middle * self.right = right * self.button4 = button4 # <<<<<<<<<<<<<< * self.button5 = button5 * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_button4, __pyx_v_button4) < 0) __PYX_ERR(0, 949, __pyx_L1_error) /* "pyxelen.pyx":950 * self.right = right * self.button4 = button4 * self.button5 = button5 # <<<<<<<<<<<<<< * * */ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_button5, __pyx_v_button5) < 0) __PYX_ERR(0, 950, __pyx_L1_error) /* "pyxelen.pyx":943 * class Mouse: * * def __init__(self, x, y, left, middle, right, button4, button5): # <<<<<<<<<<<<<< * self.x = x * self.y = y */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pyxelen.Mouse.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":955 * class Controls: * * def __init__(self): # <<<<<<<<<<<<<< * self._controllers = [None for _ in range(16)] * */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_8Controls_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_8Controls_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7pyxelen_8Controls_1__init__, METH_O, 0}; static PyObject *__pyx_pw_7pyxelen_8Controls_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_8Controls___init__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_8Controls___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { CYTHON_UNUSED long __pyx_v__; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; long __pyx_t_2; __Pyx_RefNannySetupContext("__init__", 0); /* "pyxelen.pyx":956 * * def __init__(self): * self._controllers = [None for _ in range(16)] # <<<<<<<<<<<<<< * * def find_controller(self, int instance): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); for (__pyx_t_2 = 0; __pyx_t_2 < 16; __pyx_t_2+=1) { __pyx_v__ = __pyx_t_2; if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)Py_None))) __PYX_ERR(0, 956, __pyx_L1_error) } if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_controllers, __pyx_t_1) < 0) __PYX_ERR(0, 956, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":955 * class Controls: * * def __init__(self): # <<<<<<<<<<<<<< * self._controllers = [None for _ in range(16)] * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Controls.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":958 * self._controllers = [None for _ in range(16)] * * def find_controller(self, int instance): # <<<<<<<<<<<<<< * for i, c in enumerate(self._controllers): * if c == instance: */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_8Controls_3find_controller(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_8Controls_3find_controller = {"find_controller", (PyCFunction)__pyx_pw_7pyxelen_8Controls_3find_controller, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7pyxelen_8Controls_3find_controller(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; int __pyx_v_instance; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("find_controller (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_instance,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_instance)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("find_controller", 1, 2, 2, 1); __PYX_ERR(0, 958, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_controller") < 0)) __PYX_ERR(0, 958, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_instance = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_instance == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 958, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("find_controller", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 958, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxelen.Controls.find_controller", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7pyxelen_8Controls_2find_controller(__pyx_self, __pyx_v_self, __pyx_v_instance); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_8Controls_2find_controller(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_instance) { PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_c = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; int __pyx_t_7; __Pyx_RefNannySetupContext("find_controller", 0); /* "pyxelen.pyx":959 * * def find_controller(self, int instance): * for i, c in enumerate(self._controllers): # <<<<<<<<<<<<<< * if c == instance: * return i */ __Pyx_INCREF(__pyx_int_0); __pyx_t_1 = __pyx_int_0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_controllers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 959, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 959, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 959, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 959, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; /* "pyxelen.pyx":960 * def find_controller(self, int instance): * for i, c in enumerate(self._controllers): * if c == instance: # <<<<<<<<<<<<<< * return i * raise RuntimeError('Device not found') */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_instance); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyObject_RichCompare(__pyx_v_c, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 960, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 960, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_7) { /* "pyxelen.pyx":961 * for i, c in enumerate(self._controllers): * if c == instance: * return i # <<<<<<<<<<<<<< * raise RuntimeError('Device not found') * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_i); __pyx_r = __pyx_v_i; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "pyxelen.pyx":960 * def find_controller(self, int instance): * for i, c in enumerate(self._controllers): * if c == instance: # <<<<<<<<<<<<<< * return i * raise RuntimeError('Device not found') */ } /* "pyxelen.pyx":959 * * def find_controller(self, int instance): * for i, c in enumerate(self._controllers): # <<<<<<<<<<<<<< * if c == instance: * return i */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":962 * if c == instance: * return i * raise RuntimeError('Device not found') # <<<<<<<<<<<<<< * * def add_controller(self, int instance): */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 962, __pyx_L1_error) /* "pyxelen.pyx":958 * self._controllers = [None for _ in range(16)] * * def find_controller(self, int instance): # <<<<<<<<<<<<<< * for i, c in enumerate(self._controllers): * if c == instance: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pyxelen.Controls.find_controller", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":964 * raise RuntimeError('Device not found') * * def add_controller(self, int instance): # <<<<<<<<<<<<<< * for i, c in enumerate(self._controllers): * if c is None: */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_8Controls_5add_controller(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_8Controls_5add_controller = {"add_controller", (PyCFunction)__pyx_pw_7pyxelen_8Controls_5add_controller, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7pyxelen_8Controls_5add_controller(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; int __pyx_v_instance; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_controller (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_instance,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_instance)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_controller", 1, 2, 2, 1); __PYX_ERR(0, 964, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_controller") < 0)) __PYX_ERR(0, 964, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_instance = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_instance == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 964, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add_controller", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 964, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxelen.Controls.add_controller", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7pyxelen_8Controls_4add_controller(__pyx_self, __pyx_v_self, __pyx_v_instance); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_8Controls_4add_controller(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_instance) { PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_c = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("add_controller", 0); /* "pyxelen.pyx":965 * * def add_controller(self, int instance): * for i, c in enumerate(self._controllers): # <<<<<<<<<<<<<< * if c is None: * self._controllers[i] = instance */ __Pyx_INCREF(__pyx_int_0); __pyx_t_1 = __pyx_int_0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_controllers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 965, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 965, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 965, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 965, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; /* "pyxelen.pyx":966 * def add_controller(self, int instance): * for i, c in enumerate(self._controllers): * if c is None: # <<<<<<<<<<<<<< * self._controllers[i] = instance * return i */ __pyx_t_6 = (__pyx_v_c == Py_None); __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { /* "pyxelen.pyx":967 * for i, c in enumerate(self._controllers): * if c is None: * self._controllers[i] = instance # <<<<<<<<<<<<<< * return i * if c == instance: */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_instance); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_controllers); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_v_i, __pyx_t_2) < 0)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":968 * if c is None: * self._controllers[i] = instance * return i # <<<<<<<<<<<<<< * if c == instance: * return i */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_i); __pyx_r = __pyx_v_i; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "pyxelen.pyx":966 * def add_controller(self, int instance): * for i, c in enumerate(self._controllers): * if c is None: # <<<<<<<<<<<<<< * self._controllers[i] = instance * return i */ } /* "pyxelen.pyx":969 * self._controllers[i] = instance * return i * if c == instance: # <<<<<<<<<<<<<< * return i * raise RuntimeError('Cannot add a 17th controller') */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_instance); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = PyObject_RichCompare(__pyx_v_c, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 969, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 969, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_7) { /* "pyxelen.pyx":970 * return i * if c == instance: * return i # <<<<<<<<<<<<<< * raise RuntimeError('Cannot add a 17th controller') * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_i); __pyx_r = __pyx_v_i; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "pyxelen.pyx":969 * self._controllers[i] = instance * return i * if c == instance: # <<<<<<<<<<<<<< * return i * raise RuntimeError('Cannot add a 17th controller') */ } /* "pyxelen.pyx":965 * * def add_controller(self, int instance): * for i, c in enumerate(self._controllers): # <<<<<<<<<<<<<< * if c is None: * self._controllers[i] = instance */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":971 * if c == instance: * return i * raise RuntimeError('Cannot add a 17th controller') # <<<<<<<<<<<<<< * * def remove_controller(self, int instance): */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 971, __pyx_L1_error) /* "pyxelen.pyx":964 * raise RuntimeError('Device not found') * * def add_controller(self, int instance): # <<<<<<<<<<<<<< * for i, c in enumerate(self._controllers): * if c is None: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pyxelen.Controls.add_controller", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":973 * raise RuntimeError('Cannot add a 17th controller') * * def remove_controller(self, int instance): # <<<<<<<<<<<<<< * for i, c in enumerate(self._controllers): * if c == instance: */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_8Controls_7remove_controller(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_8Controls_7remove_controller = {"remove_controller", (PyCFunction)__pyx_pw_7pyxelen_8Controls_7remove_controller, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7pyxelen_8Controls_7remove_controller(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; int __pyx_v_instance; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("remove_controller (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_instance,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_instance)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("remove_controller", 1, 2, 2, 1); __PYX_ERR(0, 973, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "remove_controller") < 0)) __PYX_ERR(0, 973, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_instance = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_instance == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 973, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("remove_controller", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 973, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxelen.Controls.remove_controller", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7pyxelen_8Controls_6remove_controller(__pyx_self, __pyx_v_self, __pyx_v_instance); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_8Controls_6remove_controller(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_instance) { PyObject *__pyx_v_i = NULL; PyObject *__pyx_v_c = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; int __pyx_t_7; __Pyx_RefNannySetupContext("remove_controller", 0); /* "pyxelen.pyx":974 * * def remove_controller(self, int instance): * for i, c in enumerate(self._controllers): # <<<<<<<<<<<<<< * if c == instance: * self._controllers[i] = None */ __Pyx_INCREF(__pyx_int_0); __pyx_t_1 = __pyx_int_0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_controllers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 974, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 974, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 974, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 974, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; /* "pyxelen.pyx":975 * def remove_controller(self, int instance): * for i, c in enumerate(self._controllers): * if c == instance: # <<<<<<<<<<<<<< * self._controllers[i] = None * return */ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_instance); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = PyObject_RichCompare(__pyx_v_c, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 975, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_7) { /* "pyxelen.pyx":976 * for i, c in enumerate(self._controllers): * if c == instance: * self._controllers[i] = None # <<<<<<<<<<<<<< * return * raise RuntimeError('Device not found') */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_controllers); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_v_i, Py_None) < 0)) __PYX_ERR(0, 976, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "pyxelen.pyx":977 * if c == instance: * self._controllers[i] = None * return # <<<<<<<<<<<<<< * raise RuntimeError('Device not found') * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; /* "pyxelen.pyx":975 * def remove_controller(self, int instance): * for i, c in enumerate(self._controllers): * if c == instance: # <<<<<<<<<<<<<< * self._controllers[i] = None * return */ } /* "pyxelen.pyx":974 * * def remove_controller(self, int instance): * for i, c in enumerate(self._controllers): # <<<<<<<<<<<<<< * if c == instance: * self._controllers[i] = None */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":978 * self._controllers[i] = None * return * raise RuntimeError('Device not found') # <<<<<<<<<<<<<< * * @property */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 978, __pyx_L1_error) /* "pyxelen.pyx":973 * raise RuntimeError('Cannot add a 17th controller') * * def remove_controller(self, int instance): # <<<<<<<<<<<<<< * for i, c in enumerate(self._controllers): * if c == instance: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("pyxelen.Controls.remove_controller", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_i); __Pyx_XDECREF(__pyx_v_c); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":981 * * @property * def mouse(self): # <<<<<<<<<<<<<< * cdef int x = 0 * cdef int y = 0 */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_8Controls_9mouse(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_8Controls_9mouse = {"mouse", (PyCFunction)__pyx_pw_7pyxelen_8Controls_9mouse, METH_O, 0}; static PyObject *__pyx_pw_7pyxelen_8Controls_9mouse(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mouse (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_8Controls_8mouse(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_8Controls_8mouse(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { int __pyx_v_x; int __pyx_v_y; uint32_t __pyx_v_state; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; __Pyx_RefNannySetupContext("mouse", 0); /* "pyxelen.pyx":982 * @property * def mouse(self): * cdef int x = 0 # <<<<<<<<<<<<<< * cdef int y = 0 * cdef uint32_t state = SDL_GetMouseState(&x, &y) */ __pyx_v_x = 0; /* "pyxelen.pyx":983 * def mouse(self): * cdef int x = 0 * cdef int y = 0 # <<<<<<<<<<<<<< * cdef uint32_t state = SDL_GetMouseState(&x, &y) * return Mouse( */ __pyx_v_y = 0; /* "pyxelen.pyx":984 * cdef int x = 0 * cdef int y = 0 * cdef uint32_t state = SDL_GetMouseState(&x, &y) # <<<<<<<<<<<<<< * return Mouse( * x, y, */ __pyx_v_state = SDL_GetMouseState((&__pyx_v_x), (&__pyx_v_y)); /* "pyxelen.pyx":985 * cdef int y = 0 * cdef uint32_t state = SDL_GetMouseState(&x, &y) * return Mouse( # <<<<<<<<<<<<<< * x, y, * (SDL_BUTTON_LMASK & state) > 0, */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Mouse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "pyxelen.pyx":986 * cdef uint32_t state = SDL_GetMouseState(&x, &y) * return Mouse( * x, y, # <<<<<<<<<<<<<< * (SDL_BUTTON_LMASK & state) > 0, * (SDL_BUTTON_MMASK & state) > 0, */ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "pyxelen.pyx":987 * return Mouse( * x, y, * (SDL_BUTTON_LMASK & state) > 0, # <<<<<<<<<<<<<< * (SDL_BUTTON_MMASK & state) > 0, * (SDL_BUTTON_RMASK & state) > 0, */ __pyx_t_5 = __Pyx_PyBool_FromLong(((SDL_BUTTON_LMASK & __pyx_v_state) > 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); /* "pyxelen.pyx":988 * x, y, * (SDL_BUTTON_LMASK & state) > 0, * (SDL_BUTTON_MMASK & state) > 0, # <<<<<<<<<<<<<< * (SDL_BUTTON_RMASK & state) > 0, * (SDL_BUTTON_X1MASK & state) > 0, */ __pyx_t_6 = __Pyx_PyBool_FromLong(((SDL_BUTTON_MMASK & __pyx_v_state) > 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); /* "pyxelen.pyx":989 * (SDL_BUTTON_LMASK & state) > 0, * (SDL_BUTTON_MMASK & state) > 0, * (SDL_BUTTON_RMASK & state) > 0, # <<<<<<<<<<<<<< * (SDL_BUTTON_X1MASK & state) > 0, * (SDL_BUTTON_X2MASK & state) > 0 */ __pyx_t_7 = __Pyx_PyBool_FromLong(((SDL_BUTTON_RMASK & __pyx_v_state) > 0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); /* "pyxelen.pyx":990 * (SDL_BUTTON_MMASK & state) > 0, * (SDL_BUTTON_RMASK & state) > 0, * (SDL_BUTTON_X1MASK & state) > 0, # <<<<<<<<<<<<<< * (SDL_BUTTON_X2MASK & state) > 0 * ) */ __pyx_t_8 = __Pyx_PyBool_FromLong(((SDL_BUTTON_X1MASK & __pyx_v_state) > 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* "pyxelen.pyx":991 * (SDL_BUTTON_RMASK & state) > 0, * (SDL_BUTTON_X1MASK & state) > 0, * (SDL_BUTTON_X2MASK & state) > 0 # <<<<<<<<<<<<<< * ) * */ __pyx_t_9 = __Pyx_PyBool_FromLong(((SDL_BUTTON_X2MASK & __pyx_v_state) > 0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[8] = {__pyx_t_10, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 7+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[8] = {__pyx_t_10, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 7+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { __pyx_t_12 = PyTuple_New(7+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_11, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_11, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 4+__pyx_t_11, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_12, 5+__pyx_t_11, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 6+__pyx_t_11, __pyx_t_9); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pyxelen.pyx":981 * * @property * def mouse(self): # <<<<<<<<<<<<<< * cdef int x = 0 * cdef int y = 0 */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("pyxelen.Controls.mouse", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":995 * * @property * def key_modifiers(self): # <<<<<<<<<<<<<< * cdef uint16_t mod = SDL_GetModState() * return KeyModifiers( */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_8Controls_11key_modifiers(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_8Controls_11key_modifiers = {"key_modifiers", (PyCFunction)__pyx_pw_7pyxelen_8Controls_11key_modifiers, METH_O, 0}; static PyObject *__pyx_pw_7pyxelen_8Controls_11key_modifiers(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("key_modifiers (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_8Controls_10key_modifiers(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_8Controls_10key_modifiers(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { uint16_t __pyx_v_mod; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("key_modifiers", 0); /* "pyxelen.pyx":996 * @property * def key_modifiers(self): * cdef uint16_t mod = SDL_GetModState() # <<<<<<<<<<<<<< * return KeyModifiers( * (KMOD_CTRL & mod) > 0, */ __pyx_v_mod = SDL_GetModState(); /* "pyxelen.pyx":997 * def key_modifiers(self): * cdef uint16_t mod = SDL_GetModState() * return KeyModifiers( # <<<<<<<<<<<<<< * (KMOD_CTRL & mod) > 0, * (KMOD_SHIFT & mod) > 0, */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_KeyModifiers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "pyxelen.pyx":998 * cdef uint16_t mod = SDL_GetModState() * return KeyModifiers( * (KMOD_CTRL & mod) > 0, # <<<<<<<<<<<<<< * (KMOD_SHIFT & mod) > 0, * (KMOD_ALT & mod) > 0 */ __pyx_t_3 = __Pyx_PyBool_FromLong(((KMOD_CTRL & __pyx_v_mod) > 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "pyxelen.pyx":999 * return KeyModifiers( * (KMOD_CTRL & mod) > 0, * (KMOD_SHIFT & mod) > 0, # <<<<<<<<<<<<<< * (KMOD_ALT & mod) > 0 * ) */ __pyx_t_4 = __Pyx_PyBool_FromLong(((KMOD_SHIFT & __pyx_v_mod) > 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); /* "pyxelen.pyx":1000 * (KMOD_CTRL & mod) > 0, * (KMOD_SHIFT & mod) > 0, * (KMOD_ALT & mod) > 0 # <<<<<<<<<<<<<< * ) * */ __pyx_t_5 = __Pyx_PyBool_FromLong(((KMOD_ALT & __pyx_v_mod) > 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_5); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pyxelen.pyx":995 * * @property * def key_modifiers(self): # <<<<<<<<<<<<<< * cdef uint16_t mod = SDL_GetModState() * return KeyModifiers( */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("pyxelen.Controls.key_modifiers", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1008 * cdef SDL_Window *window * * def __dealloc__(self): # <<<<<<<<<<<<<< * SDL_DestroyWindow(self.window) * */ /* Python wrapper */ static void __pyx_pw_7pyxelen_6Window_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_7pyxelen_6Window_1__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_7pyxelen_6Window___dealloc__(((struct __pyx_obj_7pyxelen_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_7pyxelen_6Window___dealloc__(struct __pyx_obj_7pyxelen_Window *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pyxelen.pyx":1009 * * def __dealloc__(self): * SDL_DestroyWindow(self.window) # <<<<<<<<<<<<<< * * def create_renderer(self): */ SDL_DestroyWindow(__pyx_v_self->window); /* "pyxelen.pyx":1008 * cdef SDL_Window *window * * def __dealloc__(self): # <<<<<<<<<<<<<< * SDL_DestroyWindow(self.window) * */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pyxelen.pyx":1011 * SDL_DestroyWindow(self.window) * * def create_renderer(self): # <<<<<<<<<<<<<< * result = Renderer() * result.renderer = SDL_CreateRenderer( */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_6Window_3create_renderer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7pyxelen_6Window_3create_renderer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create_renderer (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_6Window_2create_renderer(((struct __pyx_obj_7pyxelen_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_6Window_2create_renderer(struct __pyx_obj_7pyxelen_Window *__pyx_v_self) { struct __pyx_obj_7pyxelen_Renderer *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("create_renderer", 0); /* "pyxelen.pyx":1012 * * def create_renderer(self): * result = Renderer() # <<<<<<<<<<<<<< * result.renderer = SDL_CreateRenderer( * self.window, -1, */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyxelen_Renderer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((struct __pyx_obj_7pyxelen_Renderer *)__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1013 * def create_renderer(self): * result = Renderer() * result.renderer = SDL_CreateRenderer( # <<<<<<<<<<<<<< * self.window, -1, * SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE */ __pyx_v_result->renderer = SDL_CreateRenderer(__pyx_v_self->window, -1, (SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE)); /* "pyxelen.pyx":1017 * SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE * ) * return result # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "pyxelen.pyx":1011 * SDL_DestroyWindow(self.window) * * def create_renderer(self): # <<<<<<<<<<<<<< * result = Renderer() * result.renderer = SDL_CreateRenderer( */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Window.create_renderer", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1020 * * @property * def window_id(self): # <<<<<<<<<<<<<< * return SDL_GetWindowID(self.window) * */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_6Window_9window_id_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7pyxelen_6Window_9window_id_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_6Window_9window_id___get__(((struct __pyx_obj_7pyxelen_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_6Window_9window_id___get__(struct __pyx_obj_7pyxelen_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); /* "pyxelen.pyx":1021 * @property * def window_id(self): * return SDL_GetWindowID(self.window) # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_uint32_t(SDL_GetWindowID(__pyx_v_self->window)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1021, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "pyxelen.pyx":1020 * * @property * def window_id(self): # <<<<<<<<<<<<<< * return SDL_GetWindowID(self.window) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Window.window_id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1024 * * @property * def size(self): # <<<<<<<<<<<<<< * cdef int w * cdef int h */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_6Window_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7pyxelen_6Window_4size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_6Window_4size___get__(((struct __pyx_obj_7pyxelen_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_6Window_4size___get__(struct __pyx_obj_7pyxelen_Window *__pyx_v_self) { int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__get__", 0); /* "pyxelen.pyx":1027 * cdef int w * cdef int h * SDL_GetWindowSize(self.window, &w, &h) # <<<<<<<<<<<<<< * return w, h * */ SDL_GetWindowSize(__pyx_v_self->window, (&__pyx_v_w), (&__pyx_v_h)); /* "pyxelen.pyx":1028 * cdef int h * SDL_GetWindowSize(self.window, &w, &h) * return w, h # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1028, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1028, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pyxelen.pyx":1024 * * @property * def size(self): # <<<<<<<<<<<<<< * cdef int w * cdef int h */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pyxelen.Window.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("self.window cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_6Window_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7pyxelen_6Window_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_6Window_4__reduce_cython__(((struct __pyx_obj_7pyxelen_Window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_6Window_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("self.window cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.window cannot be converted to a Python object for pickling") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("self.window cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Window.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("self.window cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("self.window cannot be converted to a Python object for pickling") */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_6Window_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_7pyxelen_6Window_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_6Window_6__setstate_cython__(((struct __pyx_obj_7pyxelen_Window *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_6Window_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("self.window cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.window cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("self.window cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("self.window cannot be converted to a Python object for pickling") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Window.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1035 * cdef SDL_Surface *surface * * def __dealloc__(self): # <<<<<<<<<<<<<< * SDL_FreeSurface(self.surface) * */ /* Python wrapper */ static void __pyx_pw_7pyxelen_7Surface_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_7pyxelen_7Surface_1__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_7pyxelen_7Surface___dealloc__(((struct __pyx_obj_7pyxelen_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_7pyxelen_7Surface___dealloc__(struct __pyx_obj_7pyxelen_Surface *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pyxelen.pyx":1036 * * def __dealloc__(self): * SDL_FreeSurface(self.surface) # <<<<<<<<<<<<<< * * */ SDL_FreeSurface(__pyx_v_self->surface); /* "pyxelen.pyx":1035 * cdef SDL_Surface *surface * * def __dealloc__(self): # <<<<<<<<<<<<<< * SDL_FreeSurface(self.surface) * */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("self.surface cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_7Surface_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7pyxelen_7Surface_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_7Surface_2__reduce_cython__(((struct __pyx_obj_7pyxelen_Surface *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_7Surface_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Surface *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("self.surface cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.surface cannot be converted to a Python object for pickling") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("self.surface cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Surface.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("self.surface cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("self.surface cannot be converted to a Python object for pickling") */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_7Surface_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_7pyxelen_7Surface_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_7Surface_4__setstate_cython__(((struct __pyx_obj_7pyxelen_Surface *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_7Surface_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("self.surface cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.surface cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("self.surface cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("self.surface cannot be converted to a Python object for pickling") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Surface.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1043 * cdef SDL_Texture *texture * * def __dealloc__(self): # <<<<<<<<<<<<<< * SDL_DestroyTexture(self.texture) * */ /* Python wrapper */ static void __pyx_pw_7pyxelen_7Texture_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_7pyxelen_7Texture_1__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_7pyxelen_7Texture___dealloc__(((struct __pyx_obj_7pyxelen_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_7pyxelen_7Texture___dealloc__(struct __pyx_obj_7pyxelen_Texture *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pyxelen.pyx":1044 * * def __dealloc__(self): * SDL_DestroyTexture(self.texture) # <<<<<<<<<<<<<< * * @property */ SDL_DestroyTexture(__pyx_v_self->texture); /* "pyxelen.pyx":1043 * cdef SDL_Texture *texture * * def __dealloc__(self): # <<<<<<<<<<<<<< * SDL_DestroyTexture(self.texture) * */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pyxelen.pyx":1047 * * @property * def size(self): # <<<<<<<<<<<<<< * cdef uint32_t pixel_format * cdef int access */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_7Texture_4size_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7pyxelen_7Texture_4size_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_7Texture_4size___get__(((struct __pyx_obj_7pyxelen_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_7Texture_4size___get__(struct __pyx_obj_7pyxelen_Texture *__pyx_v_self) { uint32_t __pyx_v_pixel_format; int __pyx_v_access; int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__get__", 0); /* "pyxelen.pyx":1052 * cdef int w * cdef int h * SDL_QueryTexture(self.texture, &pixel_format, &access, &w, &h) # <<<<<<<<<<<<<< * return w, h * */ (void)(SDL_QueryTexture(__pyx_v_self->texture, (&__pyx_v_pixel_format), (&__pyx_v_access), (&__pyx_v_w), (&__pyx_v_h))); /* "pyxelen.pyx":1053 * cdef int h * SDL_QueryTexture(self.texture, &pixel_format, &access, &w, &h) * return w, h # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pyxelen.pyx":1047 * * @property * def size(self): # <<<<<<<<<<<<<< * cdef uint32_t pixel_format * cdef int access */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pyxelen.Texture.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("self.texture cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_7Texture_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7pyxelen_7Texture_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_7Texture_2__reduce_cython__(((struct __pyx_obj_7pyxelen_Texture *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_7Texture_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Texture *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("self.texture cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.texture cannot be converted to a Python object for pickling") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("self.texture cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Texture.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("self.texture cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("self.texture cannot be converted to a Python object for pickling") */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_7Texture_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_7pyxelen_7Texture_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_7Texture_4__setstate_cython__(((struct __pyx_obj_7pyxelen_Texture *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_7Texture_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Texture *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("self.texture cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.texture cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("self.texture cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("self.texture cannot be converted to a Python object for pickling") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Texture.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1060 * cdef SDL_Renderer *renderer * * def __dealloc__(self): # <<<<<<<<<<<<<< * SDL_DestroyRenderer(self.renderer) * */ /* Python wrapper */ static void __pyx_pw_7pyxelen_8Renderer_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pw_7pyxelen_8Renderer_1__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0); __pyx_pf_7pyxelen_8Renderer___dealloc__(((struct __pyx_obj_7pyxelen_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); } static void __pyx_pf_7pyxelen_8Renderer___dealloc__(struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); /* "pyxelen.pyx":1061 * * def __dealloc__(self): * SDL_DestroyRenderer(self.renderer) # <<<<<<<<<<<<<< * * def create_texture(self, int w, int h): */ SDL_DestroyRenderer(__pyx_v_self->renderer); /* "pyxelen.pyx":1060 * cdef SDL_Renderer *renderer * * def __dealloc__(self): # <<<<<<<<<<<<<< * SDL_DestroyRenderer(self.renderer) * */ /* function exit code */ __Pyx_RefNannyFinishContext(); } /* "pyxelen.pyx":1063 * SDL_DestroyRenderer(self.renderer) * * def create_texture(self, int w, int h): # <<<<<<<<<<<<<< * result = Texture() * result.texture = SDL_CreateTexture( */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_8Renderer_3create_texture(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7pyxelen_8Renderer_3create_texture(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_w; int __pyx_v_h; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create_texture (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_w,&__pyx_n_s_h,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("create_texture", 1, 2, 2, 1); __PYX_ERR(0, 1063, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create_texture") < 0)) __PYX_ERR(0, 1063, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_w = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_w == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1063, __pyx_L3_error) __pyx_v_h = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_h == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1063, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("create_texture", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1063, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxelen.Renderer.create_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7pyxelen_8Renderer_2create_texture(((struct __pyx_obj_7pyxelen_Renderer *)__pyx_v_self), __pyx_v_w, __pyx_v_h); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_8Renderer_2create_texture(struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self, int __pyx_v_w, int __pyx_v_h) { struct __pyx_obj_7pyxelen_Texture *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("create_texture", 0); /* "pyxelen.pyx":1064 * * def create_texture(self, int w, int h): * result = Texture() # <<<<<<<<<<<<<< * result.texture = SDL_CreateTexture( * self.renderer, */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyxelen_Texture)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((struct __pyx_obj_7pyxelen_Texture *)__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1065 * def create_texture(self, int w, int h): * result = Texture() * result.texture = SDL_CreateTexture( # <<<<<<<<<<<<<< * self.renderer, * SDL_PIXELFORMAT_RGBA8888, */ __pyx_v_result->texture = SDL_CreateTexture(__pyx_v_self->renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, __pyx_v_w, __pyx_v_h); /* "pyxelen.pyx":1070 * SDL_TEXTUREACCESS_TARGET, w, h * ) * return result # <<<<<<<<<<<<<< * * def create_texture_from_surface(self, Surface surface): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "pyxelen.pyx":1063 * SDL_DestroyRenderer(self.renderer) * * def create_texture(self, int w, int h): # <<<<<<<<<<<<<< * result = Texture() * result.texture = SDL_CreateTexture( */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Renderer.create_texture", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1072 * return result * * def create_texture_from_surface(self, Surface surface): # <<<<<<<<<<<<<< * result = Texture() * result.texture = SDL_CreateTextureFromSurface( */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_8Renderer_5create_texture_from_surface(PyObject *__pyx_v_self, PyObject *__pyx_v_surface); /*proto*/ static PyObject *__pyx_pw_7pyxelen_8Renderer_5create_texture_from_surface(PyObject *__pyx_v_self, PyObject *__pyx_v_surface) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create_texture_from_surface (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_surface), __pyx_ptype_7pyxelen_Surface, 1, "surface", 0))) __PYX_ERR(0, 1072, __pyx_L1_error) __pyx_r = __pyx_pf_7pyxelen_8Renderer_4create_texture_from_surface(((struct __pyx_obj_7pyxelen_Renderer *)__pyx_v_self), ((struct __pyx_obj_7pyxelen_Surface *)__pyx_v_surface)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_8Renderer_4create_texture_from_surface(struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self, struct __pyx_obj_7pyxelen_Surface *__pyx_v_surface) { struct __pyx_obj_7pyxelen_Texture *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("create_texture_from_surface", 0); /* "pyxelen.pyx":1073 * * def create_texture_from_surface(self, Surface surface): * result = Texture() # <<<<<<<<<<<<<< * result.texture = SDL_CreateTextureFromSurface( * self.renderer, */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyxelen_Texture)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1073, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((struct __pyx_obj_7pyxelen_Texture *)__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1074 * def create_texture_from_surface(self, Surface surface): * result = Texture() * result.texture = SDL_CreateTextureFromSurface( # <<<<<<<<<<<<<< * self.renderer, * surface.surface */ __pyx_v_result->texture = SDL_CreateTextureFromSurface(__pyx_v_self->renderer, __pyx_v_surface->surface); /* "pyxelen.pyx":1078 * surface.surface * ) * return result # <<<<<<<<<<<<<< * * def create_texture_from_image(self, str filename): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "pyxelen.pyx":1072 * return result * * def create_texture_from_surface(self, Surface surface): # <<<<<<<<<<<<<< * result = Texture() * result.texture = SDL_CreateTextureFromSurface( */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Renderer.create_texture_from_surface", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1080 * return result * * def create_texture_from_image(self, str filename): # <<<<<<<<<<<<<< * result = Texture() * result.texture = IMG_LoadTexture( */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_8Renderer_7create_texture_from_image(PyObject *__pyx_v_self, PyObject *__pyx_v_filename); /*proto*/ static PyObject *__pyx_pw_7pyxelen_8Renderer_7create_texture_from_image(PyObject *__pyx_v_self, PyObject *__pyx_v_filename) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("create_texture_from_image (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_filename), (&PyString_Type), 1, "filename", 1))) __PYX_ERR(0, 1080, __pyx_L1_error) __pyx_r = __pyx_pf_7pyxelen_8Renderer_6create_texture_from_image(((struct __pyx_obj_7pyxelen_Renderer *)__pyx_v_self), ((PyObject*)__pyx_v_filename)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_8Renderer_6create_texture_from_image(struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self, PyObject *__pyx_v_filename) { struct __pyx_obj_7pyxelen_Texture *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; __Pyx_RefNannySetupContext("create_texture_from_image", 0); /* "pyxelen.pyx":1081 * * def create_texture_from_image(self, str filename): * result = Texture() # <<<<<<<<<<<<<< * result.texture = IMG_LoadTexture( * self.renderer, */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyxelen_Texture)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((struct __pyx_obj_7pyxelen_Texture *)__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1084 * result.texture = IMG_LoadTexture( * self.renderer, * filename.encode('utf-8') # <<<<<<<<<<<<<< * ) * return result */ __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_filename, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 1084, __pyx_L1_error) /* "pyxelen.pyx":1082 * def create_texture_from_image(self, str filename): * result = Texture() * result.texture = IMG_LoadTexture( # <<<<<<<<<<<<<< * self.renderer, * filename.encode('utf-8') */ __pyx_v_result->texture = IMG_LoadTexture(__pyx_v_self->renderer, __pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1086 * filename.encode('utf-8') * ) * return result # <<<<<<<<<<<<<< * * @property */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "pyxelen.pyx":1080 * return result * * def create_texture_from_image(self, str filename): # <<<<<<<<<<<<<< * result = Texture() * result.texture = IMG_LoadTexture( */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Renderer.create_texture_from_image", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1089 * * @property * def draw_color(self): # <<<<<<<<<<<<<< * raise NotImplemented() * */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_8Renderer_10draw_color_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7pyxelen_8Renderer_10draw_color_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_8Renderer_10draw_color___get__(((struct __pyx_obj_7pyxelen_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_8Renderer_10draw_color___get__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); /* "pyxelen.pyx":1090 * @property * def draw_color(self): * raise NotImplemented() # <<<<<<<<<<<<<< * * @draw_color.setter */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplemented); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 1090, __pyx_L1_error) /* "pyxelen.pyx":1089 * * @property * def draw_color(self): # <<<<<<<<<<<<<< * raise NotImplemented() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Renderer.draw_color.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1093 * * @draw_color.setter * def draw_color(self, color): # <<<<<<<<<<<<<< * r, g, b, a = color * SDL_SetRenderDrawColor(self.renderer, r, g, b, a) */ /* Python wrapper */ static int __pyx_pw_7pyxelen_8Renderer_10draw_color_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_color); /*proto*/ static int __pyx_pw_7pyxelen_8Renderer_10draw_color_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_color) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_8Renderer_10draw_color_2__set__(((struct __pyx_obj_7pyxelen_Renderer *)__pyx_v_self), ((PyObject *)__pyx_v_color)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7pyxelen_8Renderer_10draw_color_2__set__(struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self, PyObject *__pyx_v_color) { PyObject *__pyx_v_r = NULL; PyObject *__pyx_v_g = NULL; PyObject *__pyx_v_b = NULL; PyObject *__pyx_v_a = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *(*__pyx_t_6)(PyObject *); uint8_t __pyx_t_7; uint8_t __pyx_t_8; uint8_t __pyx_t_9; uint8_t __pyx_t_10; __Pyx_RefNannySetupContext("__set__", 0); /* "pyxelen.pyx":1094 * @draw_color.setter * def draw_color(self, color): * r, g, b, a = color # <<<<<<<<<<<<<< * SDL_SetRenderDrawColor(self.renderer, r, g, b, a) * */ if ((likely(PyTuple_CheckExact(__pyx_v_color))) || (PyList_CheckExact(__pyx_v_color))) { PyObject* sequence = __pyx_v_color; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 1094, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); } else { __pyx_t_1 = PyList_GET_ITEM(sequence, 0); __pyx_t_2 = PyList_GET_ITEM(sequence, 1); __pyx_t_3 = PyList_GET_ITEM(sequence, 2); __pyx_t_4 = PyList_GET_ITEM(sequence, 3); } __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); #else { Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4}; for (i=0; i < 4; i++) { PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 1094, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } } #endif } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4}; __pyx_t_5 = PyObject_GetIter(__pyx_v_color); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; for (index=0; index < 4; index++) { PyObject* item = __pyx_t_6(__pyx_t_5); if (unlikely(!item)) goto __pyx_L3_unpacking_failed; __Pyx_GOTREF(item); *(temps[index]) = item; } if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 4) < 0) __PYX_ERR(0, 1094, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_unpacking_done; __pyx_L3_unpacking_failed:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 1094, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_r = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_g = __pyx_t_2; __pyx_t_2 = 0; __pyx_v_b = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_a = __pyx_t_4; __pyx_t_4 = 0; /* "pyxelen.pyx":1095 * def draw_color(self, color): * r, g, b, a = color * SDL_SetRenderDrawColor(self.renderer, r, g, b, a) # <<<<<<<<<<<<<< * * def copy(self, */ __pyx_t_7 = __Pyx_PyInt_As_uint8_t(__pyx_v_r); if (unlikely((__pyx_t_7 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error) __pyx_t_8 = __Pyx_PyInt_As_uint8_t(__pyx_v_g); if (unlikely((__pyx_t_8 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error) __pyx_t_9 = __Pyx_PyInt_As_uint8_t(__pyx_v_b); if (unlikely((__pyx_t_9 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error) __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_v_a); if (unlikely((__pyx_t_10 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error) (void)(SDL_SetRenderDrawColor(__pyx_v_self->renderer, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10)); /* "pyxelen.pyx":1093 * * @draw_color.setter * def draw_color(self, color): # <<<<<<<<<<<<<< * r, g, b, a = color * SDL_SetRenderDrawColor(self.renderer, r, g, b, a) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("pyxelen.Renderer.draw_color.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XDECREF(__pyx_v_g); __Pyx_XDECREF(__pyx_v_b); __Pyx_XDECREF(__pyx_v_a); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1097 * SDL_SetRenderDrawColor(self.renderer, r, g, b, a) * * def copy(self, # <<<<<<<<<<<<<< * Texture texture, * int src_x, int src_y, int src_w, int src_h, */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_8Renderer_9copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7pyxelen_8Renderer_9copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_7pyxelen_Texture *__pyx_v_texture = 0; int __pyx_v_src_x; int __pyx_v_src_y; int __pyx_v_src_w; int __pyx_v_src_h; int __pyx_v_dst_x; int __pyx_v_dst_y; int __pyx_v_dst_w; int __pyx_v_dst_h; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("copy (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_texture,&__pyx_n_s_src_x,&__pyx_n_s_src_y,&__pyx_n_s_src_w,&__pyx_n_s_src_h,&__pyx_n_s_dst_x,&__pyx_n_s_dst_y,&__pyx_n_s_dst_w,&__pyx_n_s_dst_h,0}; PyObject* values[9] = {0,0,0,0,0,0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8); CYTHON_FALLTHROUGH; case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7); CYTHON_FALLTHROUGH; case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6); CYTHON_FALLTHROUGH; case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_texture)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_src_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("copy", 1, 9, 9, 1); __PYX_ERR(0, 1097, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_src_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("copy", 1, 9, 9, 2); __PYX_ERR(0, 1097, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_src_w)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("copy", 1, 9, 9, 3); __PYX_ERR(0, 1097, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_src_h)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("copy", 1, 9, 9, 4); __PYX_ERR(0, 1097, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dst_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("copy", 1, 9, 9, 5); __PYX_ERR(0, 1097, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dst_y)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("copy", 1, 9, 9, 6); __PYX_ERR(0, 1097, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dst_w)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("copy", 1, 9, 9, 7); __PYX_ERR(0, 1097, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 8: if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dst_h)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("copy", 1, 9, 9, 8); __PYX_ERR(0, 1097, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy") < 0)) __PYX_ERR(0, 1097, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 9) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); values[4] = PyTuple_GET_ITEM(__pyx_args, 4); values[5] = PyTuple_GET_ITEM(__pyx_args, 5); values[6] = PyTuple_GET_ITEM(__pyx_args, 6); values[7] = PyTuple_GET_ITEM(__pyx_args, 7); values[8] = PyTuple_GET_ITEM(__pyx_args, 8); } __pyx_v_texture = ((struct __pyx_obj_7pyxelen_Texture *)values[0]); __pyx_v_src_x = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_src_x == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1099, __pyx_L3_error) __pyx_v_src_y = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_src_y == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1099, __pyx_L3_error) __pyx_v_src_w = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_src_w == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1099, __pyx_L3_error) __pyx_v_src_h = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_src_h == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1099, __pyx_L3_error) __pyx_v_dst_x = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_dst_x == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1100, __pyx_L3_error) __pyx_v_dst_y = __Pyx_PyInt_As_int(values[6]); if (unlikely((__pyx_v_dst_y == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1100, __pyx_L3_error) __pyx_v_dst_w = __Pyx_PyInt_As_int(values[7]); if (unlikely((__pyx_v_dst_w == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1100, __pyx_L3_error) __pyx_v_dst_h = __Pyx_PyInt_As_int(values[8]); if (unlikely((__pyx_v_dst_h == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1100, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("copy", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1097, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxelen.Renderer.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_texture), __pyx_ptype_7pyxelen_Texture, 1, "texture", 0))) __PYX_ERR(0, 1098, __pyx_L1_error) __pyx_r = __pyx_pf_7pyxelen_8Renderer_8copy(((struct __pyx_obj_7pyxelen_Renderer *)__pyx_v_self), __pyx_v_texture, __pyx_v_src_x, __pyx_v_src_y, __pyx_v_src_w, __pyx_v_src_h, __pyx_v_dst_x, __pyx_v_dst_y, __pyx_v_dst_w, __pyx_v_dst_h); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_8Renderer_8copy(struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self, struct __pyx_obj_7pyxelen_Texture *__pyx_v_texture, int __pyx_v_src_x, int __pyx_v_src_y, int __pyx_v_src_w, int __pyx_v_src_h, int __pyx_v_dst_x, int __pyx_v_dst_y, int __pyx_v_dst_w, int __pyx_v_dst_h) { struct SDL_Rect __pyx_v_src; struct SDL_Rect __pyx_v_dst; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations struct SDL_Rect __pyx_t_1; __Pyx_RefNannySetupContext("copy", 0); /* "pyxelen.pyx":1101 * int src_x, int src_y, int src_w, int src_h, * int dst_x, int dst_y, int dst_w, int dst_h): * cdef SDL_Rect src = SDL_Rect(src_x, src_y, src_w, src_h) # <<<<<<<<<<<<<< * cdef SDL_Rect dst = SDL_Rect(dst_x, dst_y, dst_w, dst_h) * SDL_RenderCopy(self.renderer, texture.texture, &src, &dst) */ __pyx_t_1.x = __pyx_v_src_x; __pyx_t_1.y = __pyx_v_src_y; __pyx_t_1.w = __pyx_v_src_w; __pyx_t_1.h = __pyx_v_src_h; __pyx_v_src = __pyx_t_1; /* "pyxelen.pyx":1102 * int dst_x, int dst_y, int dst_w, int dst_h): * cdef SDL_Rect src = SDL_Rect(src_x, src_y, src_w, src_h) * cdef SDL_Rect dst = SDL_Rect(dst_x, dst_y, dst_w, dst_h) # <<<<<<<<<<<<<< * SDL_RenderCopy(self.renderer, texture.texture, &src, &dst) * */ __pyx_t_1.x = __pyx_v_dst_x; __pyx_t_1.y = __pyx_v_dst_y; __pyx_t_1.w = __pyx_v_dst_w; __pyx_t_1.h = __pyx_v_dst_h; __pyx_v_dst = __pyx_t_1; /* "pyxelen.pyx":1103 * cdef SDL_Rect src = SDL_Rect(src_x, src_y, src_w, src_h) * cdef SDL_Rect dst = SDL_Rect(dst_x, dst_y, dst_w, dst_h) * SDL_RenderCopy(self.renderer, texture.texture, &src, &dst) # <<<<<<<<<<<<<< * * @property */ (void)(SDL_RenderCopy(__pyx_v_self->renderer, __pyx_v_texture->texture, (&__pyx_v_src), (&__pyx_v_dst))); /* "pyxelen.pyx":1097 * SDL_SetRenderDrawColor(self.renderer, r, g, b, a) * * def copy(self, # <<<<<<<<<<<<<< * Texture texture, * int src_x, int src_y, int src_w, int src_h, */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1106 * * @property * def target(self): # <<<<<<<<<<<<<< * raise NotImplemented() * */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_8Renderer_6target_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7pyxelen_8Renderer_6target_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_8Renderer_6target___get__(((struct __pyx_obj_7pyxelen_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_8Renderer_6target___get__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); /* "pyxelen.pyx":1107 * @property * def target(self): * raise NotImplemented() # <<<<<<<<<<<<<< * * @target.setter */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_NotImplemented); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(0, 1107, __pyx_L1_error) /* "pyxelen.pyx":1106 * * @property * def target(self): # <<<<<<<<<<<<<< * raise NotImplemented() * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Renderer.target.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1110 * * @target.setter * def target(self, Texture target): # <<<<<<<<<<<<<< * if target is None: * SDL_SetRenderTarget(self.renderer, NULL) */ /* Python wrapper */ static int __pyx_pw_7pyxelen_8Renderer_6target_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_target); /*proto*/ static int __pyx_pw_7pyxelen_8Renderer_6target_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_target) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_target), __pyx_ptype_7pyxelen_Texture, 1, "target", 0))) __PYX_ERR(0, 1110, __pyx_L1_error) __pyx_r = __pyx_pf_7pyxelen_8Renderer_6target_2__set__(((struct __pyx_obj_7pyxelen_Renderer *)__pyx_v_self), ((struct __pyx_obj_7pyxelen_Texture *)__pyx_v_target)); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7pyxelen_8Renderer_6target_2__set__(struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self, struct __pyx_obj_7pyxelen_Texture *__pyx_v_target) { int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("__set__", 0); /* "pyxelen.pyx":1111 * @target.setter * def target(self, Texture target): * if target is None: # <<<<<<<<<<<<<< * SDL_SetRenderTarget(self.renderer, NULL) * else: */ __pyx_t_1 = (((PyObject *)__pyx_v_target) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "pyxelen.pyx":1112 * def target(self, Texture target): * if target is None: * SDL_SetRenderTarget(self.renderer, NULL) # <<<<<<<<<<<<<< * else: * SDL_SetRenderTarget(self.renderer, target.texture) */ (void)(SDL_SetRenderTarget(__pyx_v_self->renderer, NULL)); /* "pyxelen.pyx":1111 * @target.setter * def target(self, Texture target): * if target is None: # <<<<<<<<<<<<<< * SDL_SetRenderTarget(self.renderer, NULL) * else: */ goto __pyx_L3; } /* "pyxelen.pyx":1114 * SDL_SetRenderTarget(self.renderer, NULL) * else: * SDL_SetRenderTarget(self.renderer, target.texture) # <<<<<<<<<<<<<< * * def clear(self): */ /*else*/ { (void)(SDL_SetRenderTarget(__pyx_v_self->renderer, __pyx_v_target->texture)); } __pyx_L3:; /* "pyxelen.pyx":1110 * * @target.setter * def target(self, Texture target): # <<<<<<<<<<<<<< * if target is None: * SDL_SetRenderTarget(self.renderer, NULL) */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1116 * SDL_SetRenderTarget(self.renderer, target.texture) * * def clear(self): # <<<<<<<<<<<<<< * SDL_RenderClear(self.renderer) * */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_8Renderer_11clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7pyxelen_8Renderer_11clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clear (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_8Renderer_10clear(((struct __pyx_obj_7pyxelen_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_8Renderer_10clear(struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("clear", 0); /* "pyxelen.pyx":1117 * * def clear(self): * SDL_RenderClear(self.renderer) # <<<<<<<<<<<<<< * * def present(self): */ (void)(SDL_RenderClear(__pyx_v_self->renderer)); /* "pyxelen.pyx":1116 * SDL_SetRenderTarget(self.renderer, target.texture) * * def clear(self): # <<<<<<<<<<<<<< * SDL_RenderClear(self.renderer) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1119 * SDL_RenderClear(self.renderer) * * def present(self): # <<<<<<<<<<<<<< * SDL_RenderPresent(self.renderer) * */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_8Renderer_13present(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7pyxelen_8Renderer_13present(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("present (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_8Renderer_12present(((struct __pyx_obj_7pyxelen_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_8Renderer_12present(struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("present", 0); /* "pyxelen.pyx":1120 * * def present(self): * SDL_RenderPresent(self.renderer) # <<<<<<<<<<<<<< * * */ SDL_RenderPresent(__pyx_v_self->renderer); /* "pyxelen.pyx":1119 * SDL_RenderClear(self.renderer) * * def present(self): # <<<<<<<<<<<<<< * SDL_RenderPresent(self.renderer) * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("self.renderer cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_8Renderer_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pw_7pyxelen_8Renderer_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_8Renderer_14__reduce_cython__(((struct __pyx_obj_7pyxelen_Renderer *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_8Renderer_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("self.renderer cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.renderer cannot be converted to a Python object for pickling") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("self.renderer cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Renderer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("self.renderer cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("self.renderer cannot be converted to a Python object for pickling") */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_8Renderer_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static PyObject *__pyx_pw_7pyxelen_8Renderer_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_8Renderer_16__setstate_cython__(((struct __pyx_obj_7pyxelen_Renderer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_8Renderer_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyxelen_Renderer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("self.renderer cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.renderer cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __PYX_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("self.renderer cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("self.renderer cannot be converted to a Python object for pickling") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Renderer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1125 * class Pyxelen: * * def __init__(self): # <<<<<<<<<<<<<< * self.audio = Audio() * self.controls = Controls() */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_7Pyxelen_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_7Pyxelen_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7pyxelen_7Pyxelen_1__init__, METH_O, 0}; static PyObject *__pyx_pw_7pyxelen_7Pyxelen_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_7Pyxelen___init__(__pyx_self, ((PyObject *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_7Pyxelen___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__init__", 0); /* "pyxelen.pyx":1126 * * def __init__(self): * self.audio = Audio() # <<<<<<<<<<<<<< * self.controls = Controls() * self._windows = [] */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Audio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_audio, __pyx_t_1) < 0) __PYX_ERR(0, 1126, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1127 * def __init__(self): * self.audio = Audio() * self.controls = Controls() # <<<<<<<<<<<<<< * self._windows = [] * */ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Controls); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1127, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_controls, __pyx_t_1) < 0) __PYX_ERR(0, 1127, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1128 * self.audio = Audio() * self.controls = Controls() * self._windows = [] # <<<<<<<<<<<<<< * * def open_window(self, str title, int width, int height): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_windows, __pyx_t_1) < 0) __PYX_ERR(0, 1128, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1125 * class Pyxelen: * * def __init__(self): # <<<<<<<<<<<<<< * self.audio = Audio() * self.controls = Controls() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pyxelen.Pyxelen.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1130 * self._windows = [] * * def open_window(self, str title, int width, int height): # <<<<<<<<<<<<<< * result = Window() * result.window = SDL_CreateWindow( */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_7Pyxelen_3open_window(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_7Pyxelen_3open_window = {"open_window", (PyCFunction)__pyx_pw_7pyxelen_7Pyxelen_3open_window, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7pyxelen_7Pyxelen_3open_window(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_title = 0; int __pyx_v_width; int __pyx_v_height; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("open_window (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_title,&__pyx_n_s_width,&__pyx_n_s_height,0}; PyObject* values[4] = {0,0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_title)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("open_window", 1, 4, 4, 1); __PYX_ERR(0, 1130, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("open_window", 1, 4, 4, 2); __PYX_ERR(0, 1130, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_height)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("open_window", 1, 4, 4, 3); __PYX_ERR(0, 1130, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open_window") < 0)) __PYX_ERR(0, 1130, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); values[3] = PyTuple_GET_ITEM(__pyx_args, 3); } __pyx_v_self = values[0]; __pyx_v_title = ((PyObject*)values[1]); __pyx_v_width = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_width == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1130, __pyx_L3_error) __pyx_v_height = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_height == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1130, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("open_window", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1130, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxelen.Pyxelen.open_window", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_title), (&PyString_Type), 1, "title", 1))) __PYX_ERR(0, 1130, __pyx_L1_error) __pyx_r = __pyx_pf_7pyxelen_7Pyxelen_2open_window(__pyx_self, __pyx_v_self, __pyx_v_title, __pyx_v_width, __pyx_v_height); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_7Pyxelen_2open_window(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_title, int __pyx_v_width, int __pyx_v_height) { struct __pyx_obj_7pyxelen_Window *__pyx_v_result = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; char const *__pyx_t_2; int __pyx_t_3; __Pyx_RefNannySetupContext("open_window", 0); /* "pyxelen.pyx":1131 * * def open_window(self, str title, int width, int height): * result = Window() # <<<<<<<<<<<<<< * result.window = SDL_CreateWindow( * title.encode('utf-8'), */ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyxelen_Window)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((struct __pyx_obj_7pyxelen_Window *)__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1133 * result = Window() * result.window = SDL_CreateWindow( * title.encode('utf-8'), # <<<<<<<<<<<<<< * SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, * width, height, */ __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyString_Type_encode, __pyx_v_title, __pyx_kp_s_utf_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_t_1); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 1133, __pyx_L1_error) /* "pyxelen.pyx":1132 * def open_window(self, str title, int width, int height): * result = Window() * result.window = SDL_CreateWindow( # <<<<<<<<<<<<<< * title.encode('utf-8'), * SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, */ __pyx_v_result->window = SDL_CreateWindow(__pyx_t_2, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, __pyx_v_width, __pyx_v_height, (SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE)); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1138 * SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE * ) * self._windows.append(result) # <<<<<<<<<<<<<< * return result * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_windows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_1, ((PyObject *)__pyx_v_result)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1139 * ) * self._windows.append(result) * return result # <<<<<<<<<<<<<< * * def close_window(self, Window window): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_result)); __pyx_r = ((PyObject *)__pyx_v_result); goto __pyx_L0; /* "pyxelen.pyx":1130 * self._windows = [] * * def open_window(self, str title, int width, int height): # <<<<<<<<<<<<<< * result = Window() * result.window = SDL_CreateWindow( */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("pyxelen.Pyxelen.open_window", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1141 * return result * * def close_window(self, Window window): # <<<<<<<<<<<<<< * self._windows = [w for w in self._windows if w is not window] * */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_7Pyxelen_5close_window(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_7Pyxelen_5close_window = {"close_window", (PyCFunction)__pyx_pw_7pyxelen_7Pyxelen_5close_window, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7pyxelen_7Pyxelen_5close_window(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; struct __pyx_obj_7pyxelen_Window *__pyx_v_window = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("close_window (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_window,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_window)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("close_window", 1, 2, 2, 1); __PYX_ERR(0, 1141, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "close_window") < 0)) __PYX_ERR(0, 1141, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_window = ((struct __pyx_obj_7pyxelen_Window *)values[1]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("close_window", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1141, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxelen.Pyxelen.close_window", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_window), __pyx_ptype_7pyxelen_Window, 1, "window", 0))) __PYX_ERR(0, 1141, __pyx_L1_error) __pyx_r = __pyx_pf_7pyxelen_7Pyxelen_4close_window(__pyx_self, __pyx_v_self, __pyx_v_window); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_7Pyxelen_4close_window(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7pyxelen_Window *__pyx_v_window) { PyObject *__pyx_v_w = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); int __pyx_t_6; int __pyx_t_7; __Pyx_RefNannySetupContext("close_window", 0); /* "pyxelen.pyx":1142 * * def close_window(self, Window window): * self._windows = [w for w in self._windows if w is not window] # <<<<<<<<<<<<<< * * def _find_window(self, int window_id): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_windows); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1142, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1142, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1142, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 1142, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = (__pyx_v_w != ((PyObject *)__pyx_v_window)); __pyx_t_7 = (__pyx_t_6 != 0); if (__pyx_t_7) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_w))) __PYX_ERR(0, 1142, __pyx_L1_error) } } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_windows, __pyx_t_1) < 0) __PYX_ERR(0, 1142, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1141 * return result * * def close_window(self, Window window): # <<<<<<<<<<<<<< * self._windows = [w for w in self._windows if w is not window] * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("pyxelen.Pyxelen.close_window", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_w); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1144 * self._windows = [w for w in self._windows if w is not window] * * def _find_window(self, int window_id): # <<<<<<<<<<<<<< * return [ * w for w in self._windows */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_7Pyxelen_7_find_window(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_7Pyxelen_7_find_window = {"_find_window", (PyCFunction)__pyx_pw_7pyxelen_7Pyxelen_7_find_window, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7pyxelen_7Pyxelen_7_find_window(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; int __pyx_v_window_id; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_find_window (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_window_id,0}; PyObject* values[2] = {0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_window_id)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_find_window", 1, 2, 2, 1); __PYX_ERR(0, 1144, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_find_window") < 0)) __PYX_ERR(0, 1144, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_window_id = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_window_id == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1144, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_find_window", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1144, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxelen.Pyxelen._find_window", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7pyxelen_7Pyxelen_6_find_window(__pyx_self, __pyx_v_self, __pyx_v_window_id); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_7Pyxelen_6_find_window(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, int __pyx_v_window_id) { PyObject *__pyx_v_w = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; __Pyx_RefNannySetupContext("_find_window", 0); /* "pyxelen.pyx":1145 * * def _find_window(self, int window_id): * return [ # <<<<<<<<<<<<<< * w for w in self._windows * if w.window_id == window_id */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "pyxelen.pyx":1146 * def _find_window(self, int window_id): * return [ * w for w in self._windows # <<<<<<<<<<<<<< * if w.window_id == window_id * ][0] */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_windows); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1146, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1146, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1146, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_5(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 1146, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":1147 * return [ * w for w in self._windows * if w.window_id == window_id # <<<<<<<<<<<<<< * ][0] * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_w, __pyx_n_s_window_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_window_id); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1147, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_8) { /* "pyxelen.pyx":1146 * def _find_window(self, int window_id): * return [ * w for w in self._windows # <<<<<<<<<<<<<< * if w.window_id == window_id * ][0] */ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_w))) __PYX_ERR(0, 1145, __pyx_L1_error) /* "pyxelen.pyx":1147 * return [ * w for w in self._windows * if w.window_id == window_id # <<<<<<<<<<<<<< * ][0] * */ } /* "pyxelen.pyx":1146 * def _find_window(self, int window_id): * return [ * w for w in self._windows # <<<<<<<<<<<<<< * if w.window_id == window_id * ][0] */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyxelen.pyx":1148 * w for w in self._windows * if w.window_id == window_id * ][0] # <<<<<<<<<<<<<< * * def run(self, event_handler, fps): */ __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "pyxelen.pyx":1144 * self._windows = [w for w in self._windows if w is not window] * * def _find_window(self, int window_id): # <<<<<<<<<<<<<< * return [ * w for w in self._windows */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("pyxelen.Pyxelen._find_window", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_w); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1150 * ][0] * * def run(self, event_handler, fps): # <<<<<<<<<<<<<< * cdef SDL_Event event * assert fps > 0, 'fps must be positive' */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_7Pyxelen_9run(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_7Pyxelen_9run = {"run", (PyCFunction)__pyx_pw_7pyxelen_7Pyxelen_9run, METH_VARARGS|METH_KEYWORDS, 0}; static PyObject *__pyx_pw_7pyxelen_7Pyxelen_9run(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_event_handler = 0; PyObject *__pyx_v_fps = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("run (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_event_handler,&__pyx_n_s_fps,0}; PyObject* values[3] = {0,0,0}; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event_handler)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("run", 1, 3, 3, 1); __PYX_ERR(0, 1150, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fps)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("run", 1, 3, 3, 2); __PYX_ERR(0, 1150, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run") < 0)) __PYX_ERR(0, 1150, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { values[0] = PyTuple_GET_ITEM(__pyx_args, 0); values[1] = PyTuple_GET_ITEM(__pyx_args, 1); values[2] = PyTuple_GET_ITEM(__pyx_args, 2); } __pyx_v_self = values[0]; __pyx_v_event_handler = values[1]; __pyx_v_fps = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("run", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1150, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("pyxelen.Pyxelen.run", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7pyxelen_7Pyxelen_8run(__pyx_self, __pyx_v_self, __pyx_v_event_handler, __pyx_v_fps); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_7Pyxelen_8run(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event_handler, PyObject *__pyx_v_fps) { union SDL_Event __pyx_v_event; uint32_t __pyx_v_ticks_per_frame; uint32_t __pyx_v_current_ticks; uint32_t __pyx_v_last_frame_ticks; PyObject *__pyx_v_button = NULL; int32_t __pyx_v_instance; PyObject *__pyx_v_controller = NULL; PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_window = NULL; PyObject *__pyx_v_mods = NULL; struct SDL_WindowEvent __pyx_v_window_event; PyObject *__pyx_v_w = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; uint32_t __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_t_6; int __pyx_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; PyObject *__pyx_t_13 = NULL; PyObject *__pyx_t_14 = NULL; PyObject *__pyx_t_15 = NULL; PyObject *__pyx_t_16 = NULL; PyObject *(*__pyx_t_17)(PyObject *); PyObject *__pyx_t_18 = NULL; PyObject *__pyx_t_19 = NULL; PyObject *__pyx_t_20 = NULL; PyObject *__pyx_t_21 = NULL; PyObject *__pyx_t_22 = NULL; PyObject *__pyx_t_23 = NULL; char *__pyx_t_24; struct SDL_WindowEvent __pyx_t_25; PyObject *(*__pyx_t_26)(PyObject *); __Pyx_RefNannySetupContext("run", 0); /* "pyxelen.pyx":1152 * def run(self, event_handler, fps): * cdef SDL_Event event * assert fps > 0, 'fps must be positive' # <<<<<<<<<<<<<< * cdef uint32_t ticks_per_frame = int(1000 / fps) * cdef uint32_t current_ticks = SDL_GetTicks() */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { __pyx_t_1 = PyObject_RichCompare(__pyx_v_fps, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1152, __pyx_L1_error) __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) { PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_fps_must_be_positive); __PYX_ERR(0, 1152, __pyx_L1_error) } } #endif /* "pyxelen.pyx":1153 * cdef SDL_Event event * assert fps > 0, 'fps must be positive' * cdef uint32_t ticks_per_frame = int(1000 / fps) # <<<<<<<<<<<<<< * cdef uint32_t current_ticks = SDL_GetTicks() * cdef uint32_t last_frame_ticks = SDL_GetTicks() */ __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_int_1000, __pyx_v_fps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_ticks_per_frame = __pyx_t_4; /* "pyxelen.pyx":1154 * assert fps > 0, 'fps must be positive' * cdef uint32_t ticks_per_frame = int(1000 / fps) * cdef uint32_t current_ticks = SDL_GetTicks() # <<<<<<<<<<<<<< * cdef uint32_t last_frame_ticks = SDL_GetTicks() * */ __pyx_v_current_ticks = SDL_GetTicks(); /* "pyxelen.pyx":1155 * cdef uint32_t ticks_per_frame = int(1000 / fps) * cdef uint32_t current_ticks = SDL_GetTicks() * cdef uint32_t last_frame_ticks = SDL_GetTicks() # <<<<<<<<<<<<<< * * while len(self._windows) > 0: */ __pyx_v_last_frame_ticks = SDL_GetTicks(); /* "pyxelen.pyx":1157 * cdef uint32_t last_frame_ticks = SDL_GetTicks() * * while len(self._windows) > 0: # <<<<<<<<<<<<<< * * while (SDL_PollEvent(&event) != 0): */ while (1) { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_windows); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = ((__pyx_t_5 > 0) != 0); if (!__pyx_t_2) break; /* "pyxelen.pyx":1159 * while len(self._windows) > 0: * * while (SDL_PollEvent(&event) != 0): # <<<<<<<<<<<<<< * * if event.type == SDL_AUDIODEVICEADDED and hasattr(event_handler, 'on_audio_device_added'): */ while (1) { __pyx_t_2 = ((SDL_PollEvent((&__pyx_v_event)) != 0) != 0); if (!__pyx_t_2) break; /* "pyxelen.pyx":1161 * while (SDL_PollEvent(&event) != 0): * * if event.type == SDL_AUDIODEVICEADDED and hasattr(event_handler, 'on_audio_device_added'): # <<<<<<<<<<<<<< * event_handler.on_audio_device_added( * event.adevice.which, */ __pyx_t_6 = ((__pyx_v_event.type == SDL_AUDIODEVICEADDED) != 0); if (__pyx_t_6) { } else { __pyx_t_2 = __pyx_t_6; goto __pyx_L8_bool_binop_done; } __pyx_t_6 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_audio_device_added); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1161, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 != 0); __pyx_t_2 = __pyx_t_7; __pyx_L8_bool_binop_done:; if (__pyx_t_2) { /* "pyxelen.pyx":1162 * * if event.type == SDL_AUDIODEVICEADDED and hasattr(event_handler, 'on_audio_device_added'): * event_handler.on_audio_device_added( # <<<<<<<<<<<<<< * event.adevice.which, * event.adevice.iscapture */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_audio_device_added); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "pyxelen.pyx":1163 * if event.type == SDL_AUDIODEVICEADDED and hasattr(event_handler, 'on_audio_device_added'): * event_handler.on_audio_device_added( * event.adevice.which, # <<<<<<<<<<<<<< * event.adevice.iscapture * ) */ __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_event.adevice.which); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); /* "pyxelen.pyx":1164 * event_handler.on_audio_device_added( * event.adevice.which, * event.adevice.iscapture # <<<<<<<<<<<<<< * ) * */ __pyx_t_9 = __Pyx_PyInt_From_uint8_t(__pyx_v_event.adevice.iscapture); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_9}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1162, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_9}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1162, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_9); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyxelen.pyx":1161 * while (SDL_PollEvent(&event) != 0): * * if event.type == SDL_AUDIODEVICEADDED and hasattr(event_handler, 'on_audio_device_added'): # <<<<<<<<<<<<<< * event_handler.on_audio_device_added( * event.adevice.which, */ goto __pyx_L7; } /* "pyxelen.pyx":1167 * ) * * elif event.type == SDL_AUDIODEVICEREMOVED and hasattr(event_handler, 'on_audio_device_removed'): # <<<<<<<<<<<<<< * event_handler.on_audio_device_removed( * event.adevice.which, */ __pyx_t_7 = ((__pyx_v_event.type == SDL_AUDIODEVICEREMOVED) != 0); if (__pyx_t_7) { } else { __pyx_t_2 = __pyx_t_7; goto __pyx_L10_bool_binop_done; } __pyx_t_7 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_audio_device_removed); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1167, __pyx_L1_error) __pyx_t_6 = (__pyx_t_7 != 0); __pyx_t_2 = __pyx_t_6; __pyx_L10_bool_binop_done:; if (__pyx_t_2) { /* "pyxelen.pyx":1168 * * elif event.type == SDL_AUDIODEVICEREMOVED and hasattr(event_handler, 'on_audio_device_removed'): * event_handler.on_audio_device_removed( # <<<<<<<<<<<<<< * event.adevice.which, * event.adevice.iscapture */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_audio_device_removed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "pyxelen.pyx":1169 * elif event.type == SDL_AUDIODEVICEREMOVED and hasattr(event_handler, 'on_audio_device_removed'): * event_handler.on_audio_device_removed( * event.adevice.which, # <<<<<<<<<<<<<< * event.adevice.iscapture * ) */ __pyx_t_12 = __Pyx_PyInt_From_uint32_t(__pyx_v_event.adevice.which); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); /* "pyxelen.pyx":1170 * event_handler.on_audio_device_removed( * event.adevice.which, * event.adevice.iscapture # <<<<<<<<<<<<<< * ) * */ __pyx_t_9 = __Pyx_PyInt_From_uint8_t(__pyx_v_event.adevice.iscapture); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_9}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1168, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_9}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1168, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { __pyx_t_10 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_11, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_11, __pyx_t_9); __pyx_t_12 = 0; __pyx_t_9 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyxelen.pyx":1167 * ) * * elif event.type == SDL_AUDIODEVICEREMOVED and hasattr(event_handler, 'on_audio_device_removed'): # <<<<<<<<<<<<<< * event_handler.on_audio_device_removed( * event.adevice.which, */ goto __pyx_L7; } /* "pyxelen.pyx":1173 * ) * * elif event.type == SDL_CONTROLLERBUTTONDOWN and hasattr(event_handler, 'on_controller_button_down'): # <<<<<<<<<<<<<< * try: * button = ControllerButton(event.cbutton.button) */ __pyx_t_6 = ((__pyx_v_event.type == SDL_CONTROLLERBUTTONDOWN) != 0); if (__pyx_t_6) { } else { __pyx_t_2 = __pyx_t_6; goto __pyx_L12_bool_binop_done; } __pyx_t_6 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_controller_button_down); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1173, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 != 0); __pyx_t_2 = __pyx_t_7; __pyx_L12_bool_binop_done:; if (__pyx_t_2) { /* "pyxelen.pyx":1174 * * elif event.type == SDL_CONTROLLERBUTTONDOWN and hasattr(event_handler, 'on_controller_button_down'): * try: # <<<<<<<<<<<<<< * button = ControllerButton(event.cbutton.button) * except ValueError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); /*try:*/ { /* "pyxelen.pyx":1175 * elif event.type == SDL_CONTROLLERBUTTONDOWN and hasattr(event_handler, 'on_controller_button_down'): * try: * button = ControllerButton(event.cbutton.button) # <<<<<<<<<<<<<< * except ValueError: * print('NOTIFICATION: unknown controller button:', str(event.cbutton.button)) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ControllerButton); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1175, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = __Pyx_PyInt_From_uint8_t(__pyx_v_event.cbutton.button); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1175, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_9) { __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L14_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_3); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_10}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L14_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_10}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L14_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1175, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_button, __pyx_t_3); __pyx_t_3 = 0; /* "pyxelen.pyx":1174 * * elif event.type == SDL_CONTROLLERBUTTONDOWN and hasattr(event_handler, 'on_controller_button_down'): * try: # <<<<<<<<<<<<<< * button = ControllerButton(event.cbutton.button) * except ValueError: */ } /* "pyxelen.pyx":1179 * print('NOTIFICATION: unknown controller button:', str(event.cbutton.button)) * else: * event_handler.on_controller_button_down( # <<<<<<<<<<<<<< * self.controls.find_controller(event.cbutton.which), * button */ /*else:*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_controller_button_down); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_1); /* "pyxelen.pyx":1180 * else: * event_handler.on_controller_button_down( * self.controls.find_controller(event.cbutton.which), # <<<<<<<<<<<<<< * button * ) */ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_controls); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1180, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_find_controller); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1180, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = __Pyx_PyInt_From_int32_t(__pyx_v_event.cbutton.which); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1180, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } if (!__pyx_t_8) { __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1180, __pyx_L16_except_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_12); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_10}; __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1180, __pyx_L16_except_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_10}; __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1180, __pyx_L16_except_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1180, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_16, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1180, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "pyxelen.pyx":1181 * event_handler.on_controller_button_down( * self.controls.find_controller(event.cbutton.which), * button # <<<<<<<<<<<<<< * ) * */ __pyx_t_9 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_12, __pyx_v_button}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1179, __pyx_L16_except_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_12, __pyx_v_button}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1179, __pyx_L16_except_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else #endif { __pyx_t_16 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1179, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_11, __pyx_t_12); __Pyx_INCREF(__pyx_v_button); __Pyx_GIVEREF(__pyx_v_button); PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_11, __pyx_v_button); __pyx_t_12 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1179, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L21_try_end; __pyx_L14_error:; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyxelen.pyx":1176 * try: * button = ControllerButton(event.cbutton.button) * except ValueError: # <<<<<<<<<<<<<< * print('NOTIFICATION: unknown controller button:', str(event.cbutton.button)) * else: */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_11) { __Pyx_AddTraceback("pyxelen.Pyxelen.run", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_16) < 0) __PYX_ERR(0, 1176, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_16); /* "pyxelen.pyx":1177 * button = ControllerButton(event.cbutton.button) * except ValueError: * print('NOTIFICATION: unknown controller button:', str(event.cbutton.button)) # <<<<<<<<<<<<<< * else: * event_handler.on_controller_button_down( */ __pyx_t_12 = __Pyx_PyInt_From_uint8_t(__pyx_v_event.cbutton.button); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1177, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1177, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1177, __pyx_L16_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_kp_s_NOTIFICATION_unknown_controller); __Pyx_GIVEREF(__pyx_kp_s_NOTIFICATION_unknown_controller); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_kp_s_NOTIFICATION_unknown_controller); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_9); __pyx_t_9 = 0; if (__Pyx_PrintOne(0, __pyx_t_12) < 0) __PYX_ERR(0, 1177, __pyx_L16_except_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; goto __pyx_L15_exception_handled; } goto __pyx_L16_except_error; __pyx_L16_except_error:; /* "pyxelen.pyx":1174 * * elif event.type == SDL_CONTROLLERBUTTONDOWN and hasattr(event_handler, 'on_controller_button_down'): * try: # <<<<<<<<<<<<<< * button = ControllerButton(event.cbutton.button) * except ValueError: */ __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); goto __pyx_L1_error; __pyx_L15_exception_handled:; __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); __pyx_L21_try_end:; } /* "pyxelen.pyx":1173 * ) * * elif event.type == SDL_CONTROLLERBUTTONDOWN and hasattr(event_handler, 'on_controller_button_down'): # <<<<<<<<<<<<<< * try: * button = ControllerButton(event.cbutton.button) */ goto __pyx_L7; } /* "pyxelen.pyx":1184 * ) * * elif event.type == SDL_CONTROLLERBUTTONUP and hasattr(event_handler, 'on_controller_button_up'): # <<<<<<<<<<<<<< * try: * button = ControllerButton(event.cbutton.button) */ __pyx_t_7 = ((__pyx_v_event.type == SDL_CONTROLLERBUTTONUP) != 0); if (__pyx_t_7) { } else { __pyx_t_2 = __pyx_t_7; goto __pyx_L24_bool_binop_done; } __pyx_t_7 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_controller_button_up); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1184, __pyx_L1_error) __pyx_t_6 = (__pyx_t_7 != 0); __pyx_t_2 = __pyx_t_6; __pyx_L24_bool_binop_done:; if (__pyx_t_2) { /* "pyxelen.pyx":1185 * * elif event.type == SDL_CONTROLLERBUTTONUP and hasattr(event_handler, 'on_controller_button_up'): * try: # <<<<<<<<<<<<<< * button = ControllerButton(event.cbutton.button) * except ValueError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "pyxelen.pyx":1186 * elif event.type == SDL_CONTROLLERBUTTONUP and hasattr(event_handler, 'on_controller_button_up'): * try: * button = ControllerButton(event.cbutton.button) # <<<<<<<<<<<<<< * except ValueError: * print('NOTIFICATION: unknown controller button:', str(event.cbutton.button)) */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ControllerButton); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1186, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_event.cbutton.button); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1186, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_12) { __pyx_t_16 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1186, __pyx_L26_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_16); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_3}; __pyx_t_16 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1186, __pyx_L26_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_3}; __pyx_t_16 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1186, __pyx_L26_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1186, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12); __pyx_t_12 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1186, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_button, __pyx_t_16); __pyx_t_16 = 0; /* "pyxelen.pyx":1185 * * elif event.type == SDL_CONTROLLERBUTTONUP and hasattr(event_handler, 'on_controller_button_up'): * try: # <<<<<<<<<<<<<< * button = ControllerButton(event.cbutton.button) * except ValueError: */ } /* "pyxelen.pyx":1190 * print('NOTIFICATION: unknown controller button:', str(event.cbutton.button)) * else: * event_handler.on_controller_button_up( # <<<<<<<<<<<<<< * self.controls.find_controller(event.cbutton.which), * button */ /*else:*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_controller_button_up); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1190, __pyx_L28_except_error) __Pyx_GOTREF(__pyx_t_1); /* "pyxelen.pyx":1191 * else: * event_handler.on_controller_button_up( * self.controls.find_controller(event.cbutton.which), # <<<<<<<<<<<<<< * button * ) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_controls); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1191, __pyx_L28_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_find_controller); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1191, __pyx_L28_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_event.cbutton.which); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1191, __pyx_L28_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_10) { __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1191, __pyx_L28_except_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_9); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_3}; __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1191, __pyx_L28_except_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_3}; __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1191, __pyx_L28_except_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1191, __pyx_L28_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1191, __pyx_L28_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; /* "pyxelen.pyx":1192 * event_handler.on_controller_button_up( * self.controls.find_controller(event.cbutton.which), * button # <<<<<<<<<<<<<< * ) * */ __pyx_t_12 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_9, __pyx_v_button}; __pyx_t_16 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1190, __pyx_L28_except_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_9, __pyx_v_button}; __pyx_t_16 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1190, __pyx_L28_except_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { __pyx_t_8 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1190, __pyx_L28_except_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12); __pyx_t_12 = NULL; } __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_v_button); __Pyx_GIVEREF(__pyx_v_button); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_11, __pyx_v_button); __pyx_t_9 = 0; __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1190, __pyx_L28_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L33_try_end; __pyx_L26_error:; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; /* "pyxelen.pyx":1187 * try: * button = ControllerButton(event.cbutton.button) * except ValueError: # <<<<<<<<<<<<<< * print('NOTIFICATION: unknown controller button:', str(event.cbutton.button)) * else: */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_11) { __Pyx_AddTraceback("pyxelen.Pyxelen.run", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_16, &__pyx_t_1, &__pyx_t_8) < 0) __PYX_ERR(0, 1187, __pyx_L28_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_8); /* "pyxelen.pyx":1188 * button = ControllerButton(event.cbutton.button) * except ValueError: * print('NOTIFICATION: unknown controller button:', str(event.cbutton.button)) # <<<<<<<<<<<<<< * else: * event_handler.on_controller_button_up( */ __pyx_t_9 = __Pyx_PyInt_From_uint8_t(__pyx_v_event.cbutton.button); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1188, __pyx_L28_except_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1188, __pyx_L28_except_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1188, __pyx_L28_except_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_kp_s_NOTIFICATION_unknown_controller); __Pyx_GIVEREF(__pyx_kp_s_NOTIFICATION_unknown_controller); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_kp_s_NOTIFICATION_unknown_controller); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_12); __pyx_t_12 = 0; if (__Pyx_PrintOne(0, __pyx_t_9) < 0) __PYX_ERR(0, 1188, __pyx_L28_except_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L27_exception_handled; } goto __pyx_L28_except_error; __pyx_L28_except_error:; /* "pyxelen.pyx":1185 * * elif event.type == SDL_CONTROLLERBUTTONUP and hasattr(event_handler, 'on_controller_button_up'): * try: # <<<<<<<<<<<<<< * button = ControllerButton(event.cbutton.button) * except ValueError: */ __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); goto __pyx_L1_error; __pyx_L27_exception_handled:; __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); __pyx_L33_try_end:; } /* "pyxelen.pyx":1184 * ) * * elif event.type == SDL_CONTROLLERBUTTONUP and hasattr(event_handler, 'on_controller_button_up'): # <<<<<<<<<<<<<< * try: * button = ControllerButton(event.cbutton.button) */ goto __pyx_L7; } /* "pyxelen.pyx":1195 * ) * * elif event.type == SDL_CONTROLLERDEVICEADDED and hasattr(event_handler, 'on_controller_device_added'): # <<<<<<<<<<<<<< * instance = SDL_JoystickInstanceID( * SDL_GameControllerGetJoystick( */ __pyx_t_6 = ((__pyx_v_event.type == SDL_CONTROLLERDEVICEADDED) != 0); if (__pyx_t_6) { } else { __pyx_t_2 = __pyx_t_6; goto __pyx_L36_bool_binop_done; } __pyx_t_6 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_controller_device_added); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1195, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 != 0); __pyx_t_2 = __pyx_t_7; __pyx_L36_bool_binop_done:; if (__pyx_t_2) { /* "pyxelen.pyx":1196 * * elif event.type == SDL_CONTROLLERDEVICEADDED and hasattr(event_handler, 'on_controller_device_added'): * instance = SDL_JoystickInstanceID( # <<<<<<<<<<<<<< * SDL_GameControllerGetJoystick( * SDL_GameControllerOpen(event.cdevice.which) */ __pyx_v_instance = SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(SDL_GameControllerOpen(__pyx_v_event.cdevice.which))); /* "pyxelen.pyx":1201 * ) * ) * event_handler.on_controller_device_added(event.cdevice.which) # <<<<<<<<<<<<<< * self.controls.add_controller(instance) * */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_controller_device_added); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_16 = __Pyx_PyInt_From_int32_t(__pyx_v_event.cdevice.which); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } if (!__pyx_t_9) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_16}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_16}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif { __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_16); __pyx_t_16 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "pyxelen.pyx":1202 * ) * event_handler.on_controller_device_added(event.cdevice.which) * self.controls.add_controller(instance) # <<<<<<<<<<<<<< * * elif event.type == SDL_CONTROLLERDEVICEREMOVED and hasattr(event_handler, 'on_controller_device_removed'): */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_controls); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_add_controller); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_instance); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_16) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_t_1}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_t_1}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_16); __pyx_t_16 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "pyxelen.pyx":1195 * ) * * elif event.type == SDL_CONTROLLERDEVICEADDED and hasattr(event_handler, 'on_controller_device_added'): # <<<<<<<<<<<<<< * instance = SDL_JoystickInstanceID( * SDL_GameControllerGetJoystick( */ goto __pyx_L7; } /* "pyxelen.pyx":1204 * self.controls.add_controller(instance) * * elif event.type == SDL_CONTROLLERDEVICEREMOVED and hasattr(event_handler, 'on_controller_device_removed'): # <<<<<<<<<<<<<< * event_handler.on_controller_device_removed(event.cdevice.which) * self.controls.remove_controller(event.cdevice.which) */ __pyx_t_7 = ((__pyx_v_event.type == SDL_CONTROLLERDEVICEREMOVED) != 0); if (__pyx_t_7) { } else { __pyx_t_2 = __pyx_t_7; goto __pyx_L38_bool_binop_done; } __pyx_t_7 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_controller_device_removed); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1204, __pyx_L1_error) __pyx_t_6 = (__pyx_t_7 != 0); __pyx_t_2 = __pyx_t_6; __pyx_L38_bool_binop_done:; if (__pyx_t_2) { /* "pyxelen.pyx":1205 * * elif event.type == SDL_CONTROLLERDEVICEREMOVED and hasattr(event_handler, 'on_controller_device_removed'): * event_handler.on_controller_device_removed(event.cdevice.which) # <<<<<<<<<<<<<< * self.controls.remove_controller(event.cdevice.which) * */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_controller_device_removed); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = __Pyx_PyInt_From_int32_t(__pyx_v_event.cdevice.which); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_1) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_9}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1205, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_9}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1205, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "pyxelen.pyx":1206 * elif event.type == SDL_CONTROLLERDEVICEREMOVED and hasattr(event_handler, 'on_controller_device_removed'): * event_handler.on_controller_device_removed(event.cdevice.which) * self.controls.remove_controller(event.cdevice.which) # <<<<<<<<<<<<<< * * elif event.type == SDL_JOYHATMOTION and hasattr(event_handler, 'on_controller_dpad'): */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_controls); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_remove_controller); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyInt_From_int32_t(__pyx_v_event.cdevice.which); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } if (!__pyx_t_9) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_16)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_12}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_16, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_16)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_12}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_16, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else #endif { __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_12); __pyx_t_12 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "pyxelen.pyx":1204 * self.controls.add_controller(instance) * * elif event.type == SDL_CONTROLLERDEVICEREMOVED and hasattr(event_handler, 'on_controller_device_removed'): # <<<<<<<<<<<<<< * event_handler.on_controller_device_removed(event.cdevice.which) * self.controls.remove_controller(event.cdevice.which) */ goto __pyx_L7; } /* "pyxelen.pyx":1208 * self.controls.remove_controller(event.cdevice.which) * * elif event.type == SDL_JOYHATMOTION and hasattr(event_handler, 'on_controller_dpad'): # <<<<<<<<<<<<<< * controller = self.controls.controllers.find_controller( * event.jhat.which */ __pyx_t_6 = ((__pyx_v_event.type == SDL_JOYHATMOTION) != 0); if (__pyx_t_6) { } else { __pyx_t_2 = __pyx_t_6; goto __pyx_L40_bool_binop_done; } __pyx_t_6 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_controller_dpad); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1208, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 != 0); __pyx_t_2 = __pyx_t_7; __pyx_L40_bool_binop_done:; if (__pyx_t_2) { /* "pyxelen.pyx":1209 * * elif event.type == SDL_JOYHATMOTION and hasattr(event_handler, 'on_controller_dpad'): * controller = self.controls.controllers.find_controller( # <<<<<<<<<<<<<< * event.jhat.which * ) */ __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_controls); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_controllers_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_find_controller); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1210 * elif event.type == SDL_JOYHATMOTION and hasattr(event_handler, 'on_controller_dpad'): * controller = self.controls.controllers.find_controller( * event.jhat.which # <<<<<<<<<<<<<< * ) * x, y = HAT_TO_DIRECTION.get(event.jhat.value, (0, 0)) */ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_event.jhat.which); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_16))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_16); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_16, function); } } if (!__pyx_t_12) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1209, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_16)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_1}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_16, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1209, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_16)) { PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_1}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_16, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1209, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12); __pyx_t_12 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF_SET(__pyx_v_controller, __pyx_t_8); __pyx_t_8 = 0; /* "pyxelen.pyx":1212 * event.jhat.which * ) * x, y = HAT_TO_DIRECTION.get(event.jhat.value, (0, 0)) # <<<<<<<<<<<<<< * event_handler.on_controller_dpad(controller, x, y) * */ __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s_HAT_TO_DIRECTION); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_get); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = __Pyx_PyInt_From_uint8_t(__pyx_v_event.jhat.value); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_1 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_16, __pyx_tuple__16}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1212, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_16, __pyx_tuple__16}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1212, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif { __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_16); __Pyx_INCREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_tuple__16); __pyx_t_16 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) { PyObject* sequence = __pyx_t_8; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 1212, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_9 = PyList_GET_ITEM(sequence, 0); __pyx_t_12 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_12); #else __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; __pyx_t_16 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext; index = 0; __pyx_t_9 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_9)) goto __pyx_L42_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_12 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_12)) goto __pyx_L42_unpacking_failed; __Pyx_GOTREF(__pyx_t_12); if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(0, 1212, __pyx_L1_error) __pyx_t_17 = NULL; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; goto __pyx_L43_unpacking_done; __pyx_L42_unpacking_failed:; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_17 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 1212, __pyx_L1_error) __pyx_L43_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_12); __pyx_t_12 = 0; /* "pyxelen.pyx":1213 * ) * x, y = HAT_TO_DIRECTION.get(event.jhat.value, (0, 0)) * event_handler.on_controller_dpad(controller, x, y) # <<<<<<<<<<<<<< * * elif event.type == SDL_KEYDOWN and hasattr(event_handler, 'on_key_down'): */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_controller_dpad); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_9 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_controller, __pyx_v_x, __pyx_v_y}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1213, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_controller, __pyx_v_x, __pyx_v_y}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1213, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_8); } else #endif { __pyx_t_16 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_INCREF(__pyx_v_controller); __Pyx_GIVEREF(__pyx_v_controller); PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_11, __pyx_v_controller); __Pyx_INCREF(__pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_11, __pyx_v_x); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); PyTuple_SET_ITEM(__pyx_t_16, 2+__pyx_t_11, __pyx_v_y); __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "pyxelen.pyx":1208 * self.controls.remove_controller(event.cdevice.which) * * elif event.type == SDL_JOYHATMOTION and hasattr(event_handler, 'on_controller_dpad'): # <<<<<<<<<<<<<< * controller = self.controls.controllers.find_controller( * event.jhat.which */ goto __pyx_L7; } /* "pyxelen.pyx":1215 * event_handler.on_controller_dpad(controller, x, y) * * elif event.type == SDL_KEYDOWN and hasattr(event_handler, 'on_key_down'): # <<<<<<<<<<<<<< * try: * key = Key(event.key.keysym.sym) */ __pyx_t_7 = ((__pyx_v_event.type == SDL_KEYDOWN) != 0); if (__pyx_t_7) { } else { __pyx_t_2 = __pyx_t_7; goto __pyx_L44_bool_binop_done; } __pyx_t_7 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_key_down); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1215, __pyx_L1_error) __pyx_t_6 = (__pyx_t_7 != 0); __pyx_t_2 = __pyx_t_6; __pyx_L44_bool_binop_done:; if (__pyx_t_2) { /* "pyxelen.pyx":1216 * * elif event.type == SDL_KEYDOWN and hasattr(event_handler, 'on_key_down'): * try: # <<<<<<<<<<<<<< * key = Key(event.key.keysym.sym) * window = self._find_window(event.key.windowID) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); /*try:*/ { /* "pyxelen.pyx":1217 * elif event.type == SDL_KEYDOWN and hasattr(event_handler, 'on_key_down'): * try: * key = Key(event.key.keysym.sym) # <<<<<<<<<<<<<< * window = self._find_window(event.key.windowID) * except ValueError: */ __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_Key); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1217, __pyx_L46_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_16 = __Pyx_PyInt_From_int32_t(__pyx_v_event.key.keysym.sym); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1217, __pyx_L46_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_9) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1217, __pyx_L46_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_16}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1217, __pyx_L46_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_16}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1217, __pyx_L46_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif { __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1217, __pyx_L46_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); __pyx_t_9 = NULL; __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_16); __pyx_t_16 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1217, __pyx_L46_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_8); __pyx_t_8 = 0; /* "pyxelen.pyx":1218 * try: * key = Key(event.key.keysym.sym) * window = self._find_window(event.key.windowID) # <<<<<<<<<<<<<< * except ValueError: * print('NOTIFICATION: unknown key:', str(event.key.keysym.sym)) */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_find_window); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1218, __pyx_L46_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_event.key.windowID); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1218, __pyx_L46_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_16) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1218, __pyx_L46_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_t_1}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1218, __pyx_L46_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_t_1}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1218, __pyx_L46_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1218, __pyx_L46_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_16); __pyx_t_16 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1218, __pyx_L46_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_window, __pyx_t_8); __pyx_t_8 = 0; /* "pyxelen.pyx":1216 * * elif event.type == SDL_KEYDOWN and hasattr(event_handler, 'on_key_down'): * try: # <<<<<<<<<<<<<< * key = Key(event.key.keysym.sym) * window = self._find_window(event.key.windowID) */ } /* "pyxelen.pyx":1225 * pass * else: * mods = KeyModifiers( # <<<<<<<<<<<<<< * (KMOD_CTRL & event.key.keysym.mod) > 0, * (KMOD_SHIFT & event.key.keysym.mod) > 0, */ /*else:*/ { __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_KeyModifiers); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1225, __pyx_L48_except_error) __Pyx_GOTREF(__pyx_t_12); /* "pyxelen.pyx":1226 * else: * mods = KeyModifiers( * (KMOD_CTRL & event.key.keysym.mod) > 0, # <<<<<<<<<<<<<< * (KMOD_SHIFT & event.key.keysym.mod) > 0, * (KMOD_ALT & event.key.keysym.mod) > 0 */ __pyx_t_9 = __Pyx_PyBool_FromLong(((KMOD_CTRL & __pyx_v_event.key.keysym.mod) > 0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1226, __pyx_L48_except_error) __Pyx_GOTREF(__pyx_t_9); /* "pyxelen.pyx":1227 * mods = KeyModifiers( * (KMOD_CTRL & event.key.keysym.mod) > 0, * (KMOD_SHIFT & event.key.keysym.mod) > 0, # <<<<<<<<<<<<<< * (KMOD_ALT & event.key.keysym.mod) > 0 * ) */ __pyx_t_1 = __Pyx_PyBool_FromLong(((KMOD_SHIFT & __pyx_v_event.key.keysym.mod) > 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1227, __pyx_L48_except_error) __Pyx_GOTREF(__pyx_t_1); /* "pyxelen.pyx":1228 * (KMOD_CTRL & event.key.keysym.mod) > 0, * (KMOD_SHIFT & event.key.keysym.mod) > 0, * (KMOD_ALT & event.key.keysym.mod) > 0 # <<<<<<<<<<<<<< * ) * event_handler.on_key_down(window, key, mods, event.key.repeat == 1) */ __pyx_t_16 = __Pyx_PyBool_FromLong(((KMOD_ALT & __pyx_v_event.key.keysym.mod) > 0)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1228, __pyx_L48_except_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_3 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_9, __pyx_t_1, __pyx_t_16}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1225, __pyx_L48_except_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_9, __pyx_t_1, __pyx_t_16}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1225, __pyx_L48_except_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif { __pyx_t_10 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1225, __pyx_L48_except_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_11, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_11, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_11, __pyx_t_16); __pyx_t_9 = 0; __pyx_t_1 = 0; __pyx_t_16 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1225, __pyx_L48_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_mods, __pyx_t_8); __pyx_t_8 = 0; /* "pyxelen.pyx":1230 * (KMOD_ALT & event.key.keysym.mod) > 0 * ) * event_handler.on_key_down(window, key, mods, event.key.repeat == 1) # <<<<<<<<<<<<<< * * elif event.type == SDL_KEYUP and hasattr(event_handler, 'on_key_up'): */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_key_down); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1230, __pyx_L48_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = __Pyx_PyBool_FromLong((__pyx_v_event.key.repeat == 1)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1230, __pyx_L48_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_16 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[5] = {__pyx_t_16, __pyx_v_window, __pyx_v_key, __pyx_v_mods, __pyx_t_10}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 4+__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1230, __pyx_L48_except_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[5] = {__pyx_t_16, __pyx_v_window, __pyx_v_key, __pyx_v_mods, __pyx_t_10}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 4+__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1230, __pyx_L48_except_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { __pyx_t_1 = PyTuple_New(4+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L48_except_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_16) { __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_16); __pyx_t_16 = NULL; } __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_11, __pyx_v_window); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_11, __pyx_v_key); __Pyx_INCREF(__pyx_v_mods); __Pyx_GIVEREF(__pyx_v_mods); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_11, __pyx_v_mods); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_11, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1230, __pyx_L48_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L53_try_end; __pyx_L46_error:; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "pyxelen.pyx":1219 * key = Key(event.key.keysym.sym) * window = self._find_window(event.key.windowID) * except ValueError: # <<<<<<<<<<<<<< * print('NOTIFICATION: unknown key:', str(event.key.keysym.sym)) * except IndexError: */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_11) { __Pyx_AddTraceback("pyxelen.Pyxelen.run", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_12, &__pyx_t_1) < 0) __PYX_ERR(0, 1219, __pyx_L48_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_12); __Pyx_GOTREF(__pyx_t_1); /* "pyxelen.pyx":1220 * window = self._find_window(event.key.windowID) * except ValueError: * print('NOTIFICATION: unknown key:', str(event.key.keysym.sym)) # <<<<<<<<<<<<<< * except IndexError: * # Ignore events for windows that are closed */ __pyx_t_10 = __Pyx_PyInt_From_int32_t(__pyx_v_event.key.keysym.sym); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1220, __pyx_L48_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_16 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_10); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1220, __pyx_L48_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1220, __pyx_L48_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_kp_s_NOTIFICATION_unknown_key); __Pyx_GIVEREF(__pyx_kp_s_NOTIFICATION_unknown_key); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_kp_s_NOTIFICATION_unknown_key); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_16); __pyx_t_16 = 0; if (__Pyx_PrintOne(0, __pyx_t_10) < 0) __PYX_ERR(0, 1220, __pyx_L48_except_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L47_exception_handled; } /* "pyxelen.pyx":1221 * except ValueError: * print('NOTIFICATION: unknown key:', str(event.key.keysym.sym)) * except IndexError: # <<<<<<<<<<<<<< * # Ignore events for windows that are closed * pass */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError); if (__pyx_t_11) { __Pyx_ErrRestore(0,0,0); goto __pyx_L47_exception_handled; } goto __pyx_L48_except_error; __pyx_L48_except_error:; /* "pyxelen.pyx":1216 * * elif event.type == SDL_KEYDOWN and hasattr(event_handler, 'on_key_down'): * try: # <<<<<<<<<<<<<< * key = Key(event.key.keysym.sym) * window = self._find_window(event.key.windowID) */ __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); goto __pyx_L1_error; __pyx_L47_exception_handled:; __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); __pyx_L53_try_end:; } /* "pyxelen.pyx":1215 * event_handler.on_controller_dpad(controller, x, y) * * elif event.type == SDL_KEYDOWN and hasattr(event_handler, 'on_key_down'): # <<<<<<<<<<<<<< * try: * key = Key(event.key.keysym.sym) */ goto __pyx_L7; } /* "pyxelen.pyx":1232 * event_handler.on_key_down(window, key, mods, event.key.repeat == 1) * * elif event.type == SDL_KEYUP and hasattr(event_handler, 'on_key_up'): # <<<<<<<<<<<<<< * try: * key = Key(event.key.keysym.sym) */ __pyx_t_6 = ((__pyx_v_event.type == SDL_KEYUP) != 0); if (__pyx_t_6) { } else { __pyx_t_2 = __pyx_t_6; goto __pyx_L56_bool_binop_done; } __pyx_t_6 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_key_up); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1232, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 != 0); __pyx_t_2 = __pyx_t_7; __pyx_L56_bool_binop_done:; if (__pyx_t_2) { /* "pyxelen.pyx":1233 * * elif event.type == SDL_KEYUP and hasattr(event_handler, 'on_key_up'): * try: # <<<<<<<<<<<<<< * key = Key(event.key.keysym.sym) * window = self._find_window(event.key.windowID) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "pyxelen.pyx":1234 * elif event.type == SDL_KEYUP and hasattr(event_handler, 'on_key_up'): * try: * key = Key(event.key.keysym.sym) # <<<<<<<<<<<<<< * window = self._find_window(event.key.windowID) * except ValueError: */ __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_Key); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1234, __pyx_L58_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_8 = __Pyx_PyInt_From_int32_t(__pyx_v_event.key.keysym.sym); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1234, __pyx_L58_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_10) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L58_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L58_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L58_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1234, __pyx_L58_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L58_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1235 * try: * key = Key(event.key.keysym.sym) * window = self._find_window(event.key.windowID) # <<<<<<<<<<<<<< * except ValueError: * print('NOTIFICATION: unknown key:', str(event.key.keysym.sym)) */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_find_window); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1235, __pyx_L58_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_16 = __Pyx_PyInt_From_uint32_t(__pyx_v_event.key.windowID); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1235, __pyx_L58_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_8) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1235, __pyx_L58_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_16}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1235, __pyx_L58_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_16}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1235, __pyx_L58_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1235, __pyx_L58_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_16); __pyx_t_16 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1235, __pyx_L58_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_window, __pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1233 * * elif event.type == SDL_KEYUP and hasattr(event_handler, 'on_key_up'): * try: # <<<<<<<<<<<<<< * key = Key(event.key.keysym.sym) * window = self._find_window(event.key.windowID) */ } /* "pyxelen.pyx":1242 * pass * else: * mods = KeyModifiers( # <<<<<<<<<<<<<< * (KMOD_CTRL & event.key.keysym.mod) > 0, * (KMOD_SHIFT & event.key.keysym.mod) > 0, */ /*else:*/ { __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_KeyModifiers); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1242, __pyx_L60_except_error) __Pyx_GOTREF(__pyx_t_12); /* "pyxelen.pyx":1243 * else: * mods = KeyModifiers( * (KMOD_CTRL & event.key.keysym.mod) > 0, # <<<<<<<<<<<<<< * (KMOD_SHIFT & event.key.keysym.mod) > 0, * (KMOD_ALT & event.key.keysym.mod) > 0 */ __pyx_t_10 = __Pyx_PyBool_FromLong(((KMOD_CTRL & __pyx_v_event.key.keysym.mod) > 0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1243, __pyx_L60_except_error) __Pyx_GOTREF(__pyx_t_10); /* "pyxelen.pyx":1244 * mods = KeyModifiers( * (KMOD_CTRL & event.key.keysym.mod) > 0, * (KMOD_SHIFT & event.key.keysym.mod) > 0, # <<<<<<<<<<<<<< * (KMOD_ALT & event.key.keysym.mod) > 0 * ) */ __pyx_t_16 = __Pyx_PyBool_FromLong(((KMOD_SHIFT & __pyx_v_event.key.keysym.mod) > 0)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1244, __pyx_L60_except_error) __Pyx_GOTREF(__pyx_t_16); /* "pyxelen.pyx":1245 * (KMOD_CTRL & event.key.keysym.mod) > 0, * (KMOD_SHIFT & event.key.keysym.mod) > 0, * (KMOD_ALT & event.key.keysym.mod) > 0 # <<<<<<<<<<<<<< * ) * event_handler.on_key_up(window, key, mods) */ __pyx_t_8 = __Pyx_PyBool_FromLong(((KMOD_ALT & __pyx_v_event.key.keysym.mod) > 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1245, __pyx_L60_except_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_10, __pyx_t_16, __pyx_t_8}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L60_except_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_10, __pyx_t_16, __pyx_t_8}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L60_except_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_3 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1242, __pyx_L60_except_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); __pyx_t_9 = NULL; } __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_11, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_11, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_11, __pyx_t_8); __pyx_t_10 = 0; __pyx_t_16 = 0; __pyx_t_8 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1242, __pyx_L60_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_mods, __pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1247 * (KMOD_ALT & event.key.keysym.mod) > 0 * ) * event_handler.on_key_up(window, key, mods) # <<<<<<<<<<<<<< * * elif event.type == SDL_MOUSEBUTTONDOWN and hasattr(event_handler, 'on_mouse_button_down'): */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_key_up); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1247, __pyx_L60_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_3 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_window, __pyx_v_key, __pyx_v_mods}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1247, __pyx_L60_except_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_window, __pyx_v_key, __pyx_v_mods}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1247, __pyx_L60_except_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_8 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1247, __pyx_L60_except_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_11, __pyx_v_window); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_11, __pyx_v_key); __Pyx_INCREF(__pyx_v_mods); __Pyx_GIVEREF(__pyx_v_mods); PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_11, __pyx_v_mods); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1247, __pyx_L60_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L65_try_end; __pyx_L58_error:; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1236 * key = Key(event.key.keysym.sym) * window = self._find_window(event.key.windowID) * except ValueError: # <<<<<<<<<<<<<< * print('NOTIFICATION: unknown key:', str(event.key.keysym.sym)) * except IndexError: */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_11) { __Pyx_AddTraceback("pyxelen.Pyxelen.run", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_12, &__pyx_t_8) < 0) __PYX_ERR(0, 1236, __pyx_L60_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_12); __Pyx_GOTREF(__pyx_t_8); /* "pyxelen.pyx":1237 * window = self._find_window(event.key.windowID) * except ValueError: * print('NOTIFICATION: unknown key:', str(event.key.keysym.sym)) # <<<<<<<<<<<<<< * except IndexError: * # Ignore events for windows that are closed */ __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_event.key.keysym.sym); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1237, __pyx_L60_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_16 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1237, __pyx_L60_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1237, __pyx_L60_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_kp_s_NOTIFICATION_unknown_key); __Pyx_GIVEREF(__pyx_kp_s_NOTIFICATION_unknown_key); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_NOTIFICATION_unknown_key); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_16); __pyx_t_16 = 0; if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(0, 1237, __pyx_L60_except_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L59_exception_handled; } /* "pyxelen.pyx":1238 * except ValueError: * print('NOTIFICATION: unknown key:', str(event.key.keysym.sym)) * except IndexError: # <<<<<<<<<<<<<< * # Ignore events for windows that are closed * pass */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError); if (__pyx_t_11) { __Pyx_ErrRestore(0,0,0); goto __pyx_L59_exception_handled; } goto __pyx_L60_except_error; __pyx_L60_except_error:; /* "pyxelen.pyx":1233 * * elif event.type == SDL_KEYUP and hasattr(event_handler, 'on_key_up'): * try: # <<<<<<<<<<<<<< * key = Key(event.key.keysym.sym) * window = self._find_window(event.key.windowID) */ __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); goto __pyx_L1_error; __pyx_L59_exception_handled:; __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); __pyx_L65_try_end:; } /* "pyxelen.pyx":1232 * event_handler.on_key_down(window, key, mods, event.key.repeat == 1) * * elif event.type == SDL_KEYUP and hasattr(event_handler, 'on_key_up'): # <<<<<<<<<<<<<< * try: * key = Key(event.key.keysym.sym) */ goto __pyx_L7; } /* "pyxelen.pyx":1249 * event_handler.on_key_up(window, key, mods) * * elif event.type == SDL_MOUSEBUTTONDOWN and hasattr(event_handler, 'on_mouse_button_down'): # <<<<<<<<<<<<<< * try: * button = MouseButton(event.button.button) */ __pyx_t_7 = ((__pyx_v_event.type == SDL_MOUSEBUTTONDOWN) != 0); if (__pyx_t_7) { } else { __pyx_t_2 = __pyx_t_7; goto __pyx_L68_bool_binop_done; } __pyx_t_7 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_mouse_button_down); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1249, __pyx_L1_error) __pyx_t_6 = (__pyx_t_7 != 0); __pyx_t_2 = __pyx_t_6; __pyx_L68_bool_binop_done:; if (__pyx_t_2) { /* "pyxelen.pyx":1250 * * elif event.type == SDL_MOUSEBUTTONDOWN and hasattr(event_handler, 'on_mouse_button_down'): * try: # <<<<<<<<<<<<<< * button = MouseButton(event.button.button) * window = self._find_window(event.button.windowID) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); /*try:*/ { /* "pyxelen.pyx":1251 * elif event.type == SDL_MOUSEBUTTONDOWN and hasattr(event_handler, 'on_mouse_button_down'): * try: * button = MouseButton(event.button.button) # <<<<<<<<<<<<<< * window = self._find_window(event.button.windowID) * except ValueError: */ __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_MouseButton); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1251, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_event.button.button); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1251, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_3) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L70_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L70_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L70_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1251, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1251, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_button, __pyx_t_8); __pyx_t_8 = 0; /* "pyxelen.pyx":1252 * try: * button = MouseButton(event.button.button) * window = self._find_window(event.button.windowID) # <<<<<<<<<<<<<< * except ValueError: * print('NOTIFICATION: unknown mouse button:', str(event.button.button)) */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_find_window); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1252, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_16 = __Pyx_PyInt_From_uint32_t(__pyx_v_event.button.windowID); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1252, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_1) { __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1252, __pyx_L70_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_8); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_16}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1252, __pyx_L70_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_16}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1252, __pyx_L70_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif { __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1252, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL; __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_16); __pyx_t_16 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1252, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_window, __pyx_t_8); __pyx_t_8 = 0; /* "pyxelen.pyx":1250 * * elif event.type == SDL_MOUSEBUTTONDOWN and hasattr(event_handler, 'on_mouse_button_down'): * try: # <<<<<<<<<<<<<< * button = MouseButton(event.button.button) * window = self._find_window(event.button.windowID) */ } /* "pyxelen.pyx":1259 * pass * else: * event_handler.on_mouse_button_down( # <<<<<<<<<<<<<< * window, * button, */ /*else:*/ { __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_mouse_button_down); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1259, __pyx_L72_except_error) __Pyx_GOTREF(__pyx_t_12); /* "pyxelen.pyx":1262 * window, * button, * event.button.x, # <<<<<<<<<<<<<< * event.button.y * ) */ __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_event.button.x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1262, __pyx_L72_except_error) __Pyx_GOTREF(__pyx_t_3); /* "pyxelen.pyx":1263 * button, * event.button.x, * event.button.y # <<<<<<<<<<<<<< * ) * */ __pyx_t_16 = __Pyx_PyInt_From_int32_t(__pyx_v_event.button.y); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1263, __pyx_L72_except_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_1 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[5] = {__pyx_t_1, __pyx_v_window, __pyx_v_button, __pyx_t_3, __pyx_t_16}; __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 4+__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1259, __pyx_L72_except_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[5] = {__pyx_t_1, __pyx_v_window, __pyx_v_button, __pyx_t_3, __pyx_t_16}; __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 4+__pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1259, __pyx_L72_except_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif { __pyx_t_10 = PyTuple_New(4+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1259, __pyx_L72_except_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_11, __pyx_v_window); __Pyx_INCREF(__pyx_v_button); __Pyx_GIVEREF(__pyx_v_button); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_11, __pyx_v_button); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_11, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_11, __pyx_t_16); __pyx_t_3 = 0; __pyx_t_16 = 0; __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1259, __pyx_L72_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L77_try_end; __pyx_L70_error:; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "pyxelen.pyx":1253 * button = MouseButton(event.button.button) * window = self._find_window(event.button.windowID) * except ValueError: # <<<<<<<<<<<<<< * print('NOTIFICATION: unknown mouse button:', str(event.button.button)) * except IndexError: */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_11) { __Pyx_AddTraceback("pyxelen.Pyxelen.run", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_12, &__pyx_t_10) < 0) __PYX_ERR(0, 1253, __pyx_L72_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_12); __Pyx_GOTREF(__pyx_t_10); /* "pyxelen.pyx":1254 * window = self._find_window(event.button.windowID) * except ValueError: * print('NOTIFICATION: unknown mouse button:', str(event.button.button)) # <<<<<<<<<<<<<< * except IndexError: * # Ignore events for windows that are closed */ __pyx_t_16 = __Pyx_PyInt_From_uint8_t(__pyx_v_event.button.button); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1254, __pyx_L72_except_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1254, __pyx_L72_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1254, __pyx_L72_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_INCREF(__pyx_kp_s_NOTIFICATION_unknown_mouse_butto); __Pyx_GIVEREF(__pyx_kp_s_NOTIFICATION_unknown_mouse_butto); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_kp_s_NOTIFICATION_unknown_mouse_butto); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_3); __pyx_t_3 = 0; if (__Pyx_PrintOne(0, __pyx_t_16) < 0) __PYX_ERR(0, 1254, __pyx_L72_except_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L71_exception_handled; } /* "pyxelen.pyx":1255 * except ValueError: * print('NOTIFICATION: unknown mouse button:', str(event.button.button)) * except IndexError: # <<<<<<<<<<<<<< * # Ignore events for windows that are closed * pass */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError); if (__pyx_t_11) { __Pyx_ErrRestore(0,0,0); goto __pyx_L71_exception_handled; } goto __pyx_L72_except_error; __pyx_L72_except_error:; /* "pyxelen.pyx":1250 * * elif event.type == SDL_MOUSEBUTTONDOWN and hasattr(event_handler, 'on_mouse_button_down'): * try: # <<<<<<<<<<<<<< * button = MouseButton(event.button.button) * window = self._find_window(event.button.windowID) */ __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); goto __pyx_L1_error; __pyx_L71_exception_handled:; __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); __pyx_L77_try_end:; } /* "pyxelen.pyx":1249 * event_handler.on_key_up(window, key, mods) * * elif event.type == SDL_MOUSEBUTTONDOWN and hasattr(event_handler, 'on_mouse_button_down'): # <<<<<<<<<<<<<< * try: * button = MouseButton(event.button.button) */ goto __pyx_L7; } /* "pyxelen.pyx":1266 * ) * * elif event.type == SDL_MOUSEBUTTONUP and hasattr(event_handler, 'on_mouse_button_up'): # <<<<<<<<<<<<<< * try: * button = MouseButton(event.button.button) */ __pyx_t_6 = ((__pyx_v_event.type == SDL_MOUSEBUTTONUP) != 0); if (__pyx_t_6) { } else { __pyx_t_2 = __pyx_t_6; goto __pyx_L80_bool_binop_done; } __pyx_t_6 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_mouse_button_up); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1266, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 != 0); __pyx_t_2 = __pyx_t_7; __pyx_L80_bool_binop_done:; if (__pyx_t_2) { /* "pyxelen.pyx":1267 * * elif event.type == SDL_MOUSEBUTTONUP and hasattr(event_handler, 'on_mouse_button_up'): * try: # <<<<<<<<<<<<<< * button = MouseButton(event.button.button) * window = self._find_window(event.button.windowID) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "pyxelen.pyx":1268 * elif event.type == SDL_MOUSEBUTTONUP and hasattr(event_handler, 'on_mouse_button_up'): * try: * button = MouseButton(event.button.button) # <<<<<<<<<<<<<< * window = self._find_window(event.button.windowID) * except ValueError: */ __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_MouseButton); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1268, __pyx_L82_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_8 = __Pyx_PyInt_From_uint8_t(__pyx_v_event.button.button); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1268, __pyx_L82_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_16) { __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1268, __pyx_L82_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_10); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_t_8}; __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1268, __pyx_L82_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_t_8}; __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1268, __pyx_L82_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1268, __pyx_L82_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16); __pyx_t_16 = NULL; __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_3, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1268, __pyx_L82_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_button, __pyx_t_10); __pyx_t_10 = 0; /* "pyxelen.pyx":1269 * try: * button = MouseButton(event.button.button) * window = self._find_window(event.button.windowID) # <<<<<<<<<<<<<< * except ValueError: * print('NOTIFICATION: unknown mouse button:', str(event.button.button)) */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_find_window); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1269, __pyx_L82_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_event.button.windowID); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1269, __pyx_L82_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_8) { __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1269, __pyx_L82_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_10); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_3}; __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1269, __pyx_L82_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_3}; __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1269, __pyx_L82_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1269, __pyx_L82_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_8); __pyx_t_8 = NULL; __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1269, __pyx_L82_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_window, __pyx_t_10); __pyx_t_10 = 0; /* "pyxelen.pyx":1267 * * elif event.type == SDL_MOUSEBUTTONUP and hasattr(event_handler, 'on_mouse_button_up'): * try: # <<<<<<<<<<<<<< * button = MouseButton(event.button.button) * window = self._find_window(event.button.windowID) */ } /* "pyxelen.pyx":1276 * pass * else: * event_handler.on_mouse_button_up( # <<<<<<<<<<<<<< * window, * button, */ /*else:*/ { __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_mouse_button_up); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1276, __pyx_L84_except_error) __Pyx_GOTREF(__pyx_t_12); /* "pyxelen.pyx":1279 * window, * button, * event.button.x, # <<<<<<<<<<<<<< * event.button.y * ) */ __pyx_t_16 = __Pyx_PyInt_From_int32_t(__pyx_v_event.button.x); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1279, __pyx_L84_except_error) __Pyx_GOTREF(__pyx_t_16); /* "pyxelen.pyx":1280 * button, * event.button.x, * event.button.y # <<<<<<<<<<<<<< * ) * */ __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_event.button.y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1280, __pyx_L84_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[5] = {__pyx_t_8, __pyx_v_window, __pyx_v_button, __pyx_t_16, __pyx_t_3}; __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 4+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1276, __pyx_L84_except_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[5] = {__pyx_t_8, __pyx_v_window, __pyx_v_button, __pyx_t_16, __pyx_t_3}; __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 4+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1276, __pyx_L84_except_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_1 = PyTuple_New(4+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1276, __pyx_L84_except_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_11, __pyx_v_window); __Pyx_INCREF(__pyx_v_button); __Pyx_GIVEREF(__pyx_v_button); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_11, __pyx_v_button); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_11, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_11, __pyx_t_3); __pyx_t_16 = 0; __pyx_t_3 = 0; __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1276, __pyx_L84_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L89_try_end; __pyx_L82_error:; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; /* "pyxelen.pyx":1270 * button = MouseButton(event.button.button) * window = self._find_window(event.button.windowID) * except ValueError: # <<<<<<<<<<<<<< * print('NOTIFICATION: unknown mouse button:', str(event.button.button)) * except IndexError: */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError); if (__pyx_t_11) { __Pyx_AddTraceback("pyxelen.Pyxelen.run", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_12, &__pyx_t_1) < 0) __PYX_ERR(0, 1270, __pyx_L84_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GOTREF(__pyx_t_12); __Pyx_GOTREF(__pyx_t_1); /* "pyxelen.pyx":1271 * window = self._find_window(event.button.windowID) * except ValueError: * print('NOTIFICATION: unknown mouse button:', str(event.button.button)) # <<<<<<<<<<<<<< * except IndexError: * # Ignore events for windows that are closed */ __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_event.button.button); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1271, __pyx_L84_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_16 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1271, __pyx_L84_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1271, __pyx_L84_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_kp_s_NOTIFICATION_unknown_mouse_butto); __Pyx_GIVEREF(__pyx_kp_s_NOTIFICATION_unknown_mouse_butto); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_s_NOTIFICATION_unknown_mouse_butto); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_16); __pyx_t_16 = 0; if (__Pyx_PrintOne(0, __pyx_t_3) < 0) __PYX_ERR(0, 1271, __pyx_L84_except_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L83_exception_handled; } /* "pyxelen.pyx":1272 * except ValueError: * print('NOTIFICATION: unknown mouse button:', str(event.button.button)) * except IndexError: # <<<<<<<<<<<<<< * # Ignore events for windows that are closed * pass */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError); if (__pyx_t_11) { __Pyx_ErrRestore(0,0,0); goto __pyx_L83_exception_handled; } goto __pyx_L84_except_error; __pyx_L84_except_error:; /* "pyxelen.pyx":1267 * * elif event.type == SDL_MOUSEBUTTONUP and hasattr(event_handler, 'on_mouse_button_up'): * try: # <<<<<<<<<<<<<< * button = MouseButton(event.button.button) * window = self._find_window(event.button.windowID) */ __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); goto __pyx_L1_error; __pyx_L83_exception_handled:; __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); __pyx_L89_try_end:; } /* "pyxelen.pyx":1266 * ) * * elif event.type == SDL_MOUSEBUTTONUP and hasattr(event_handler, 'on_mouse_button_up'): # <<<<<<<<<<<<<< * try: * button = MouseButton(event.button.button) */ goto __pyx_L7; } /* "pyxelen.pyx":1283 * ) * * elif event.type == SDL_MOUSEMOTION and hasattr(event_handler, 'on_mouse_motion'): # <<<<<<<<<<<<<< * try: * window = self._find_window(event.motion.windowID) */ __pyx_t_7 = ((__pyx_v_event.type == SDL_MOUSEMOTION) != 0); if (__pyx_t_7) { } else { __pyx_t_2 = __pyx_t_7; goto __pyx_L92_bool_binop_done; } __pyx_t_7 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_mouse_motion); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1283, __pyx_L1_error) __pyx_t_6 = (__pyx_t_7 != 0); __pyx_t_2 = __pyx_t_6; __pyx_L92_bool_binop_done:; if (__pyx_t_2) { /* "pyxelen.pyx":1284 * * elif event.type == SDL_MOUSEMOTION and hasattr(event_handler, 'on_mouse_motion'): * try: # <<<<<<<<<<<<<< * window = self._find_window(event.motion.windowID) * except IndexError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); /*try:*/ { /* "pyxelen.pyx":1285 * elif event.type == SDL_MOUSEMOTION and hasattr(event_handler, 'on_mouse_motion'): * try: * window = self._find_window(event.motion.windowID) # <<<<<<<<<<<<<< * except IndexError: * # Ignore events for windows that are closed */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_find_window); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1285, __pyx_L94_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = __Pyx_PyInt_From_uint32_t(__pyx_v_event.motion.windowID); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1285, __pyx_L94_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_3) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1285, __pyx_L94_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_10}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1285, __pyx_L94_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_10}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1285, __pyx_L94_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1285, __pyx_L94_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_3); __pyx_t_3 = NULL; __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_10); __pyx_t_10 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1285, __pyx_L94_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_window, __pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1284 * * elif event.type == SDL_MOUSEMOTION and hasattr(event_handler, 'on_mouse_motion'): * try: # <<<<<<<<<<<<<< * window = self._find_window(event.motion.windowID) * except IndexError: */ } /* "pyxelen.pyx":1290 * pass * else: * event_handler.on_mouse_motion( # <<<<<<<<<<<<<< * window, * Mouse( */ /*else:*/ { __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_mouse_motion); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1290, __pyx_L96_except_error) __Pyx_GOTREF(__pyx_t_12); /* "pyxelen.pyx":1292 * event_handler.on_mouse_motion( * window, * Mouse( # <<<<<<<<<<<<<< * event.motion.x, event.motion.y, * (SDL_BUTTON_LMASK & event.motion.state) > 0, */ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_Mouse); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1292, __pyx_L96_except_error) __Pyx_GOTREF(__pyx_t_10); /* "pyxelen.pyx":1293 * window, * Mouse( * event.motion.x, event.motion.y, # <<<<<<<<<<<<<< * (SDL_BUTTON_LMASK & event.motion.state) > 0, * (SDL_BUTTON_MMASK & event.motion.state) > 0, */ __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_event.motion.x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1293, __pyx_L96_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyInt_From_int32_t(__pyx_v_event.motion.y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1293, __pyx_L96_except_error) __Pyx_GOTREF(__pyx_t_8); /* "pyxelen.pyx":1294 * Mouse( * event.motion.x, event.motion.y, * (SDL_BUTTON_LMASK & event.motion.state) > 0, # <<<<<<<<<<<<<< * (SDL_BUTTON_MMASK & event.motion.state) > 0, * (SDL_BUTTON_RMASK & event.motion.state) > 0, */ __pyx_t_9 = __Pyx_PyBool_FromLong(((SDL_BUTTON_LMASK & __pyx_v_event.motion.state) > 0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1294, __pyx_L96_except_error) __Pyx_GOTREF(__pyx_t_9); /* "pyxelen.pyx":1295 * event.motion.x, event.motion.y, * (SDL_BUTTON_LMASK & event.motion.state) > 0, * (SDL_BUTTON_MMASK & event.motion.state) > 0, # <<<<<<<<<<<<<< * (SDL_BUTTON_RMASK & event.motion.state) > 0, * (SDL_BUTTON_X1MASK & event.motion.state) > 0, */ __pyx_t_18 = __Pyx_PyBool_FromLong(((SDL_BUTTON_MMASK & __pyx_v_event.motion.state) > 0)); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1295, __pyx_L96_except_error) __Pyx_GOTREF(__pyx_t_18); /* "pyxelen.pyx":1296 * (SDL_BUTTON_LMASK & event.motion.state) > 0, * (SDL_BUTTON_MMASK & event.motion.state) > 0, * (SDL_BUTTON_RMASK & event.motion.state) > 0, # <<<<<<<<<<<<<< * (SDL_BUTTON_X1MASK & event.motion.state) > 0, * (SDL_BUTTON_X2MASK & event.motion.state) > 0 */ __pyx_t_19 = __Pyx_PyBool_FromLong(((SDL_BUTTON_RMASK & __pyx_v_event.motion.state) > 0)); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1296, __pyx_L96_except_error) __Pyx_GOTREF(__pyx_t_19); /* "pyxelen.pyx":1297 * (SDL_BUTTON_MMASK & event.motion.state) > 0, * (SDL_BUTTON_RMASK & event.motion.state) > 0, * (SDL_BUTTON_X1MASK & event.motion.state) > 0, # <<<<<<<<<<<<<< * (SDL_BUTTON_X2MASK & event.motion.state) > 0 * ), */ __pyx_t_20 = __Pyx_PyBool_FromLong(((SDL_BUTTON_X1MASK & __pyx_v_event.motion.state) > 0)); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1297, __pyx_L96_except_error) __Pyx_GOTREF(__pyx_t_20); /* "pyxelen.pyx":1298 * (SDL_BUTTON_RMASK & event.motion.state) > 0, * (SDL_BUTTON_X1MASK & event.motion.state) > 0, * (SDL_BUTTON_X2MASK & event.motion.state) > 0 # <<<<<<<<<<<<<< * ), * event.motion.xrel, */ __pyx_t_21 = __Pyx_PyBool_FromLong(((SDL_BUTTON_X2MASK & __pyx_v_event.motion.state) > 0)); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1298, __pyx_L96_except_error) __Pyx_GOTREF(__pyx_t_21); __pyx_t_22 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_10); if (likely(__pyx_t_22)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); __Pyx_INCREF(__pyx_t_22); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_10, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[8] = {__pyx_t_22, __pyx_t_3, __pyx_t_8, __pyx_t_9, __pyx_t_18, __pyx_t_19, __pyx_t_20, __pyx_t_21}; __pyx_t_16 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_11, 7+__pyx_t_11); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1292, __pyx_L96_except_error) __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) { PyObject *__pyx_temp[8] = {__pyx_t_22, __pyx_t_3, __pyx_t_8, __pyx_t_9, __pyx_t_18, __pyx_t_19, __pyx_t_20, __pyx_t_21}; __pyx_t_16 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_11, 7+__pyx_t_11); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1292, __pyx_L96_except_error) __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0; } else #endif { __pyx_t_23 = PyTuple_New(7+__pyx_t_11); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1292, __pyx_L96_except_error) __Pyx_GOTREF(__pyx_t_23); if (__pyx_t_22) { __Pyx_GIVEREF(__pyx_t_22); PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_22); __pyx_t_22 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_23, 0+__pyx_t_11, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_23, 1+__pyx_t_11, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_23, 2+__pyx_t_11, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_23, 3+__pyx_t_11, __pyx_t_18); __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_23, 4+__pyx_t_11, __pyx_t_19); __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_23, 5+__pyx_t_11, __pyx_t_20); __Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_23, 6+__pyx_t_11, __pyx_t_21); __pyx_t_3 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_23, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1292, __pyx_L96_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; /* "pyxelen.pyx":1300 * (SDL_BUTTON_X2MASK & event.motion.state) > 0 * ), * event.motion.xrel, # <<<<<<<<<<<<<< * event.motion.yrel * ) */ __pyx_t_10 = __Pyx_PyInt_From_int32_t(__pyx_v_event.motion.xrel); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1300, __pyx_L96_except_error) __Pyx_GOTREF(__pyx_t_10); /* "pyxelen.pyx":1301 * ), * event.motion.xrel, * event.motion.yrel # <<<<<<<<<<<<<< * ) * */ __pyx_t_23 = __Pyx_PyInt_From_int32_t(__pyx_v_event.motion.yrel); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1301, __pyx_L96_except_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_21 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_21)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_21); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[5] = {__pyx_t_21, __pyx_v_window, __pyx_t_16, __pyx_t_10, __pyx_t_23}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 4+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1290, __pyx_L96_except_error) __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[5] = {__pyx_t_21, __pyx_v_window, __pyx_t_16, __pyx_t_10, __pyx_t_23}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 4+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1290, __pyx_L96_except_error) __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; } else #endif { __pyx_t_20 = PyTuple_New(4+__pyx_t_11); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1290, __pyx_L96_except_error) __Pyx_GOTREF(__pyx_t_20); if (__pyx_t_21) { __Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_21); __pyx_t_21 = NULL; } __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_11, __pyx_v_window); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_11, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_11, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_23); PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_11, __pyx_t_23); __pyx_t_16 = 0; __pyx_t_10 = 0; __pyx_t_23 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1290, __pyx_L96_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L101_try_end; __pyx_L94_error:; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1286 * try: * window = self._find_window(event.motion.windowID) * except IndexError: # <<<<<<<<<<<<<< * # Ignore events for windows that are closed * pass */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError); if (__pyx_t_11) { __Pyx_ErrRestore(0,0,0); goto __pyx_L95_exception_handled; } goto __pyx_L96_except_error; __pyx_L96_except_error:; /* "pyxelen.pyx":1284 * * elif event.type == SDL_MOUSEMOTION and hasattr(event_handler, 'on_mouse_motion'): * try: # <<<<<<<<<<<<<< * window = self._find_window(event.motion.windowID) * except IndexError: */ __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); goto __pyx_L1_error; __pyx_L95_exception_handled:; __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); __pyx_L101_try_end:; } /* "pyxelen.pyx":1283 * ) * * elif event.type == SDL_MOUSEMOTION and hasattr(event_handler, 'on_mouse_motion'): # <<<<<<<<<<<<<< * try: * window = self._find_window(event.motion.windowID) */ goto __pyx_L7; } /* "pyxelen.pyx":1304 * ) * * elif event.type == SDL_MOUSEWHEEL and hasattr(event_handler, 'on_mouse_wheel'): # <<<<<<<<<<<<<< * try: * window = self._find_window(event.wheel.windowID) */ __pyx_t_6 = ((__pyx_v_event.type == SDL_MOUSEWHEEL) != 0); if (__pyx_t_6) { } else { __pyx_t_2 = __pyx_t_6; goto __pyx_L102_bool_binop_done; } __pyx_t_6 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_mouse_wheel); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1304, __pyx_L1_error) __pyx_t_7 = (__pyx_t_6 != 0); __pyx_t_2 = __pyx_t_7; __pyx_L102_bool_binop_done:; if (__pyx_t_2) { /* "pyxelen.pyx":1305 * * elif event.type == SDL_MOUSEWHEEL and hasattr(event_handler, 'on_mouse_wheel'): * try: # <<<<<<<<<<<<<< * window = self._find_window(event.wheel.windowID) * except IndexError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "pyxelen.pyx":1306 * elif event.type == SDL_MOUSEWHEEL and hasattr(event_handler, 'on_mouse_wheel'): * try: * window = self._find_window(event.wheel.windowID) # <<<<<<<<<<<<<< * except IndexError: * # Ignore events for windows that are closed */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_find_window); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1306, __pyx_L104_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_20 = __Pyx_PyInt_From_uint32_t(__pyx_v_event.wheel.windowID); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1306, __pyx_L104_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_23 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_23 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_23)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_23); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_23) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1306, __pyx_L104_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_23, __pyx_t_20}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1306, __pyx_L104_error) __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_23, __pyx_t_20}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1306, __pyx_L104_error) __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } else #endif { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1306, __pyx_L104_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_23); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_23); __pyx_t_23 = NULL; __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_20); __pyx_t_20 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1306, __pyx_L104_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_window, __pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1305 * * elif event.type == SDL_MOUSEWHEEL and hasattr(event_handler, 'on_mouse_wheel'): * try: # <<<<<<<<<<<<<< * window = self._find_window(event.wheel.windowID) * except IndexError: */ } /* "pyxelen.pyx":1311 * pass * else: * event_handler.on_mouse_wheel( # <<<<<<<<<<<<<< * window, * -event.wheel.x if event.wheel.direction else event.wheel.x, */ /*else:*/ { __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_mouse_wheel); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1311, __pyx_L106_except_error) __Pyx_GOTREF(__pyx_t_12); /* "pyxelen.pyx":1313 * event_handler.on_mouse_wheel( * window, * -event.wheel.x if event.wheel.direction else event.wheel.x, # <<<<<<<<<<<<<< * -event.wheel.y if event.wheel.direction else event.wheel.y * ) */ if ((__pyx_v_event.wheel.direction != 0)) { __pyx_t_20 = __Pyx_PyInt_From_int32_t((-__pyx_v_event.wheel.x)); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1313, __pyx_L106_except_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_10 = __pyx_t_20; __pyx_t_20 = 0; } else { __pyx_t_20 = __Pyx_PyInt_From_int32_t(__pyx_v_event.wheel.x); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1313, __pyx_L106_except_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_10 = __pyx_t_20; __pyx_t_20 = 0; } /* "pyxelen.pyx":1314 * window, * -event.wheel.x if event.wheel.direction else event.wheel.x, * -event.wheel.y if event.wheel.direction else event.wheel.y # <<<<<<<<<<<<<< * ) * */ if ((__pyx_v_event.wheel.direction != 0)) { __pyx_t_23 = __Pyx_PyInt_From_int32_t((-__pyx_v_event.wheel.y)); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1314, __pyx_L106_except_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_20 = __pyx_t_23; __pyx_t_23 = 0; } else { __pyx_t_23 = __Pyx_PyInt_From_int32_t(__pyx_v_event.wheel.y); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1314, __pyx_L106_except_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_20 = __pyx_t_23; __pyx_t_23 = 0; } __pyx_t_23 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_23 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_23)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_23); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[4] = {__pyx_t_23, __pyx_v_window, __pyx_t_10, __pyx_t_20}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1311, __pyx_L106_except_error) __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[4] = {__pyx_t_23, __pyx_v_window, __pyx_t_10, __pyx_t_20}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1311, __pyx_L106_except_error) __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } else #endif { __pyx_t_16 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1311, __pyx_L106_except_error) __Pyx_GOTREF(__pyx_t_16); if (__pyx_t_23) { __Pyx_GIVEREF(__pyx_t_23); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_23); __pyx_t_23 = NULL; } __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_11, __pyx_v_window); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_11, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_16, 2+__pyx_t_11, __pyx_t_20); __pyx_t_10 = 0; __pyx_t_20 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1311, __pyx_L106_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L111_try_end; __pyx_L104_error:; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1307 * try: * window = self._find_window(event.wheel.windowID) * except IndexError: # <<<<<<<<<<<<<< * # Ignore events for windows that are closed * pass */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError); if (__pyx_t_11) { __Pyx_ErrRestore(0,0,0); goto __pyx_L105_exception_handled; } goto __pyx_L106_except_error; __pyx_L106_except_error:; /* "pyxelen.pyx":1305 * * elif event.type == SDL_MOUSEWHEEL and hasattr(event_handler, 'on_mouse_wheel'): * try: # <<<<<<<<<<<<<< * window = self._find_window(event.wheel.windowID) * except IndexError: */ __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); goto __pyx_L1_error; __pyx_L105_exception_handled:; __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); __pyx_L111_try_end:; } /* "pyxelen.pyx":1304 * ) * * elif event.type == SDL_MOUSEWHEEL and hasattr(event_handler, 'on_mouse_wheel'): # <<<<<<<<<<<<<< * try: * window = self._find_window(event.wheel.windowID) */ goto __pyx_L7; } /* "pyxelen.pyx":1317 * ) * * elif event.type == SDL_QUIT: # <<<<<<<<<<<<<< * if hasattr(event_handler, 'on_quit'): * event_handler.on_quit() */ __pyx_t_2 = ((__pyx_v_event.type == SDL_QUIT) != 0); if (__pyx_t_2) { /* "pyxelen.pyx":1318 * * elif event.type == SDL_QUIT: * if hasattr(event_handler, 'on_quit'): # <<<<<<<<<<<<<< * event_handler.on_quit() * self._windows = [] */ __pyx_t_2 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_quit); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1318, __pyx_L1_error) __pyx_t_7 = (__pyx_t_2 != 0); if (__pyx_t_7) { /* "pyxelen.pyx":1319 * elif event.type == SDL_QUIT: * if hasattr(event_handler, 'on_quit'): * event_handler.on_quit() # <<<<<<<<<<<<<< * self._windows = [] * */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_quit); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (__pyx_t_16) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1318 * * elif event.type == SDL_QUIT: * if hasattr(event_handler, 'on_quit'): # <<<<<<<<<<<<<< * event_handler.on_quit() * self._windows = [] */ } /* "pyxelen.pyx":1320 * if hasattr(event_handler, 'on_quit'): * event_handler.on_quit() * self._windows = [] # <<<<<<<<<<<<<< * * elif event.type == SDL_TEXTINPUT and hasattr(event_handler, 'on_text_input'): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_windows, __pyx_t_1) < 0) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1317 * ) * * elif event.type == SDL_QUIT: # <<<<<<<<<<<<<< * if hasattr(event_handler, 'on_quit'): * event_handler.on_quit() */ goto __pyx_L7; } /* "pyxelen.pyx":1322 * self._windows = [] * * elif event.type == SDL_TEXTINPUT and hasattr(event_handler, 'on_text_input'): # <<<<<<<<<<<<<< * try: * window = self._find_window(event.text.windowID) */ __pyx_t_2 = ((__pyx_v_event.type == SDL_TEXTINPUT) != 0); if (__pyx_t_2) { } else { __pyx_t_7 = __pyx_t_2; goto __pyx_L113_bool_binop_done; } __pyx_t_2 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_text_input); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1322, __pyx_L1_error) __pyx_t_6 = (__pyx_t_2 != 0); __pyx_t_7 = __pyx_t_6; __pyx_L113_bool_binop_done:; if (__pyx_t_7) { /* "pyxelen.pyx":1323 * * elif event.type == SDL_TEXTINPUT and hasattr(event_handler, 'on_text_input'): * try: # <<<<<<<<<<<<<< * window = self._find_window(event.text.windowID) * except IndexError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15); __Pyx_XGOTREF(__pyx_t_13); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_15); /*try:*/ { /* "pyxelen.pyx":1324 * elif event.type == SDL_TEXTINPUT and hasattr(event_handler, 'on_text_input'): * try: * window = self._find_window(event.text.windowID) # <<<<<<<<<<<<<< * except IndexError: * # Ignore events for windows that are closed */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_find_window); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1324, __pyx_L115_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_16 = __Pyx_PyInt_From_uint32_t(__pyx_v_event.text.windowID); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1324, __pyx_L115_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_20 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_20)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_20); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_20) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L115_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_t_16}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L115_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_t_16}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L115_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1324, __pyx_L115_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_20); __pyx_t_20 = NULL; __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_16); __pyx_t_16 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L115_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_window, __pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1323 * * elif event.type == SDL_TEXTINPUT and hasattr(event_handler, 'on_text_input'): * try: # <<<<<<<<<<<<<< * window = self._find_window(event.text.windowID) * except IndexError: */ } /* "pyxelen.pyx":1329 * pass * else: * event_handler.on_text_input(window, event.text.text.decode('utf-8')) # <<<<<<<<<<<<<< * * elif event.type == SDL_RENDER_TARGETS_RESET and hasattr(event_handler, 'on_render_targets_reset'): */ /*else:*/ { __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_text_input); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1329, __pyx_L117_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_24 = __pyx_v_event.text.text; __pyx_t_10 = __Pyx_decode_c_string(__pyx_t_24, 0, strlen(__pyx_t_24), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1329, __pyx_L117_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_16 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_v_window, __pyx_t_10}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L117_except_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[3] = {__pyx_t_16, __pyx_v_window, __pyx_t_10}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L117_except_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } else #endif { __pyx_t_20 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1329, __pyx_L117_except_error) __Pyx_GOTREF(__pyx_t_20); if (__pyx_t_16) { __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_16); __pyx_t_16 = NULL; } __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_11, __pyx_v_window); __Pyx_INCREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_11, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L117_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L122_try_end; __pyx_L115_error:; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1325 * try: * window = self._find_window(event.text.windowID) * except IndexError: # <<<<<<<<<<<<<< * # Ignore events for windows that are closed * pass */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError); if (__pyx_t_11) { __Pyx_ErrRestore(0,0,0); goto __pyx_L116_exception_handled; } goto __pyx_L117_except_error; __pyx_L117_except_error:; /* "pyxelen.pyx":1323 * * elif event.type == SDL_TEXTINPUT and hasattr(event_handler, 'on_text_input'): * try: # <<<<<<<<<<<<<< * window = self._find_window(event.text.windowID) * except IndexError: */ __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); goto __pyx_L1_error; __pyx_L116_exception_handled:; __Pyx_XGIVEREF(__pyx_t_13); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15); __pyx_L122_try_end:; } /* "pyxelen.pyx":1322 * self._windows = [] * * elif event.type == SDL_TEXTINPUT and hasattr(event_handler, 'on_text_input'): # <<<<<<<<<<<<<< * try: * window = self._find_window(event.text.windowID) */ goto __pyx_L7; } /* "pyxelen.pyx":1331 * event_handler.on_text_input(window, event.text.text.decode('utf-8')) * * elif event.type == SDL_RENDER_TARGETS_RESET and hasattr(event_handler, 'on_render_targets_reset'): # <<<<<<<<<<<<<< * event_handler.on_render_targets_reset() * */ __pyx_t_6 = ((__pyx_v_event.type == SDL_RENDER_TARGETS_RESET) != 0); if (__pyx_t_6) { } else { __pyx_t_7 = __pyx_t_6; goto __pyx_L123_bool_binop_done; } __pyx_t_6 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_render_targets_reset); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1331, __pyx_L1_error) __pyx_t_2 = (__pyx_t_6 != 0); __pyx_t_7 = __pyx_t_2; __pyx_L123_bool_binop_done:; if (__pyx_t_7) { /* "pyxelen.pyx":1332 * * elif event.type == SDL_RENDER_TARGETS_RESET and hasattr(event_handler, 'on_render_targets_reset'): * event_handler.on_render_targets_reset() # <<<<<<<<<<<<<< * * elif event.type == SDL_WINDOWEVENT: */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_render_targets_reset); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_20 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_20)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_20); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (__pyx_t_20) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1332, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1331 * event_handler.on_text_input(window, event.text.text.decode('utf-8')) * * elif event.type == SDL_RENDER_TARGETS_RESET and hasattr(event_handler, 'on_render_targets_reset'): # <<<<<<<<<<<<<< * event_handler.on_render_targets_reset() * */ goto __pyx_L7; } /* "pyxelen.pyx":1334 * event_handler.on_render_targets_reset() * * elif event.type == SDL_WINDOWEVENT: # <<<<<<<<<<<<<< * * window_event = event.window */ __pyx_t_7 = ((__pyx_v_event.type == SDL_WINDOWEVENT) != 0); if (__pyx_t_7) { /* "pyxelen.pyx":1336 * elif event.type == SDL_WINDOWEVENT: * * window_event = event.window # <<<<<<<<<<<<<< * * try: */ __pyx_t_25 = __pyx_v_event.window; __pyx_v_window_event = __pyx_t_25; /* "pyxelen.pyx":1338 * window_event = event.window * * try: # <<<<<<<<<<<<<< * window = self._find_window(window_event.windowID) * except IndexError: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_14); __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { /* "pyxelen.pyx":1339 * * try: * window = self._find_window(window_event.windowID) # <<<<<<<<<<<<<< * except IndexError: * # Ignore events for non-opened windows */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_find_window); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1339, __pyx_L125_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_20 = __Pyx_PyInt_From_uint32_t(__pyx_v_window_event.windowID); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1339, __pyx_L125_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_10) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1339, __pyx_L125_error) __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_20}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1339, __pyx_L125_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_20}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1339, __pyx_L125_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } else #endif { __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1339, __pyx_L125_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_10); __pyx_t_10 = NULL; __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_20); __pyx_t_20 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1339, __pyx_L125_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_window, __pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1338 * window_event = event.window * * try: # <<<<<<<<<<<<<< * window = self._find_window(window_event.windowID) * except IndexError: */ } /* "pyxelen.pyx":1344 * pass * else: * if window_event.event == SDL_WINDOWEVENT_SHOWN and hasattr(event_handler, 'on_window_shown'): # <<<<<<<<<<<<<< * event_handler.on_window_shown(window) * */ /*else:*/ { __pyx_t_2 = ((__pyx_v_window_event.event == SDL_WINDOWEVENT_SHOWN) != 0); if (__pyx_t_2) { } else { __pyx_t_7 = __pyx_t_2; goto __pyx_L134_bool_binop_done; } __pyx_t_2 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_window_shown); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1344, __pyx_L127_except_error) __pyx_t_6 = (__pyx_t_2 != 0); __pyx_t_7 = __pyx_t_6; __pyx_L134_bool_binop_done:; if (__pyx_t_7) { /* "pyxelen.pyx":1345 * else: * if window_event.event == SDL_WINDOWEVENT_SHOWN and hasattr(event_handler, 'on_window_shown'): * event_handler.on_window_shown(window) # <<<<<<<<<<<<<< * * elif window_event.event == SDL_WINDOWEVENT_HIDDEN and hasattr(event_handler, 'on_window_shown'): */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_window_shown); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1345, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_16) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1345, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_v_window}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1345, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_v_window}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1345, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_20 = PyTuple_New(1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1345, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_16); __pyx_t_16 = NULL; __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_20, 0+1, __pyx_v_window); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1345, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1344 * pass * else: * if window_event.event == SDL_WINDOWEVENT_SHOWN and hasattr(event_handler, 'on_window_shown'): # <<<<<<<<<<<<<< * event_handler.on_window_shown(window) * */ goto __pyx_L133; } /* "pyxelen.pyx":1347 * event_handler.on_window_shown(window) * * elif window_event.event == SDL_WINDOWEVENT_HIDDEN and hasattr(event_handler, 'on_window_shown'): # <<<<<<<<<<<<<< * event_handler.on_window_hidden(window) * */ __pyx_t_6 = ((__pyx_v_window_event.event == SDL_WINDOWEVENT_HIDDEN) != 0); if (__pyx_t_6) { } else { __pyx_t_7 = __pyx_t_6; goto __pyx_L136_bool_binop_done; } __pyx_t_6 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_window_shown); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1347, __pyx_L127_except_error) __pyx_t_2 = (__pyx_t_6 != 0); __pyx_t_7 = __pyx_t_2; __pyx_L136_bool_binop_done:; if (__pyx_t_7) { /* "pyxelen.pyx":1348 * * elif window_event.event == SDL_WINDOWEVENT_HIDDEN and hasattr(event_handler, 'on_window_shown'): * event_handler.on_window_hidden(window) # <<<<<<<<<<<<<< * * elif window_event.event == SDL_WINDOWEVENT_EXPOSED and hasattr(event_handler, 'on_window_exposed'): */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_window_hidden); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1348, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_20 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_20)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_20); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_20) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1348, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_v_window}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1348, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_v_window}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1348, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1348, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_20); __pyx_t_20 = NULL; __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_v_window); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1348, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1347 * event_handler.on_window_shown(window) * * elif window_event.event == SDL_WINDOWEVENT_HIDDEN and hasattr(event_handler, 'on_window_shown'): # <<<<<<<<<<<<<< * event_handler.on_window_hidden(window) * */ goto __pyx_L133; } /* "pyxelen.pyx":1350 * event_handler.on_window_hidden(window) * * elif window_event.event == SDL_WINDOWEVENT_EXPOSED and hasattr(event_handler, 'on_window_exposed'): # <<<<<<<<<<<<<< * event_handler.on_window_exposed(window and hasattr(event_handler, 'on_window_exposed')) * */ __pyx_t_2 = ((__pyx_v_window_event.event == SDL_WINDOWEVENT_EXPOSED) != 0); if (__pyx_t_2) { } else { __pyx_t_7 = __pyx_t_2; goto __pyx_L138_bool_binop_done; } __pyx_t_2 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_window_exposed); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1350, __pyx_L127_except_error) __pyx_t_6 = (__pyx_t_2 != 0); __pyx_t_7 = __pyx_t_6; __pyx_L138_bool_binop_done:; if (__pyx_t_7) { /* "pyxelen.pyx":1351 * * elif window_event.event == SDL_WINDOWEVENT_EXPOSED and hasattr(event_handler, 'on_window_exposed'): * event_handler.on_window_exposed(window and hasattr(event_handler, 'on_window_exposed')) # <<<<<<<<<<<<<< * * elif window_event.event == SDL_WINDOWEVENT_MOVED and hasattr(event_handler, 'on_window_moved'): */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_window_exposed); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1351, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_window); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1351, __pyx_L127_except_error) if (__pyx_t_7) { } else { __Pyx_INCREF(__pyx_v_window); __pyx_t_16 = __pyx_v_window; goto __pyx_L140_bool_binop_done; } __pyx_t_7 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_window_exposed); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1351, __pyx_L127_except_error) __pyx_t_20 = __Pyx_PyBool_FromLong(__pyx_t_7); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1351, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_16 = __pyx_t_20; __pyx_t_20 = 0; __pyx_L140_bool_binop_done:; __pyx_t_20 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_20)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_20); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_20) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1351, __pyx_L127_except_error) __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_t_16}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1351, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_t_16}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1351, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif { __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1351, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_20); __pyx_t_20 = NULL; __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_16); __pyx_t_16 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1351, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1350 * event_handler.on_window_hidden(window) * * elif window_event.event == SDL_WINDOWEVENT_EXPOSED and hasattr(event_handler, 'on_window_exposed'): # <<<<<<<<<<<<<< * event_handler.on_window_exposed(window and hasattr(event_handler, 'on_window_exposed')) * */ goto __pyx_L133; } /* "pyxelen.pyx":1353 * event_handler.on_window_exposed(window and hasattr(event_handler, 'on_window_exposed')) * * elif window_event.event == SDL_WINDOWEVENT_MOVED and hasattr(event_handler, 'on_window_moved'): # <<<<<<<<<<<<<< * event_handler.on_window_moved(window, event.window.data1, event.window.data2) * */ __pyx_t_6 = ((__pyx_v_window_event.event == SDL_WINDOWEVENT_MOVED) != 0); if (__pyx_t_6) { } else { __pyx_t_7 = __pyx_t_6; goto __pyx_L142_bool_binop_done; } __pyx_t_6 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_window_moved); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1353, __pyx_L127_except_error) __pyx_t_2 = (__pyx_t_6 != 0); __pyx_t_7 = __pyx_t_2; __pyx_L142_bool_binop_done:; if (__pyx_t_7) { /* "pyxelen.pyx":1354 * * elif window_event.event == SDL_WINDOWEVENT_MOVED and hasattr(event_handler, 'on_window_moved'): * event_handler.on_window_moved(window, event.window.data1, event.window.data2) # <<<<<<<<<<<<<< * * elif window_event.event == SDL_WINDOWEVENT_SIZE_CHANGED and hasattr(event_handler, 'on_window_size_changed'): */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_window_moved); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1354, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_10 = __Pyx_PyInt_From_int32_t(__pyx_v_event.window.data1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1354, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_16 = __Pyx_PyInt_From_int32_t(__pyx_v_event.window.data2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1354, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_20 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_20)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_20); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[4] = {__pyx_t_20, __pyx_v_window, __pyx_t_10, __pyx_t_16}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[4] = {__pyx_t_20, __pyx_v_window, __pyx_t_10, __pyx_t_16}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif { __pyx_t_23 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1354, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_23); if (__pyx_t_20) { __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_20); __pyx_t_20 = NULL; } __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_23, 0+__pyx_t_11, __pyx_v_window); __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_23, 1+__pyx_t_11, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_23, 2+__pyx_t_11, __pyx_t_16); __pyx_t_10 = 0; __pyx_t_16 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1353 * event_handler.on_window_exposed(window and hasattr(event_handler, 'on_window_exposed')) * * elif window_event.event == SDL_WINDOWEVENT_MOVED and hasattr(event_handler, 'on_window_moved'): # <<<<<<<<<<<<<< * event_handler.on_window_moved(window, event.window.data1, event.window.data2) * */ goto __pyx_L133; } /* "pyxelen.pyx":1356 * event_handler.on_window_moved(window, event.window.data1, event.window.data2) * * elif window_event.event == SDL_WINDOWEVENT_SIZE_CHANGED and hasattr(event_handler, 'on_window_size_changed'): # <<<<<<<<<<<<<< * event_handler.on_window_size_changed(window, event.window.data1, event.window.data2) * */ __pyx_t_2 = ((__pyx_v_window_event.event == SDL_WINDOWEVENT_SIZE_CHANGED) != 0); if (__pyx_t_2) { } else { __pyx_t_7 = __pyx_t_2; goto __pyx_L144_bool_binop_done; } __pyx_t_2 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_window_size_changed); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1356, __pyx_L127_except_error) __pyx_t_6 = (__pyx_t_2 != 0); __pyx_t_7 = __pyx_t_6; __pyx_L144_bool_binop_done:; if (__pyx_t_7) { /* "pyxelen.pyx":1357 * * elif window_event.event == SDL_WINDOWEVENT_SIZE_CHANGED and hasattr(event_handler, 'on_window_size_changed'): * event_handler.on_window_size_changed(window, event.window.data1, event.window.data2) # <<<<<<<<<<<<<< * * elif window_event.event == SDL_WINDOWEVENT_MINIMIZED and hasattr(event_handler, 'on_window_minimized'): */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_window_size_changed); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1357, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_23 = __Pyx_PyInt_From_int32_t(__pyx_v_event.window.data1); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1357, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_23); __pyx_t_16 = __Pyx_PyInt_From_int32_t(__pyx_v_event.window.data2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1357, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_16); __pyx_t_10 = NULL; __pyx_t_11 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_window, __pyx_t_23, __pyx_t_16}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_window, __pyx_t_23, __pyx_t_16}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } else #endif { __pyx_t_20 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1357, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_20); if (__pyx_t_10) { __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_10); __pyx_t_10 = NULL; } __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_11, __pyx_v_window); __Pyx_GIVEREF(__pyx_t_23); PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_11, __pyx_t_23); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_11, __pyx_t_16); __pyx_t_23 = 0; __pyx_t_16 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1356 * event_handler.on_window_moved(window, event.window.data1, event.window.data2) * * elif window_event.event == SDL_WINDOWEVENT_SIZE_CHANGED and hasattr(event_handler, 'on_window_size_changed'): # <<<<<<<<<<<<<< * event_handler.on_window_size_changed(window, event.window.data1, event.window.data2) * */ goto __pyx_L133; } /* "pyxelen.pyx":1359 * event_handler.on_window_size_changed(window, event.window.data1, event.window.data2) * * elif window_event.event == SDL_WINDOWEVENT_MINIMIZED and hasattr(event_handler, 'on_window_minimized'): # <<<<<<<<<<<<<< * event_handler.on_window_minimized(window) * */ __pyx_t_6 = ((__pyx_v_window_event.event == SDL_WINDOWEVENT_MINIMIZED) != 0); if (__pyx_t_6) { } else { __pyx_t_7 = __pyx_t_6; goto __pyx_L146_bool_binop_done; } __pyx_t_6 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_window_minimized); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1359, __pyx_L127_except_error) __pyx_t_2 = (__pyx_t_6 != 0); __pyx_t_7 = __pyx_t_2; __pyx_L146_bool_binop_done:; if (__pyx_t_7) { /* "pyxelen.pyx":1360 * * elif window_event.event == SDL_WINDOWEVENT_MINIMIZED and hasattr(event_handler, 'on_window_minimized'): * event_handler.on_window_minimized(window) # <<<<<<<<<<<<<< * * elif window_event.event == SDL_WINDOWEVENT_MAXIMIZED and hasattr(event_handler, 'on_window_maximized'): */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_window_minimized); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1360, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_20 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_20)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_20); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_20) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_v_window}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_v_window}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1360, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_20); __pyx_t_20 = NULL; __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_v_window); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1359 * event_handler.on_window_size_changed(window, event.window.data1, event.window.data2) * * elif window_event.event == SDL_WINDOWEVENT_MINIMIZED and hasattr(event_handler, 'on_window_minimized'): # <<<<<<<<<<<<<< * event_handler.on_window_minimized(window) * */ goto __pyx_L133; } /* "pyxelen.pyx":1362 * event_handler.on_window_minimized(window) * * elif window_event.event == SDL_WINDOWEVENT_MAXIMIZED and hasattr(event_handler, 'on_window_maximized'): # <<<<<<<<<<<<<< * event_handler.on_window_maximized(window) * */ __pyx_t_2 = ((__pyx_v_window_event.event == SDL_WINDOWEVENT_MAXIMIZED) != 0); if (__pyx_t_2) { } else { __pyx_t_7 = __pyx_t_2; goto __pyx_L148_bool_binop_done; } __pyx_t_2 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_window_maximized); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1362, __pyx_L127_except_error) __pyx_t_6 = (__pyx_t_2 != 0); __pyx_t_7 = __pyx_t_6; __pyx_L148_bool_binop_done:; if (__pyx_t_7) { /* "pyxelen.pyx":1363 * * elif window_event.event == SDL_WINDOWEVENT_MAXIMIZED and hasattr(event_handler, 'on_window_maximized'): * event_handler.on_window_maximized(window) # <<<<<<<<<<<<<< * * elif window_event.event == SDL_WINDOWEVENT_RESTORED and hasattr(event_handler, 'on_window_restored'): */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_window_maximized); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1363, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_16) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_v_window}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_v_window}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_20 = PyTuple_New(1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1363, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_16); __pyx_t_16 = NULL; __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_20, 0+1, __pyx_v_window); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1362 * event_handler.on_window_minimized(window) * * elif window_event.event == SDL_WINDOWEVENT_MAXIMIZED and hasattr(event_handler, 'on_window_maximized'): # <<<<<<<<<<<<<< * event_handler.on_window_maximized(window) * */ goto __pyx_L133; } /* "pyxelen.pyx":1365 * event_handler.on_window_maximized(window) * * elif window_event.event == SDL_WINDOWEVENT_RESTORED and hasattr(event_handler, 'on_window_restored'): # <<<<<<<<<<<<<< * event_handler.on_window_restored(window) * */ __pyx_t_6 = ((__pyx_v_window_event.event == SDL_WINDOWEVENT_RESTORED) != 0); if (__pyx_t_6) { } else { __pyx_t_7 = __pyx_t_6; goto __pyx_L150_bool_binop_done; } __pyx_t_6 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_window_restored); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1365, __pyx_L127_except_error) __pyx_t_2 = (__pyx_t_6 != 0); __pyx_t_7 = __pyx_t_2; __pyx_L150_bool_binop_done:; if (__pyx_t_7) { /* "pyxelen.pyx":1366 * * elif window_event.event == SDL_WINDOWEVENT_RESTORED and hasattr(event_handler, 'on_window_restored'): * event_handler.on_window_restored(window) # <<<<<<<<<<<<<< * * elif window_event.event == SDL_WINDOWEVENT_ENTER and hasattr(event_handler, 'on_window_enter'): */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_window_restored); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1366, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_20 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_20)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_20); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_20) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_v_window}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_v_window}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1366, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_20); __pyx_t_20 = NULL; __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_v_window); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1365 * event_handler.on_window_maximized(window) * * elif window_event.event == SDL_WINDOWEVENT_RESTORED and hasattr(event_handler, 'on_window_restored'): # <<<<<<<<<<<<<< * event_handler.on_window_restored(window) * */ goto __pyx_L133; } /* "pyxelen.pyx":1368 * event_handler.on_window_restored(window) * * elif window_event.event == SDL_WINDOWEVENT_ENTER and hasattr(event_handler, 'on_window_enter'): # <<<<<<<<<<<<<< * event_handler.on_window_enter(window) * */ __pyx_t_2 = ((__pyx_v_window_event.event == SDL_WINDOWEVENT_ENTER) != 0); if (__pyx_t_2) { } else { __pyx_t_7 = __pyx_t_2; goto __pyx_L152_bool_binop_done; } __pyx_t_2 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_window_enter); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1368, __pyx_L127_except_error) __pyx_t_6 = (__pyx_t_2 != 0); __pyx_t_7 = __pyx_t_6; __pyx_L152_bool_binop_done:; if (__pyx_t_7) { /* "pyxelen.pyx":1369 * * elif window_event.event == SDL_WINDOWEVENT_ENTER and hasattr(event_handler, 'on_window_enter'): * event_handler.on_window_enter(window) # <<<<<<<<<<<<<< * * elif window_event.event == SDL_WINDOWEVENT_LEAVE and hasattr(event_handler, 'on_window_leave'): */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_window_enter); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1369, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_16) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1369, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_v_window}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1369, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_v_window}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1369, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_20 = PyTuple_New(1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1369, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_16); __pyx_t_16 = NULL; __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_20, 0+1, __pyx_v_window); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1369, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1368 * event_handler.on_window_restored(window) * * elif window_event.event == SDL_WINDOWEVENT_ENTER and hasattr(event_handler, 'on_window_enter'): # <<<<<<<<<<<<<< * event_handler.on_window_enter(window) * */ goto __pyx_L133; } /* "pyxelen.pyx":1371 * event_handler.on_window_enter(window) * * elif window_event.event == SDL_WINDOWEVENT_LEAVE and hasattr(event_handler, 'on_window_leave'): # <<<<<<<<<<<<<< * event_handler.on_window_leave(window) * */ __pyx_t_6 = ((__pyx_v_window_event.event == SDL_WINDOWEVENT_LEAVE) != 0); if (__pyx_t_6) { } else { __pyx_t_7 = __pyx_t_6; goto __pyx_L154_bool_binop_done; } __pyx_t_6 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_window_leave); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1371, __pyx_L127_except_error) __pyx_t_2 = (__pyx_t_6 != 0); __pyx_t_7 = __pyx_t_2; __pyx_L154_bool_binop_done:; if (__pyx_t_7) { /* "pyxelen.pyx":1372 * * elif window_event.event == SDL_WINDOWEVENT_LEAVE and hasattr(event_handler, 'on_window_leave'): * event_handler.on_window_leave(window) # <<<<<<<<<<<<<< * * elif window_event.event == SDL_WINDOWEVENT_FOCUS_GAINED and hasattr(event_handler, 'on_window_focus_gained'): */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_window_leave); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1372, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_20 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_20)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_20); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_20) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_v_window}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_v_window}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1372, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_20); __pyx_t_20 = NULL; __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_v_window); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1372, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1371 * event_handler.on_window_enter(window) * * elif window_event.event == SDL_WINDOWEVENT_LEAVE and hasattr(event_handler, 'on_window_leave'): # <<<<<<<<<<<<<< * event_handler.on_window_leave(window) * */ goto __pyx_L133; } /* "pyxelen.pyx":1374 * event_handler.on_window_leave(window) * * elif window_event.event == SDL_WINDOWEVENT_FOCUS_GAINED and hasattr(event_handler, 'on_window_focus_gained'): # <<<<<<<<<<<<<< * event_handler.on_window_focus_gained(window) * */ __pyx_t_2 = ((__pyx_v_window_event.event == SDL_WINDOWEVENT_FOCUS_GAINED) != 0); if (__pyx_t_2) { } else { __pyx_t_7 = __pyx_t_2; goto __pyx_L156_bool_binop_done; } __pyx_t_2 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_window_focus_gained); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 1374, __pyx_L127_except_error) __pyx_t_6 = (__pyx_t_2 != 0); __pyx_t_7 = __pyx_t_6; __pyx_L156_bool_binop_done:; if (__pyx_t_7) { /* "pyxelen.pyx":1375 * * elif window_event.event == SDL_WINDOWEVENT_FOCUS_GAINED and hasattr(event_handler, 'on_window_focus_gained'): * event_handler.on_window_focus_gained(window) # <<<<<<<<<<<<<< * * elif window_event.event == SDL_WINDOWEVENT_FOCUS_LOST and hasattr(event_handler, 'on_window_focus_lost'): */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_window_focus_gained); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1375, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_16) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1375, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_v_window}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1375, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_v_window}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1375, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_20 = PyTuple_New(1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1375, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_16); __pyx_t_16 = NULL; __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_20, 0+1, __pyx_v_window); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1375, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1374 * event_handler.on_window_leave(window) * * elif window_event.event == SDL_WINDOWEVENT_FOCUS_GAINED and hasattr(event_handler, 'on_window_focus_gained'): # <<<<<<<<<<<<<< * event_handler.on_window_focus_gained(window) * */ goto __pyx_L133; } /* "pyxelen.pyx":1377 * event_handler.on_window_focus_gained(window) * * elif window_event.event == SDL_WINDOWEVENT_FOCUS_LOST and hasattr(event_handler, 'on_window_focus_lost'): # <<<<<<<<<<<<<< * event_handler.on_window_focus_lost(window) * */ __pyx_t_6 = ((__pyx_v_window_event.event == SDL_WINDOWEVENT_FOCUS_LOST) != 0); if (__pyx_t_6) { } else { __pyx_t_7 = __pyx_t_6; goto __pyx_L158_bool_binop_done; } __pyx_t_6 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_window_focus_lost); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1377, __pyx_L127_except_error) __pyx_t_2 = (__pyx_t_6 != 0); __pyx_t_7 = __pyx_t_2; __pyx_L158_bool_binop_done:; if (__pyx_t_7) { /* "pyxelen.pyx":1378 * * elif window_event.event == SDL_WINDOWEVENT_FOCUS_LOST and hasattr(event_handler, 'on_window_focus_lost'): * event_handler.on_window_focus_lost(window) # <<<<<<<<<<<<<< * * elif window_event.event == SDL_WINDOWEVENT_CLOSE: */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_window_focus_lost); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1378, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_20 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_20)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_20); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_20) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_v_window}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_20, __pyx_v_window}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1378, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_20); __pyx_t_20 = NULL; __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_v_window); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1377 * event_handler.on_window_focus_gained(window) * * elif window_event.event == SDL_WINDOWEVENT_FOCUS_LOST and hasattr(event_handler, 'on_window_focus_lost'): # <<<<<<<<<<<<<< * event_handler.on_window_focus_lost(window) * */ goto __pyx_L133; } /* "pyxelen.pyx":1380 * event_handler.on_window_focus_lost(window) * * elif window_event.event == SDL_WINDOWEVENT_CLOSE: # <<<<<<<<<<<<<< * if hasattr(event_handler, 'on_window_close'): * event_handler.on_window_close(window) */ __pyx_t_7 = ((__pyx_v_window_event.event == SDL_WINDOWEVENT_CLOSE) != 0); if (__pyx_t_7) { /* "pyxelen.pyx":1381 * * elif window_event.event == SDL_WINDOWEVENT_CLOSE: * if hasattr(event_handler, 'on_window_close'): # <<<<<<<<<<<<<< * event_handler.on_window_close(window) * self._windows = [w for w in self._windows if w is not window] */ __pyx_t_7 = __Pyx_HasAttr(__pyx_v_event_handler, __pyx_n_s_on_window_close); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1381, __pyx_L127_except_error) __pyx_t_2 = (__pyx_t_7 != 0); if (__pyx_t_2) { /* "pyxelen.pyx":1382 * elif window_event.event == SDL_WINDOWEVENT_CLOSE: * if hasattr(event_handler, 'on_window_close'): * event_handler.on_window_close(window) # <<<<<<<<<<<<<< * self._windows = [w for w in self._windows if w is not window] * */ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_window_close); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1382, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_16 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) { __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_12); if (likely(__pyx_t_16)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); __Pyx_INCREF(__pyx_t_16); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_12, function); } } if (!__pyx_t_16) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_window); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1382, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); } else { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_v_window}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1382, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) { PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_v_window}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1382, __pyx_L127_except_error) __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_20 = PyTuple_New(1+1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1382, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_16); __pyx_t_16 = NULL; __Pyx_INCREF(__pyx_v_window); __Pyx_GIVEREF(__pyx_v_window); PyTuple_SET_ITEM(__pyx_t_20, 0+1, __pyx_v_window); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1382, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1381 * * elif window_event.event == SDL_WINDOWEVENT_CLOSE: * if hasattr(event_handler, 'on_window_close'): # <<<<<<<<<<<<<< * event_handler.on_window_close(window) * self._windows = [w for w in self._windows if w is not window] */ } /* "pyxelen.pyx":1383 * if hasattr(event_handler, 'on_window_close'): * event_handler.on_window_close(window) * self._windows = [w for w in self._windows if w is not window] # <<<<<<<<<<<<<< * * event_handler.on_update_and_render() */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1383, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_windows); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1383, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_12); if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) { __pyx_t_20 = __pyx_t_12; __Pyx_INCREF(__pyx_t_20); __pyx_t_5 = 0; __pyx_t_26 = NULL; } else { __pyx_t_5 = -1; __pyx_t_20 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1383, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_26 = Py_TYPE(__pyx_t_20)->tp_iternext; if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 1383, __pyx_L127_except_error) } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; for (;;) { if (likely(!__pyx_t_26)) { if (likely(PyList_CheckExact(__pyx_t_20))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_20)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_12 = PyList_GET_ITEM(__pyx_t_20, __pyx_t_5); __Pyx_INCREF(__pyx_t_12); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1383, __pyx_L127_except_error) #else __pyx_t_12 = PySequence_ITEM(__pyx_t_20, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1383, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_12); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_20)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_20, __pyx_t_5); __Pyx_INCREF(__pyx_t_12); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1383, __pyx_L127_except_error) #else __pyx_t_12 = PySequence_ITEM(__pyx_t_20, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1383, __pyx_L127_except_error) __Pyx_GOTREF(__pyx_t_12); #endif } } else { __pyx_t_12 = __pyx_t_26(__pyx_t_20); if (unlikely(!__pyx_t_12)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 1383, __pyx_L127_except_error) } break; } __Pyx_GOTREF(__pyx_t_12); } __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_12); __pyx_t_12 = 0; __pyx_t_2 = (__pyx_v_w != __pyx_v_window); __pyx_t_7 = (__pyx_t_2 != 0); if (__pyx_t_7) { if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_w))) __PYX_ERR(0, 1383, __pyx_L127_except_error) } } __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_windows, __pyx_t_1) < 0) __PYX_ERR(0, 1383, __pyx_L127_except_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1380 * event_handler.on_window_focus_lost(window) * * elif window_event.event == SDL_WINDOWEVENT_CLOSE: # <<<<<<<<<<<<<< * if hasattr(event_handler, 'on_window_close'): * event_handler.on_window_close(window) */ } __pyx_L133:; } __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; goto __pyx_L132_try_end; __pyx_L125_error:; __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0; __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1340 * try: * window = self._find_window(window_event.windowID) * except IndexError: # <<<<<<<<<<<<<< * # Ignore events for non-opened windows * pass */ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_IndexError); if (__pyx_t_11) { __Pyx_ErrRestore(0,0,0); goto __pyx_L126_exception_handled; } goto __pyx_L127_except_error; __pyx_L127_except_error:; /* "pyxelen.pyx":1338 * window_event = event.window * * try: # <<<<<<<<<<<<<< * window = self._find_window(window_event.windowID) * except IndexError: */ __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); goto __pyx_L1_error; __pyx_L126_exception_handled:; __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_14); __Pyx_XGIVEREF(__pyx_t_13); __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_14, __pyx_t_13); __pyx_L132_try_end:; } /* "pyxelen.pyx":1334 * event_handler.on_render_targets_reset() * * elif event.type == SDL_WINDOWEVENT: # <<<<<<<<<<<<<< * * window_event = event.window */ } __pyx_L7:; } /* "pyxelen.pyx":1385 * self._windows = [w for w in self._windows if w is not window] * * event_handler.on_update_and_render() # <<<<<<<<<<<<<< * * current_ticks = SDL_GetTicks() */ __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_event_handler, __pyx_n_s_on_update_and_render); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1385, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_20))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_20); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_20, function); } } if (__pyx_t_12) { __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else { __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error) } __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1387 * event_handler.on_update_and_render() * * current_ticks = SDL_GetTicks() # <<<<<<<<<<<<<< * if current_ticks < last_frame_ticks + ticks_per_frame: * SDL_Delay(last_frame_ticks + ticks_per_frame - current_ticks) */ __pyx_v_current_ticks = SDL_GetTicks(); /* "pyxelen.pyx":1388 * * current_ticks = SDL_GetTicks() * if current_ticks < last_frame_ticks + ticks_per_frame: # <<<<<<<<<<<<<< * SDL_Delay(last_frame_ticks + ticks_per_frame - current_ticks) * last_frame_ticks = SDL_GetTicks() */ __pyx_t_7 = ((__pyx_v_current_ticks < (__pyx_v_last_frame_ticks + __pyx_v_ticks_per_frame)) != 0); if (__pyx_t_7) { /* "pyxelen.pyx":1389 * current_ticks = SDL_GetTicks() * if current_ticks < last_frame_ticks + ticks_per_frame: * SDL_Delay(last_frame_ticks + ticks_per_frame - current_ticks) # <<<<<<<<<<<<<< * last_frame_ticks = SDL_GetTicks() * */ SDL_Delay(((__pyx_v_last_frame_ticks + __pyx_v_ticks_per_frame) - __pyx_v_current_ticks)); /* "pyxelen.pyx":1388 * * current_ticks = SDL_GetTicks() * if current_ticks < last_frame_ticks + ticks_per_frame: # <<<<<<<<<<<<<< * SDL_Delay(last_frame_ticks + ticks_per_frame - current_ticks) * last_frame_ticks = SDL_GetTicks() */ } /* "pyxelen.pyx":1390 * if current_ticks < last_frame_ticks + ticks_per_frame: * SDL_Delay(last_frame_ticks + ticks_per_frame - current_ticks) * last_frame_ticks = SDL_GetTicks() # <<<<<<<<<<<<<< * * */ __pyx_v_last_frame_ticks = SDL_GetTicks(); } /* "pyxelen.pyx":1150 * ][0] * * def run(self, event_handler, fps): # <<<<<<<<<<<<<< * cdef SDL_Event event * assert fps > 0, 'fps must be positive' */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_12); __Pyx_XDECREF(__pyx_t_16); __Pyx_XDECREF(__pyx_t_18); __Pyx_XDECREF(__pyx_t_19); __Pyx_XDECREF(__pyx_t_20); __Pyx_XDECREF(__pyx_t_21); __Pyx_XDECREF(__pyx_t_22); __Pyx_XDECREF(__pyx_t_23); __Pyx_AddTraceback("pyxelen.Pyxelen.run", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_button); __Pyx_XDECREF(__pyx_v_controller); __Pyx_XDECREF(__pyx_v_x); __Pyx_XDECREF(__pyx_v_y); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_window); __Pyx_XDECREF(__pyx_v_mods); __Pyx_XDECREF(__pyx_v_w); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1393 * * * def get_error(): # <<<<<<<<<<<<<< * return SDL_GetError().decode('utf-8') * */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_1get_error(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_1get_error = {"get_error", (PyCFunction)__pyx_pw_7pyxelen_1get_error, METH_NOARGS, 0}; static PyObject *__pyx_pw_7pyxelen_1get_error(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_error (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_get_error(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_get_error(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations char const *__pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_error", 0); /* "pyxelen.pyx":1394 * * def get_error(): * return SDL_GetError().decode('utf-8') # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = SDL_GetError(); __pyx_t_2 = __Pyx_decode_c_string(__pyx_t_1, 0, strlen(__pyx_t_1), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_r = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; /* "pyxelen.pyx":1393 * * * def get_error(): # <<<<<<<<<<<<<< * return SDL_GetError().decode('utf-8') * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("pyxelen.get_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1397 * * * def init(): # <<<<<<<<<<<<<< * assert SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER) == 0 * assert IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG) == (IMG_INIT_JPG | IMG_INIT_PNG) */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_3init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_3init = {"init", (PyCFunction)__pyx_pw_7pyxelen_3init, METH_NOARGS, 0}; static PyObject *__pyx_pw_7pyxelen_3init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_2init(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_2init(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init", 0); /* "pyxelen.pyx":1398 * * def init(): * assert SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER) == 0 # <<<<<<<<<<<<<< * assert IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG) == (IMG_INIT_JPG | IMG_INIT_PNG) * assert Mix_Init(MIX_INIT_OGG) == MIX_INIT_OGG */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((SDL_Init(((SDL_INIT_AUDIO | SDL_INIT_VIDEO) | SDL_INIT_GAMECONTROLLER)) == 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1398, __pyx_L1_error) } } #endif /* "pyxelen.pyx":1399 * def init(): * assert SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER) == 0 * assert IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG) == (IMG_INIT_JPG | IMG_INIT_PNG) # <<<<<<<<<<<<<< * assert Mix_Init(MIX_INIT_OGG) == MIX_INIT_OGG * assert Mix_OpenAudio(MIX_DEFAULT_FREQUENCY * 2, MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, 1024) >= 0 */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((IMG_Init((IMG_INIT_JPG | IMG_INIT_PNG)) == (IMG_INIT_JPG | IMG_INIT_PNG)) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1399, __pyx_L1_error) } } #endif /* "pyxelen.pyx":1400 * assert SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER) == 0 * assert IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG) == (IMG_INIT_JPG | IMG_INIT_PNG) * assert Mix_Init(MIX_INIT_OGG) == MIX_INIT_OGG # <<<<<<<<<<<<<< * assert Mix_OpenAudio(MIX_DEFAULT_FREQUENCY * 2, MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, 1024) >= 0 * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((Mix_Init(MIX_INIT_OGG) == MIX_INIT_OGG) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1400, __pyx_L1_error) } } #endif /* "pyxelen.pyx":1401 * assert IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG) == (IMG_INIT_JPG | IMG_INIT_PNG) * assert Mix_Init(MIX_INIT_OGG) == MIX_INIT_OGG * assert Mix_OpenAudio(MIX_DEFAULT_FREQUENCY * 2, MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, 1024) >= 0 # <<<<<<<<<<<<<< * * */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(!Py_OptimizeFlag)) { if (unlikely(!((Mix_OpenAudio((MIX_DEFAULT_FREQUENCY * 2), MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, 0x400) >= 0) != 0))) { PyErr_SetNone(PyExc_AssertionError); __PYX_ERR(0, 1401, __pyx_L1_error) } } #endif /* "pyxelen.pyx":1397 * * * def init(): # <<<<<<<<<<<<<< * assert SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER) == 0 * assert IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG) == (IMG_INIT_JPG | IMG_INIT_PNG) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("pyxelen.init", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "pyxelen.pyx":1404 * * * def quit(): # <<<<<<<<<<<<<< * Mix_CloseAudio() * Mix_Quit() */ /* Python wrapper */ static PyObject *__pyx_pw_7pyxelen_5quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_7pyxelen_5quit = {"quit", (PyCFunction)__pyx_pw_7pyxelen_5quit, METH_NOARGS, 0}; static PyObject *__pyx_pw_7pyxelen_5quit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit (wrapper)", 0); __pyx_r = __pyx_pf_7pyxelen_4quit(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7pyxelen_4quit(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("quit", 0); /* "pyxelen.pyx":1405 * * def quit(): * Mix_CloseAudio() # <<<<<<<<<<<<<< * Mix_Quit() * IMG_Quit() */ Mix_CloseAudio(); /* "pyxelen.pyx":1406 * def quit(): * Mix_CloseAudio() * Mix_Quit() # <<<<<<<<<<<<<< * IMG_Quit() * SDL_Quit() */ Mix_Quit(); /* "pyxelen.pyx":1407 * Mix_CloseAudio() * Mix_Quit() * IMG_Quit() # <<<<<<<<<<<<<< * SDL_Quit() */ IMG_Quit(); /* "pyxelen.pyx":1408 * Mix_Quit() * IMG_Quit() * SDL_Quit() # <<<<<<<<<<<<<< */ SDL_Quit(); /* "pyxelen.pyx":1404 * * * def quit(): # <<<<<<<<<<<<<< * Mix_CloseAudio() * Mix_Quit() */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_7pyxelen_Effect(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; return o; } static void __pyx_tp_dealloc_7pyxelen_Effect(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_7pyxelen_6Effect_1__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } (*Py_TYPE(o)->tp_free)(o); } static PyMethodDef __pyx_methods_7pyxelen_Effect[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyxelen_6Effect_3__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyxelen_6Effect_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7pyxelen_Effect = { PyVarObject_HEAD_INIT(0, 0) "pyxelen.Effect", /*tp_name*/ sizeof(struct __pyx_obj_7pyxelen_Effect), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7pyxelen_Effect, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7pyxelen_Effect, /*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*/ __pyx_tp_new_7pyxelen_Effect, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_7pyxelen_Music(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; return o; } static void __pyx_tp_dealloc_7pyxelen_Music(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_7pyxelen_5Music_1__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } (*Py_TYPE(o)->tp_free)(o); } static PyMethodDef __pyx_methods_7pyxelen_Music[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyxelen_5Music_3__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyxelen_5Music_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7pyxelen_Music = { PyVarObject_HEAD_INIT(0, 0) "pyxelen.Music", /*tp_name*/ sizeof(struct __pyx_obj_7pyxelen_Music), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7pyxelen_Music, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7pyxelen_Music, /*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*/ __pyx_tp_new_7pyxelen_Music, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_7pyxelen_Window(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; return o; } static void __pyx_tp_dealloc_7pyxelen_Window(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_7pyxelen_6Window_1__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } (*Py_TYPE(o)->tp_free)(o); } static PyObject *__pyx_getprop_7pyxelen_6Window_window_id(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7pyxelen_6Window_9window_id_1__get__(o); } static PyObject *__pyx_getprop_7pyxelen_6Window_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7pyxelen_6Window_4size_1__get__(o); } static PyMethodDef __pyx_methods_7pyxelen_Window[] = { {"create_renderer", (PyCFunction)__pyx_pw_7pyxelen_6Window_3create_renderer, METH_NOARGS, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyxelen_6Window_5__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyxelen_6Window_7__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_7pyxelen_Window[] = { {(char *)"window_id", __pyx_getprop_7pyxelen_6Window_window_id, 0, (char *)0, 0}, {(char *)"size", __pyx_getprop_7pyxelen_6Window_size, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_7pyxelen_Window = { PyVarObject_HEAD_INIT(0, 0) "pyxelen.Window", /*tp_name*/ sizeof(struct __pyx_obj_7pyxelen_Window), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7pyxelen_Window, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7pyxelen_Window, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_7pyxelen_Window, /*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*/ __pyx_tp_new_7pyxelen_Window, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_7pyxelen_Surface(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; return o; } static void __pyx_tp_dealloc_7pyxelen_Surface(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_7pyxelen_7Surface_1__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } (*Py_TYPE(o)->tp_free)(o); } static PyMethodDef __pyx_methods_7pyxelen_Surface[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyxelen_7Surface_3__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyxelen_7Surface_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7pyxelen_Surface = { PyVarObject_HEAD_INIT(0, 0) "pyxelen.Surface", /*tp_name*/ sizeof(struct __pyx_obj_7pyxelen_Surface), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7pyxelen_Surface, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7pyxelen_Surface, /*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*/ __pyx_tp_new_7pyxelen_Surface, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_7pyxelen_Texture(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; return o; } static void __pyx_tp_dealloc_7pyxelen_Texture(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_7pyxelen_7Texture_1__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } (*Py_TYPE(o)->tp_free)(o); } static PyObject *__pyx_getprop_7pyxelen_7Texture_size(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7pyxelen_7Texture_4size_1__get__(o); } static PyMethodDef __pyx_methods_7pyxelen_Texture[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyxelen_7Texture_3__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyxelen_7Texture_5__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_7pyxelen_Texture[] = { {(char *)"size", __pyx_getprop_7pyxelen_7Texture_size, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_7pyxelen_Texture = { PyVarObject_HEAD_INIT(0, 0) "pyxelen.Texture", /*tp_name*/ sizeof(struct __pyx_obj_7pyxelen_Texture), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7pyxelen_Texture, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7pyxelen_Texture, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_7pyxelen_Texture, /*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*/ __pyx_tp_new_7pyxelen_Texture, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyObject *__pyx_tp_new_7pyxelen_Renderer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) { o = (*t->tp_alloc)(t, 0); } else { o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0); } if (unlikely(!o)) return 0; return o; } static void __pyx_tp_dealloc_7pyxelen_Renderer(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pw_7pyxelen_8Renderer_1__dealloc__(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } (*Py_TYPE(o)->tp_free)(o); } static PyObject *__pyx_getprop_7pyxelen_8Renderer_draw_color(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7pyxelen_8Renderer_10draw_color_1__get__(o); } static int __pyx_setprop_7pyxelen_8Renderer_draw_color(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_7pyxelen_8Renderer_10draw_color_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyObject *__pyx_getprop_7pyxelen_8Renderer_target(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7pyxelen_8Renderer_6target_1__get__(o); } static int __pyx_setprop_7pyxelen_8Renderer_target(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_7pyxelen_8Renderer_6target_3__set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); return -1; } } static PyMethodDef __pyx_methods_7pyxelen_Renderer[] = { {"create_texture", (PyCFunction)__pyx_pw_7pyxelen_8Renderer_3create_texture, METH_VARARGS|METH_KEYWORDS, 0}, {"create_texture_from_surface", (PyCFunction)__pyx_pw_7pyxelen_8Renderer_5create_texture_from_surface, METH_O, 0}, {"create_texture_from_image", (PyCFunction)__pyx_pw_7pyxelen_8Renderer_7create_texture_from_image, METH_O, 0}, {"copy", (PyCFunction)__pyx_pw_7pyxelen_8Renderer_9copy, METH_VARARGS|METH_KEYWORDS, 0}, {"clear", (PyCFunction)__pyx_pw_7pyxelen_8Renderer_11clear, METH_NOARGS, 0}, {"present", (PyCFunction)__pyx_pw_7pyxelen_8Renderer_13present, METH_NOARGS, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyxelen_8Renderer_15__reduce_cython__, METH_NOARGS, 0}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyxelen_8Renderer_17__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_7pyxelen_Renderer[] = { {(char *)"draw_color", __pyx_getprop_7pyxelen_8Renderer_draw_color, __pyx_setprop_7pyxelen_8Renderer_draw_color, (char *)0, 0}, {(char *)"target", __pyx_getprop_7pyxelen_8Renderer_target, __pyx_setprop_7pyxelen_8Renderer_target, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_7pyxelen_Renderer = { PyVarObject_HEAD_INIT(0, 0) "pyxelen.Renderer", /*tp_name*/ sizeof(struct __pyx_obj_7pyxelen_Renderer), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7pyxelen_Renderer, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7pyxelen_Renderer, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_7pyxelen_Renderer, /*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*/ __pyx_tp_new_7pyxelen_Renderer, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_pyxelen(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_pyxelen}, {0, NULL} }; #endif static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, "pyxelen", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1}, {&__pyx_n_s_AC_BACK, __pyx_k_AC_BACK, sizeof(__pyx_k_AC_BACK), 0, 0, 1, 1}, {&__pyx_n_s_AC_BOOKMARKS, __pyx_k_AC_BOOKMARKS, sizeof(__pyx_k_AC_BOOKMARKS), 0, 0, 1, 1}, {&__pyx_n_s_AC_FORWARD, __pyx_k_AC_FORWARD, sizeof(__pyx_k_AC_FORWARD), 0, 0, 1, 1}, {&__pyx_n_s_AC_HOME, __pyx_k_AC_HOME, sizeof(__pyx_k_AC_HOME), 0, 0, 1, 1}, {&__pyx_n_s_AC_REFRESH, __pyx_k_AC_REFRESH, sizeof(__pyx_k_AC_REFRESH), 0, 0, 1, 1}, {&__pyx_n_s_AC_SEARCH, __pyx_k_AC_SEARCH, sizeof(__pyx_k_AC_SEARCH), 0, 0, 1, 1}, {&__pyx_n_s_AC_STOP, __pyx_k_AC_STOP, sizeof(__pyx_k_AC_STOP), 0, 0, 1, 1}, {&__pyx_n_s_AGAIN, __pyx_k_AGAIN, sizeof(__pyx_k_AGAIN), 0, 0, 1, 1}, {&__pyx_n_s_ALTERASE, __pyx_k_ALTERASE, sizeof(__pyx_k_ALTERASE), 0, 0, 1, 1}, {&__pyx_n_s_AMPERSAND, __pyx_k_AMPERSAND, sizeof(__pyx_k_AMPERSAND), 0, 0, 1, 1}, {&__pyx_n_s_APP1, __pyx_k_APP1, sizeof(__pyx_k_APP1), 0, 0, 1, 1}, {&__pyx_n_s_APP2, __pyx_k_APP2, sizeof(__pyx_k_APP2), 0, 0, 1, 1}, {&__pyx_n_s_APPLICATION, __pyx_k_APPLICATION, sizeof(__pyx_k_APPLICATION), 0, 0, 1, 1}, {&__pyx_n_s_ASTERISK, __pyx_k_ASTERISK, sizeof(__pyx_k_ASTERISK), 0, 0, 1, 1}, {&__pyx_n_s_AT, __pyx_k_AT, sizeof(__pyx_k_AT), 0, 0, 1, 1}, {&__pyx_n_s_AUDIOFASTFORWARD, __pyx_k_AUDIOFASTFORWARD, sizeof(__pyx_k_AUDIOFASTFORWARD), 0, 0, 1, 1}, {&__pyx_n_s_AUDIOMUTE, __pyx_k_AUDIOMUTE, sizeof(__pyx_k_AUDIOMUTE), 0, 0, 1, 1}, {&__pyx_n_s_AUDIONEXT, __pyx_k_AUDIONEXT, sizeof(__pyx_k_AUDIONEXT), 0, 0, 1, 1}, {&__pyx_n_s_AUDIOPLAY, __pyx_k_AUDIOPLAY, sizeof(__pyx_k_AUDIOPLAY), 0, 0, 1, 1}, {&__pyx_n_s_AUDIOPREV, __pyx_k_AUDIOPREV, sizeof(__pyx_k_AUDIOPREV), 0, 0, 1, 1}, {&__pyx_n_s_AUDIOREWIND, __pyx_k_AUDIOREWIND, sizeof(__pyx_k_AUDIOREWIND), 0, 0, 1, 1}, {&__pyx_n_s_AUDIOSTOP, __pyx_k_AUDIOSTOP, sizeof(__pyx_k_AUDIOSTOP), 0, 0, 1, 1}, {&__pyx_n_s_Audio, __pyx_k_Audio, sizeof(__pyx_k_Audio), 0, 0, 1, 1}, {&__pyx_n_s_Audio___init, __pyx_k_Audio___init, sizeof(__pyx_k_Audio___init), 0, 0, 1, 1}, {&__pyx_n_s_Audio_load_effect, __pyx_k_Audio_load_effect, sizeof(__pyx_k_Audio_load_effect), 0, 0, 1, 1}, {&__pyx_n_s_Audio_load_music, __pyx_k_Audio_load_music, sizeof(__pyx_k_Audio_load_music), 0, 0, 1, 1}, {&__pyx_n_s_Audio_play_effect, __pyx_k_Audio_play_effect, sizeof(__pyx_k_Audio_play_effect), 0, 0, 1, 1}, {&__pyx_n_s_Audio_play_music, __pyx_k_Audio_play_music, sizeof(__pyx_k_Audio_play_music), 0, 0, 1, 1}, {&__pyx_n_s_Audio_set_music_volume, __pyx_k_Audio_set_music_volume, sizeof(__pyx_k_Audio_set_music_volume), 0, 0, 1, 1}, {&__pyx_n_s_Audio_stop_music, __pyx_k_Audio_stop_music, sizeof(__pyx_k_Audio_stop_music), 0, 0, 1, 1}, {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1}, {&__pyx_n_s_BACKQUOTE, __pyx_k_BACKQUOTE, sizeof(__pyx_k_BACKQUOTE), 0, 0, 1, 1}, {&__pyx_n_s_BACKSLASH, __pyx_k_BACKSLASH, sizeof(__pyx_k_BACKSLASH), 0, 0, 1, 1}, {&__pyx_n_s_BACKSPACE, __pyx_k_BACKSPACE, sizeof(__pyx_k_BACKSPACE), 0, 0, 1, 1}, {&__pyx_n_s_BRIGHTNESSDOWN, __pyx_k_BRIGHTNESSDOWN, sizeof(__pyx_k_BRIGHTNESSDOWN), 0, 0, 1, 1}, {&__pyx_n_s_BRIGHTNESSUP, __pyx_k_BRIGHTNESSUP, sizeof(__pyx_k_BRIGHTNESSUP), 0, 0, 1, 1}, {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1}, {&__pyx_n_s_CALCULATOR, __pyx_k_CALCULATOR, sizeof(__pyx_k_CALCULATOR), 0, 0, 1, 1}, {&__pyx_n_s_CANCEL, __pyx_k_CANCEL, sizeof(__pyx_k_CANCEL), 0, 0, 1, 1}, {&__pyx_n_s_CAPSLOCK, __pyx_k_CAPSLOCK, sizeof(__pyx_k_CAPSLOCK), 0, 0, 1, 1}, {&__pyx_n_s_CARET, __pyx_k_CARET, sizeof(__pyx_k_CARET), 0, 0, 1, 1}, {&__pyx_n_s_CLEAR, __pyx_k_CLEAR, sizeof(__pyx_k_CLEAR), 0, 0, 1, 1}, {&__pyx_n_s_CLEARAGAIN, __pyx_k_CLEARAGAIN, sizeof(__pyx_k_CLEARAGAIN), 0, 0, 1, 1}, {&__pyx_n_s_COLON, __pyx_k_COLON, sizeof(__pyx_k_COLON), 0, 0, 1, 1}, {&__pyx_n_s_COMMA, __pyx_k_COMMA, sizeof(__pyx_k_COMMA), 0, 0, 1, 1}, {&__pyx_n_s_COMPUTER, __pyx_k_COMPUTER, sizeof(__pyx_k_COMPUTER), 0, 0, 1, 1}, {&__pyx_n_s_COPY, __pyx_k_COPY, sizeof(__pyx_k_COPY), 0, 0, 1, 1}, {&__pyx_n_s_CRSEL, __pyx_k_CRSEL, sizeof(__pyx_k_CRSEL), 0, 0, 1, 1}, {&__pyx_n_s_CURRENCYSUBUNIT, __pyx_k_CURRENCYSUBUNIT, sizeof(__pyx_k_CURRENCYSUBUNIT), 0, 0, 1, 1}, {&__pyx_n_s_CURRENCYUNIT, __pyx_k_CURRENCYUNIT, sizeof(__pyx_k_CURRENCYUNIT), 0, 0, 1, 1}, {&__pyx_n_s_CUT, __pyx_k_CUT, sizeof(__pyx_k_CUT), 0, 0, 1, 1}, {&__pyx_kp_s_Cannot_add_a_17th_controller, __pyx_k_Cannot_add_a_17th_controller, sizeof(__pyx_k_Cannot_add_a_17th_controller), 0, 0, 1, 0}, {&__pyx_n_s_ControllerButton, __pyx_k_ControllerButton, sizeof(__pyx_k_ControllerButton), 0, 0, 1, 1}, {&__pyx_n_s_Controls, __pyx_k_Controls, sizeof(__pyx_k_Controls), 0, 0, 1, 1}, {&__pyx_n_s_Controls___init, __pyx_k_Controls___init, sizeof(__pyx_k_Controls___init), 0, 0, 1, 1}, {&__pyx_n_s_Controls_add_controller, __pyx_k_Controls_add_controller, sizeof(__pyx_k_Controls_add_controller), 0, 0, 1, 1}, {&__pyx_n_s_Controls_find_controller, __pyx_k_Controls_find_controller, sizeof(__pyx_k_Controls_find_controller), 0, 0, 1, 1}, {&__pyx_n_s_Controls_key_modifiers, __pyx_k_Controls_key_modifiers, sizeof(__pyx_k_Controls_key_modifiers), 0, 0, 1, 1}, {&__pyx_n_s_Controls_mouse, __pyx_k_Controls_mouse, sizeof(__pyx_k_Controls_mouse), 0, 0, 1, 1}, {&__pyx_n_s_Controls_remove_controller, __pyx_k_Controls_remove_controller, sizeof(__pyx_k_Controls_remove_controller), 0, 0, 1, 1}, {&__pyx_n_s_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 0, 1, 1}, {&__pyx_n_s_DECIMALSEPARATOR, __pyx_k_DECIMALSEPARATOR, sizeof(__pyx_k_DECIMALSEPARATOR), 0, 0, 1, 1}, {&__pyx_n_s_DELETE, __pyx_k_DELETE, sizeof(__pyx_k_DELETE), 0, 0, 1, 1}, {&__pyx_n_s_DISPLAYSWITCH, __pyx_k_DISPLAYSWITCH, sizeof(__pyx_k_DISPLAYSWITCH), 0, 0, 1, 1}, {&__pyx_n_s_DOLLAR, __pyx_k_DOLLAR, sizeof(__pyx_k_DOLLAR), 0, 0, 1, 1}, {&__pyx_n_s_DOWN, __pyx_k_DOWN, sizeof(__pyx_k_DOWN), 0, 0, 1, 1}, {&__pyx_kp_s_Device_not_found, __pyx_k_Device_not_found, sizeof(__pyx_k_Device_not_found), 0, 0, 1, 0}, {&__pyx_n_s_E, __pyx_k_E, sizeof(__pyx_k_E), 0, 0, 1, 1}, {&__pyx_n_s_EJECT, __pyx_k_EJECT, sizeof(__pyx_k_EJECT), 0, 0, 1, 1}, {&__pyx_n_s_END, __pyx_k_END, sizeof(__pyx_k_END), 0, 0, 1, 1}, {&__pyx_n_s_EQUALS, __pyx_k_EQUALS, sizeof(__pyx_k_EQUALS), 0, 0, 1, 1}, {&__pyx_n_s_ESCAPE, __pyx_k_ESCAPE, sizeof(__pyx_k_ESCAPE), 0, 0, 1, 1}, {&__pyx_n_s_EXCLAIM, __pyx_k_EXCLAIM, sizeof(__pyx_k_EXCLAIM), 0, 0, 1, 1}, {&__pyx_n_s_EXECUTE, __pyx_k_EXECUTE, sizeof(__pyx_k_EXECUTE), 0, 0, 1, 1}, {&__pyx_n_s_EXSEL, __pyx_k_EXSEL, sizeof(__pyx_k_EXSEL), 0, 0, 1, 1}, {&__pyx_n_s_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 0, 1, 1}, {&__pyx_n_s_F1, __pyx_k_F1, sizeof(__pyx_k_F1), 0, 0, 1, 1}, {&__pyx_n_s_F10, __pyx_k_F10, sizeof(__pyx_k_F10), 0, 0, 1, 1}, {&__pyx_n_s_F11, __pyx_k_F11, sizeof(__pyx_k_F11), 0, 0, 1, 1}, {&__pyx_n_s_F12, __pyx_k_F12, sizeof(__pyx_k_F12), 0, 0, 1, 1}, {&__pyx_n_s_F13, __pyx_k_F13, sizeof(__pyx_k_F13), 0, 0, 1, 1}, {&__pyx_n_s_F14, __pyx_k_F14, sizeof(__pyx_k_F14), 0, 0, 1, 1}, {&__pyx_n_s_F15, __pyx_k_F15, sizeof(__pyx_k_F15), 0, 0, 1, 1}, {&__pyx_n_s_F16, __pyx_k_F16, sizeof(__pyx_k_F16), 0, 0, 1, 1}, {&__pyx_n_s_F17, __pyx_k_F17, sizeof(__pyx_k_F17), 0, 0, 1, 1}, {&__pyx_n_s_F18, __pyx_k_F18, sizeof(__pyx_k_F18), 0, 0, 1, 1}, {&__pyx_n_s_F19, __pyx_k_F19, sizeof(__pyx_k_F19), 0, 0, 1, 1}, {&__pyx_n_s_F2, __pyx_k_F2, sizeof(__pyx_k_F2), 0, 0, 1, 1}, {&__pyx_n_s_F20, __pyx_k_F20, sizeof(__pyx_k_F20), 0, 0, 1, 1}, {&__pyx_n_s_F21, __pyx_k_F21, sizeof(__pyx_k_F21), 0, 0, 1, 1}, {&__pyx_n_s_F22, __pyx_k_F22, sizeof(__pyx_k_F22), 0, 0, 1, 1}, {&__pyx_n_s_F23, __pyx_k_F23, sizeof(__pyx_k_F23), 0, 0, 1, 1}, {&__pyx_n_s_F24, __pyx_k_F24, sizeof(__pyx_k_F24), 0, 0, 1, 1}, {&__pyx_n_s_F3, __pyx_k_F3, sizeof(__pyx_k_F3), 0, 0, 1, 1}, {&__pyx_n_s_F4, __pyx_k_F4, sizeof(__pyx_k_F4), 0, 0, 1, 1}, {&__pyx_n_s_F5, __pyx_k_F5, sizeof(__pyx_k_F5), 0, 0, 1, 1}, {&__pyx_n_s_F6, __pyx_k_F6, sizeof(__pyx_k_F6), 0, 0, 1, 1}, {&__pyx_n_s_F7, __pyx_k_F7, sizeof(__pyx_k_F7), 0, 0, 1, 1}, {&__pyx_n_s_F8, __pyx_k_F8, sizeof(__pyx_k_F8), 0, 0, 1, 1}, {&__pyx_n_s_F9, __pyx_k_F9, sizeof(__pyx_k_F9), 0, 0, 1, 1}, {&__pyx_n_s_FIND, __pyx_k_FIND, sizeof(__pyx_k_FIND), 0, 0, 1, 1}, {&__pyx_n_s_G, __pyx_k_G, sizeof(__pyx_k_G), 0, 0, 1, 1}, {&__pyx_n_s_GREATER, __pyx_k_GREATER, sizeof(__pyx_k_GREATER), 0, 0, 1, 1}, {&__pyx_n_s_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 0, 1, 1}, {&__pyx_n_s_HASH, __pyx_k_HASH, sizeof(__pyx_k_HASH), 0, 0, 1, 1}, {&__pyx_n_s_HAT_TO_DIRECTION, __pyx_k_HAT_TO_DIRECTION, sizeof(__pyx_k_HAT_TO_DIRECTION), 0, 0, 1, 1}, {&__pyx_n_s_HELP, __pyx_k_HELP, sizeof(__pyx_k_HELP), 0, 0, 1, 1}, {&__pyx_n_s_HOME, __pyx_k_HOME, sizeof(__pyx_k_HOME), 0, 0, 1, 1}, {&__pyx_n_s_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 1, 1}, {&__pyx_n_s_INSERT, __pyx_k_INSERT, sizeof(__pyx_k_INSERT), 0, 0, 1, 1}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_n_s_IntEnum, __pyx_k_IntEnum, sizeof(__pyx_k_IntEnum), 0, 0, 1, 1}, {&__pyx_n_s_J, __pyx_k_J, sizeof(__pyx_k_J), 0, 0, 1, 1}, {&__pyx_n_s_K, __pyx_k_K, sizeof(__pyx_k_K), 0, 0, 1, 1}, {&__pyx_n_s_K0, __pyx_k_K0, sizeof(__pyx_k_K0), 0, 0, 1, 1}, {&__pyx_n_s_K1, __pyx_k_K1, sizeof(__pyx_k_K1), 0, 0, 1, 1}, {&__pyx_n_s_K2, __pyx_k_K2, sizeof(__pyx_k_K2), 0, 0, 1, 1}, {&__pyx_n_s_K3, __pyx_k_K3, sizeof(__pyx_k_K3), 0, 0, 1, 1}, {&__pyx_n_s_K4, __pyx_k_K4, sizeof(__pyx_k_K4), 0, 0, 1, 1}, {&__pyx_n_s_K5, __pyx_k_K5, sizeof(__pyx_k_K5), 0, 0, 1, 1}, {&__pyx_n_s_K6, __pyx_k_K6, sizeof(__pyx_k_K6), 0, 0, 1, 1}, {&__pyx_n_s_K7, __pyx_k_K7, sizeof(__pyx_k_K7), 0, 0, 1, 1}, {&__pyx_n_s_K8, __pyx_k_K8, sizeof(__pyx_k_K8), 0, 0, 1, 1}, {&__pyx_n_s_K9, __pyx_k_K9, sizeof(__pyx_k_K9), 0, 0, 1, 1}, {&__pyx_n_s_KBDILLUMDOWN, __pyx_k_KBDILLUMDOWN, sizeof(__pyx_k_KBDILLUMDOWN), 0, 0, 1, 1}, {&__pyx_n_s_KBDILLUMTOGGLE, __pyx_k_KBDILLUMTOGGLE, sizeof(__pyx_k_KBDILLUMTOGGLE), 0, 0, 1, 1}, {&__pyx_n_s_KBDILLUMUP, __pyx_k_KBDILLUMUP, sizeof(__pyx_k_KBDILLUMUP), 0, 0, 1, 1}, {&__pyx_n_s_KP_0, __pyx_k_KP_0, sizeof(__pyx_k_KP_0), 0, 0, 1, 1}, {&__pyx_n_s_KP_00, __pyx_k_KP_00, sizeof(__pyx_k_KP_00), 0, 0, 1, 1}, {&__pyx_n_s_KP_000, __pyx_k_KP_000, sizeof(__pyx_k_KP_000), 0, 0, 1, 1}, {&__pyx_n_s_KP_1, __pyx_k_KP_1, sizeof(__pyx_k_KP_1), 0, 0, 1, 1}, {&__pyx_n_s_KP_2, __pyx_k_KP_2, sizeof(__pyx_k_KP_2), 0, 0, 1, 1}, {&__pyx_n_s_KP_3, __pyx_k_KP_3, sizeof(__pyx_k_KP_3), 0, 0, 1, 1}, {&__pyx_n_s_KP_4, __pyx_k_KP_4, sizeof(__pyx_k_KP_4), 0, 0, 1, 1}, {&__pyx_n_s_KP_5, __pyx_k_KP_5, sizeof(__pyx_k_KP_5), 0, 0, 1, 1}, {&__pyx_n_s_KP_6, __pyx_k_KP_6, sizeof(__pyx_k_KP_6), 0, 0, 1, 1}, {&__pyx_n_s_KP_7, __pyx_k_KP_7, sizeof(__pyx_k_KP_7), 0, 0, 1, 1}, {&__pyx_n_s_KP_8, __pyx_k_KP_8, sizeof(__pyx_k_KP_8), 0, 0, 1, 1}, {&__pyx_n_s_KP_9, __pyx_k_KP_9, sizeof(__pyx_k_KP_9), 0, 0, 1, 1}, {&__pyx_n_s_KP_A, __pyx_k_KP_A, sizeof(__pyx_k_KP_A), 0, 0, 1, 1}, {&__pyx_n_s_KP_AMPERSAND, __pyx_k_KP_AMPERSAND, sizeof(__pyx_k_KP_AMPERSAND), 0, 0, 1, 1}, {&__pyx_n_s_KP_AT, __pyx_k_KP_AT, sizeof(__pyx_k_KP_AT), 0, 0, 1, 1}, {&__pyx_n_s_KP_B, __pyx_k_KP_B, sizeof(__pyx_k_KP_B), 0, 0, 1, 1}, {&__pyx_n_s_KP_BACKSPACE, __pyx_k_KP_BACKSPACE, sizeof(__pyx_k_KP_BACKSPACE), 0, 0, 1, 1}, {&__pyx_n_s_KP_BINARY, __pyx_k_KP_BINARY, sizeof(__pyx_k_KP_BINARY), 0, 0, 1, 1}, {&__pyx_n_s_KP_C, __pyx_k_KP_C, sizeof(__pyx_k_KP_C), 0, 0, 1, 1}, {&__pyx_n_s_KP_CLEAR, __pyx_k_KP_CLEAR, sizeof(__pyx_k_KP_CLEAR), 0, 0, 1, 1}, {&__pyx_n_s_KP_CLEARENTRY, __pyx_k_KP_CLEARENTRY, sizeof(__pyx_k_KP_CLEARENTRY), 0, 0, 1, 1}, {&__pyx_n_s_KP_COLON, __pyx_k_KP_COLON, sizeof(__pyx_k_KP_COLON), 0, 0, 1, 1}, {&__pyx_n_s_KP_COMMA, __pyx_k_KP_COMMA, sizeof(__pyx_k_KP_COMMA), 0, 0, 1, 1}, {&__pyx_n_s_KP_D, __pyx_k_KP_D, sizeof(__pyx_k_KP_D), 0, 0, 1, 1}, {&__pyx_n_s_KP_DBLAMPERSAND, __pyx_k_KP_DBLAMPERSAND, sizeof(__pyx_k_KP_DBLAMPERSAND), 0, 0, 1, 1}, {&__pyx_n_s_KP_DBLVERTICALBAR, __pyx_k_KP_DBLVERTICALBAR, sizeof(__pyx_k_KP_DBLVERTICALBAR), 0, 0, 1, 1}, {&__pyx_n_s_KP_DECIMAL, __pyx_k_KP_DECIMAL, sizeof(__pyx_k_KP_DECIMAL), 0, 0, 1, 1}, {&__pyx_n_s_KP_DIVIDE, __pyx_k_KP_DIVIDE, sizeof(__pyx_k_KP_DIVIDE), 0, 0, 1, 1}, {&__pyx_n_s_KP_E, __pyx_k_KP_E, sizeof(__pyx_k_KP_E), 0, 0, 1, 1}, {&__pyx_n_s_KP_ENTER, __pyx_k_KP_ENTER, sizeof(__pyx_k_KP_ENTER), 0, 0, 1, 1}, {&__pyx_n_s_KP_EQUALS, __pyx_k_KP_EQUALS, sizeof(__pyx_k_KP_EQUALS), 0, 0, 1, 1}, {&__pyx_n_s_KP_EQUALSAS400, __pyx_k_KP_EQUALSAS400, sizeof(__pyx_k_KP_EQUALSAS400), 0, 0, 1, 1}, {&__pyx_n_s_KP_EXCLAM, __pyx_k_KP_EXCLAM, sizeof(__pyx_k_KP_EXCLAM), 0, 0, 1, 1}, {&__pyx_n_s_KP_F, __pyx_k_KP_F, sizeof(__pyx_k_KP_F), 0, 0, 1, 1}, {&__pyx_n_s_KP_GREATER, __pyx_k_KP_GREATER, sizeof(__pyx_k_KP_GREATER), 0, 0, 1, 1}, {&__pyx_n_s_KP_HASH, __pyx_k_KP_HASH, sizeof(__pyx_k_KP_HASH), 0, 0, 1, 1}, {&__pyx_n_s_KP_HEXADECIMAL, __pyx_k_KP_HEXADECIMAL, sizeof(__pyx_k_KP_HEXADECIMAL), 0, 0, 1, 1}, {&__pyx_n_s_KP_LEFTBRACE, __pyx_k_KP_LEFTBRACE, sizeof(__pyx_k_KP_LEFTBRACE), 0, 0, 1, 1}, {&__pyx_n_s_KP_LEFTPAREN, __pyx_k_KP_LEFTPAREN, sizeof(__pyx_k_KP_LEFTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_KP_LESS, __pyx_k_KP_LESS, sizeof(__pyx_k_KP_LESS), 0, 0, 1, 1}, {&__pyx_n_s_KP_MEMADD, __pyx_k_KP_MEMADD, sizeof(__pyx_k_KP_MEMADD), 0, 0, 1, 1}, {&__pyx_n_s_KP_MEMCLEAR, __pyx_k_KP_MEMCLEAR, sizeof(__pyx_k_KP_MEMCLEAR), 0, 0, 1, 1}, {&__pyx_n_s_KP_MEMDIVIDE, __pyx_k_KP_MEMDIVIDE, sizeof(__pyx_k_KP_MEMDIVIDE), 0, 0, 1, 1}, {&__pyx_n_s_KP_MEMMULTIPLY, __pyx_k_KP_MEMMULTIPLY, sizeof(__pyx_k_KP_MEMMULTIPLY), 0, 0, 1, 1}, {&__pyx_n_s_KP_MEMRECALL, __pyx_k_KP_MEMRECALL, sizeof(__pyx_k_KP_MEMRECALL), 0, 0, 1, 1}, {&__pyx_n_s_KP_MEMSTORE, __pyx_k_KP_MEMSTORE, sizeof(__pyx_k_KP_MEMSTORE), 0, 0, 1, 1}, {&__pyx_n_s_KP_MEMSUBTRACT, __pyx_k_KP_MEMSUBTRACT, sizeof(__pyx_k_KP_MEMSUBTRACT), 0, 0, 1, 1}, {&__pyx_n_s_KP_MINUS, __pyx_k_KP_MINUS, sizeof(__pyx_k_KP_MINUS), 0, 0, 1, 1}, {&__pyx_n_s_KP_MULTIPLY, __pyx_k_KP_MULTIPLY, sizeof(__pyx_k_KP_MULTIPLY), 0, 0, 1, 1}, {&__pyx_n_s_KP_OCTAL, __pyx_k_KP_OCTAL, sizeof(__pyx_k_KP_OCTAL), 0, 0, 1, 1}, {&__pyx_n_s_KP_PERCENT, __pyx_k_KP_PERCENT, sizeof(__pyx_k_KP_PERCENT), 0, 0, 1, 1}, {&__pyx_n_s_KP_PERIOD, __pyx_k_KP_PERIOD, sizeof(__pyx_k_KP_PERIOD), 0, 0, 1, 1}, {&__pyx_n_s_KP_PLUS, __pyx_k_KP_PLUS, sizeof(__pyx_k_KP_PLUS), 0, 0, 1, 1}, {&__pyx_n_s_KP_PLUSMINUS, __pyx_k_KP_PLUSMINUS, sizeof(__pyx_k_KP_PLUSMINUS), 0, 0, 1, 1}, {&__pyx_n_s_KP_POWER, __pyx_k_KP_POWER, sizeof(__pyx_k_KP_POWER), 0, 0, 1, 1}, {&__pyx_n_s_KP_RIGHTBRACE, __pyx_k_KP_RIGHTBRACE, sizeof(__pyx_k_KP_RIGHTBRACE), 0, 0, 1, 1}, {&__pyx_n_s_KP_RIGHTPAREN, __pyx_k_KP_RIGHTPAREN, sizeof(__pyx_k_KP_RIGHTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_KP_SPACE, __pyx_k_KP_SPACE, sizeof(__pyx_k_KP_SPACE), 0, 0, 1, 1}, {&__pyx_n_s_KP_TAB, __pyx_k_KP_TAB, sizeof(__pyx_k_KP_TAB), 0, 0, 1, 1}, {&__pyx_n_s_KP_VERTICALBAR, __pyx_k_KP_VERTICALBAR, sizeof(__pyx_k_KP_VERTICALBAR), 0, 0, 1, 1}, {&__pyx_n_s_KP_XOR, __pyx_k_KP_XOR, sizeof(__pyx_k_KP_XOR), 0, 0, 1, 1}, {&__pyx_n_s_Key, __pyx_k_Key, sizeof(__pyx_k_Key), 0, 0, 1, 1}, {&__pyx_n_s_KeyModifiers, __pyx_k_KeyModifiers, sizeof(__pyx_k_KeyModifiers), 0, 0, 1, 1}, {&__pyx_n_s_KeyModifiers___init, __pyx_k_KeyModifiers___init, sizeof(__pyx_k_KeyModifiers___init), 0, 0, 1, 1}, {&__pyx_n_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 1}, {&__pyx_n_s_LALT, __pyx_k_LALT, sizeof(__pyx_k_LALT), 0, 0, 1, 1}, {&__pyx_n_s_LCTRL, __pyx_k_LCTRL, sizeof(__pyx_k_LCTRL), 0, 0, 1, 1}, {&__pyx_n_s_LEFT, __pyx_k_LEFT, sizeof(__pyx_k_LEFT), 0, 0, 1, 1}, {&__pyx_n_s_LEFTBRACKET, __pyx_k_LEFTBRACKET, sizeof(__pyx_k_LEFTBRACKET), 0, 0, 1, 1}, {&__pyx_n_s_LEFTPAREN, __pyx_k_LEFTPAREN, sizeof(__pyx_k_LEFTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_LEFT_SHOULDER, __pyx_k_LEFT_SHOULDER, sizeof(__pyx_k_LEFT_SHOULDER), 0, 0, 1, 1}, {&__pyx_n_s_LEFT_STICK, __pyx_k_LEFT_STICK, sizeof(__pyx_k_LEFT_STICK), 0, 0, 1, 1}, {&__pyx_n_s_LESS, __pyx_k_LESS, sizeof(__pyx_k_LESS), 0, 0, 1, 1}, {&__pyx_n_s_LGUI, __pyx_k_LGUI, sizeof(__pyx_k_LGUI), 0, 0, 1, 1}, {&__pyx_n_s_LSHIFT, __pyx_k_LSHIFT, sizeof(__pyx_k_LSHIFT), 0, 0, 1, 1}, {&__pyx_n_s_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 0, 1, 1}, {&__pyx_n_s_MAIL, __pyx_k_MAIL, sizeof(__pyx_k_MAIL), 0, 0, 1, 1}, {&__pyx_n_s_MEDIASELECT, __pyx_k_MEDIASELECT, sizeof(__pyx_k_MEDIASELECT), 0, 0, 1, 1}, {&__pyx_n_s_MENU, __pyx_k_MENU, sizeof(__pyx_k_MENU), 0, 0, 1, 1}, {&__pyx_n_s_MIDDLE, __pyx_k_MIDDLE, sizeof(__pyx_k_MIDDLE), 0, 0, 1, 1}, {&__pyx_n_s_MINUS, __pyx_k_MINUS, sizeof(__pyx_k_MINUS), 0, 0, 1, 1}, {&__pyx_n_s_MODE, __pyx_k_MODE, sizeof(__pyx_k_MODE), 0, 0, 1, 1}, {&__pyx_n_s_MUTE, __pyx_k_MUTE, sizeof(__pyx_k_MUTE), 0, 0, 1, 1}, {&__pyx_n_s_Mouse, __pyx_k_Mouse, sizeof(__pyx_k_Mouse), 0, 0, 1, 1}, {&__pyx_n_s_MouseButton, __pyx_k_MouseButton, sizeof(__pyx_k_MouseButton), 0, 0, 1, 1}, {&__pyx_n_s_Mouse___init, __pyx_k_Mouse___init, sizeof(__pyx_k_Mouse___init), 0, 0, 1, 1}, {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1}, {&__pyx_kp_s_NOTIFICATION_unknown_controller, __pyx_k_NOTIFICATION_unknown_controller, sizeof(__pyx_k_NOTIFICATION_unknown_controller), 0, 0, 1, 0}, {&__pyx_kp_s_NOTIFICATION_unknown_key, __pyx_k_NOTIFICATION_unknown_key, sizeof(__pyx_k_NOTIFICATION_unknown_key), 0, 0, 1, 0}, {&__pyx_kp_s_NOTIFICATION_unknown_mouse_butto, __pyx_k_NOTIFICATION_unknown_mouse_butto, sizeof(__pyx_k_NOTIFICATION_unknown_mouse_butto), 0, 0, 1, 0}, {&__pyx_n_s_NUMLOCKCLEAR, __pyx_k_NUMLOCKCLEAR, sizeof(__pyx_k_NUMLOCKCLEAR), 0, 0, 1, 1}, {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1}, {&__pyx_n_s_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 1, 1}, {&__pyx_n_s_OPER, __pyx_k_OPER, sizeof(__pyx_k_OPER), 0, 0, 1, 1}, {&__pyx_n_s_OUT, __pyx_k_OUT, sizeof(__pyx_k_OUT), 0, 0, 1, 1}, {&__pyx_n_s_P, __pyx_k_P, sizeof(__pyx_k_P), 0, 0, 1, 1}, {&__pyx_n_s_PAGEDOWN, __pyx_k_PAGEDOWN, sizeof(__pyx_k_PAGEDOWN), 0, 0, 1, 1}, {&__pyx_n_s_PAGEUP, __pyx_k_PAGEUP, sizeof(__pyx_k_PAGEUP), 0, 0, 1, 1}, {&__pyx_n_s_PASTE, __pyx_k_PASTE, sizeof(__pyx_k_PASTE), 0, 0, 1, 1}, {&__pyx_n_s_PAUSE, __pyx_k_PAUSE, sizeof(__pyx_k_PAUSE), 0, 0, 1, 1}, {&__pyx_n_s_PERCENT, __pyx_k_PERCENT, sizeof(__pyx_k_PERCENT), 0, 0, 1, 1}, {&__pyx_n_s_PERIOD, __pyx_k_PERIOD, sizeof(__pyx_k_PERIOD), 0, 0, 1, 1}, {&__pyx_n_s_PLUS, __pyx_k_PLUS, sizeof(__pyx_k_PLUS), 0, 0, 1, 1}, {&__pyx_n_s_POWER, __pyx_k_POWER, sizeof(__pyx_k_POWER), 0, 0, 1, 1}, {&__pyx_n_s_PRINTSCREEN, __pyx_k_PRINTSCREEN, sizeof(__pyx_k_PRINTSCREEN), 0, 0, 1, 1}, {&__pyx_n_s_PRIOR, __pyx_k_PRIOR, sizeof(__pyx_k_PRIOR), 0, 0, 1, 1}, {&__pyx_n_s_Pyxelen, __pyx_k_Pyxelen, sizeof(__pyx_k_Pyxelen), 0, 0, 1, 1}, {&__pyx_n_s_Pyxelen___init, __pyx_k_Pyxelen___init, sizeof(__pyx_k_Pyxelen___init), 0, 0, 1, 1}, {&__pyx_n_s_Pyxelen__find_window, __pyx_k_Pyxelen__find_window, sizeof(__pyx_k_Pyxelen__find_window), 0, 0, 1, 1}, {&__pyx_n_s_Pyxelen_close_window, __pyx_k_Pyxelen_close_window, sizeof(__pyx_k_Pyxelen_close_window), 0, 0, 1, 1}, {&__pyx_n_s_Pyxelen_open_window, __pyx_k_Pyxelen_open_window, sizeof(__pyx_k_Pyxelen_open_window), 0, 0, 1, 1}, {&__pyx_n_s_Pyxelen_run, __pyx_k_Pyxelen_run, sizeof(__pyx_k_Pyxelen_run), 0, 0, 1, 1}, {&__pyx_n_s_Q, __pyx_k_Q, sizeof(__pyx_k_Q), 0, 0, 1, 1}, {&__pyx_n_s_QUESTION, __pyx_k_QUESTION, sizeof(__pyx_k_QUESTION), 0, 0, 1, 1}, {&__pyx_n_s_QUOTE, __pyx_k_QUOTE, sizeof(__pyx_k_QUOTE), 0, 0, 1, 1}, {&__pyx_n_s_QUOTEDBL, __pyx_k_QUOTEDBL, sizeof(__pyx_k_QUOTEDBL), 0, 0, 1, 1}, {&__pyx_n_s_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 1, 1}, {&__pyx_n_s_RALT, __pyx_k_RALT, sizeof(__pyx_k_RALT), 0, 0, 1, 1}, {&__pyx_n_s_RCTRL, __pyx_k_RCTRL, sizeof(__pyx_k_RCTRL), 0, 0, 1, 1}, {&__pyx_n_s_RETURN, __pyx_k_RETURN, sizeof(__pyx_k_RETURN), 0, 0, 1, 1}, {&__pyx_n_s_RETURN2, __pyx_k_RETURN2, sizeof(__pyx_k_RETURN2), 0, 0, 1, 1}, {&__pyx_n_s_RGUI, __pyx_k_RGUI, sizeof(__pyx_k_RGUI), 0, 0, 1, 1}, {&__pyx_n_s_RIGHT, __pyx_k_RIGHT, sizeof(__pyx_k_RIGHT), 0, 0, 1, 1}, {&__pyx_n_s_RIGHTBRACKET, __pyx_k_RIGHTBRACKET, sizeof(__pyx_k_RIGHTBRACKET), 0, 0, 1, 1}, {&__pyx_n_s_RIGHTPAREN, __pyx_k_RIGHTPAREN, sizeof(__pyx_k_RIGHTPAREN), 0, 0, 1, 1}, {&__pyx_n_s_RIGHT_SHOULDER, __pyx_k_RIGHT_SHOULDER, sizeof(__pyx_k_RIGHT_SHOULDER), 0, 0, 1, 1}, {&__pyx_n_s_RIGHT_STICK, __pyx_k_RIGHT_STICK, sizeof(__pyx_k_RIGHT_STICK), 0, 0, 1, 1}, {&__pyx_n_s_RSHIFT, __pyx_k_RSHIFT, sizeof(__pyx_k_RSHIFT), 0, 0, 1, 1}, {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1}, {&__pyx_n_s_SCROLLLOCK, __pyx_k_SCROLLLOCK, sizeof(__pyx_k_SCROLLLOCK), 0, 0, 1, 1}, {&__pyx_n_s_SELECT, __pyx_k_SELECT, sizeof(__pyx_k_SELECT), 0, 0, 1, 1}, {&__pyx_n_s_SEMICOLON, __pyx_k_SEMICOLON, sizeof(__pyx_k_SEMICOLON), 0, 0, 1, 1}, {&__pyx_n_s_SEPARATOR, __pyx_k_SEPARATOR, sizeof(__pyx_k_SEPARATOR), 0, 0, 1, 1}, {&__pyx_n_s_SLASH, __pyx_k_SLASH, sizeof(__pyx_k_SLASH), 0, 0, 1, 1}, {&__pyx_n_s_SLEEP, __pyx_k_SLEEP, sizeof(__pyx_k_SLEEP), 0, 0, 1, 1}, {&__pyx_n_s_SPACE, __pyx_k_SPACE, sizeof(__pyx_k_SPACE), 0, 0, 1, 1}, {&__pyx_n_s_START, __pyx_k_START, sizeof(__pyx_k_START), 0, 0, 1, 1}, {&__pyx_n_s_STOP, __pyx_k_STOP, sizeof(__pyx_k_STOP), 0, 0, 1, 1}, {&__pyx_n_s_SYSREQ, __pyx_k_SYSREQ, sizeof(__pyx_k_SYSREQ), 0, 0, 1, 1}, {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1}, {&__pyx_n_s_TAB, __pyx_k_TAB, sizeof(__pyx_k_TAB), 0, 0, 1, 1}, {&__pyx_n_s_THOUSANDSSEPARATOR, __pyx_k_THOUSANDSSEPARATOR, sizeof(__pyx_k_THOUSANDSSEPARATOR), 0, 0, 1, 1}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_U, __pyx_k_U, sizeof(__pyx_k_U), 0, 0, 1, 1}, {&__pyx_n_s_UNDERSCORE, __pyx_k_UNDERSCORE, sizeof(__pyx_k_UNDERSCORE), 0, 0, 1, 1}, {&__pyx_n_s_UNDO, __pyx_k_UNDO, sizeof(__pyx_k_UNDO), 0, 0, 1, 1}, {&__pyx_n_s_UNKNOWN, __pyx_k_UNKNOWN, sizeof(__pyx_k_UNKNOWN), 0, 0, 1, 1}, {&__pyx_n_s_UP, __pyx_k_UP, sizeof(__pyx_k_UP), 0, 0, 1, 1}, {&__pyx_n_s_V, __pyx_k_V, sizeof(__pyx_k_V), 0, 0, 1, 1}, {&__pyx_n_s_VOLUMEDOWN, __pyx_k_VOLUMEDOWN, sizeof(__pyx_k_VOLUMEDOWN), 0, 0, 1, 1}, {&__pyx_n_s_VOLUMEUP, __pyx_k_VOLUMEUP, sizeof(__pyx_k_VOLUMEUP), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_W, __pyx_k_W, sizeof(__pyx_k_W), 0, 0, 1, 1}, {&__pyx_n_s_WWW, __pyx_k_WWW, sizeof(__pyx_k_WWW), 0, 0, 1, 1}, {&__pyx_n_s_X, __pyx_k_X, sizeof(__pyx_k_X), 0, 0, 1, 1}, {&__pyx_n_s_X1, __pyx_k_X1, sizeof(__pyx_k_X1), 0, 0, 1, 1}, {&__pyx_n_s_X2, __pyx_k_X2, sizeof(__pyx_k_X2), 0, 0, 1, 1}, {&__pyx_n_s_Y, __pyx_k_Y, sizeof(__pyx_k_Y), 0, 0, 1, 1}, {&__pyx_n_s_Z, __pyx_k_Z, sizeof(__pyx_k_Z), 0, 0, 1, 1}, {&__pyx_n_s__44, __pyx_k__44, sizeof(__pyx_k__44), 0, 0, 1, 1}, {&__pyx_n_s_add_controller, __pyx_k_add_controller, sizeof(__pyx_k_add_controller), 0, 0, 1, 1}, {&__pyx_n_s_alt, __pyx_k_alt, sizeof(__pyx_k_alt), 0, 0, 1, 1}, {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1}, {&__pyx_n_s_audio, __pyx_k_audio, sizeof(__pyx_k_audio), 0, 0, 1, 1}, {&__pyx_n_s_button, __pyx_k_button, sizeof(__pyx_k_button), 0, 0, 1, 1}, {&__pyx_n_s_button4, __pyx_k_button4, sizeof(__pyx_k_button4), 0, 0, 1, 1}, {&__pyx_n_s_button5, __pyx_k_button5, sizeof(__pyx_k_button5), 0, 0, 1, 1}, {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_close_window, __pyx_k_close_window, sizeof(__pyx_k_close_window), 0, 0, 1, 1}, {&__pyx_n_s_controller, __pyx_k_controller, sizeof(__pyx_k_controller), 0, 0, 1, 1}, {&__pyx_n_s_controllers, __pyx_k_controllers, sizeof(__pyx_k_controllers), 0, 0, 1, 1}, {&__pyx_n_s_controllers_2, __pyx_k_controllers_2, sizeof(__pyx_k_controllers_2), 0, 0, 1, 1}, {&__pyx_n_s_controls, __pyx_k_controls, sizeof(__pyx_k_controls), 0, 0, 1, 1}, {&__pyx_n_s_ctrl, __pyx_k_ctrl, sizeof(__pyx_k_ctrl), 0, 0, 1, 1}, {&__pyx_n_s_current_ticks, __pyx_k_current_ticks, sizeof(__pyx_k_current_ticks), 0, 0, 1, 1}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_dst_h, __pyx_k_dst_h, sizeof(__pyx_k_dst_h), 0, 0, 1, 1}, {&__pyx_n_s_dst_w, __pyx_k_dst_w, sizeof(__pyx_k_dst_w), 0, 0, 1, 1}, {&__pyx_n_s_dst_x, __pyx_k_dst_x, sizeof(__pyx_k_dst_x), 0, 0, 1, 1}, {&__pyx_n_s_dst_y, __pyx_k_dst_y, sizeof(__pyx_k_dst_y), 0, 0, 1, 1}, {&__pyx_n_s_effect, __pyx_k_effect, sizeof(__pyx_k_effect), 0, 0, 1, 1}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, {&__pyx_n_s_enum, __pyx_k_enum, sizeof(__pyx_k_enum), 0, 0, 1, 1}, {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, {&__pyx_n_s_event, __pyx_k_event, sizeof(__pyx_k_event), 0, 0, 1, 1}, {&__pyx_n_s_event_handler, __pyx_k_event_handler, sizeof(__pyx_k_event_handler), 0, 0, 1, 1}, {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, {&__pyx_n_s_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 0, 0, 1, 1}, {&__pyx_n_s_find_controller, __pyx_k_find_controller, sizeof(__pyx_k_find_controller), 0, 0, 1, 1}, {&__pyx_n_s_find_window, __pyx_k_find_window, sizeof(__pyx_k_find_window), 0, 0, 1, 1}, {&__pyx_n_s_fps, __pyx_k_fps, sizeof(__pyx_k_fps), 0, 0, 1, 1}, {&__pyx_kp_s_fps_must_be_positive, __pyx_k_fps_must_be_positive, sizeof(__pyx_k_fps_must_be_positive), 0, 0, 1, 0}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_n_s_get_error, __pyx_k_get_error, sizeof(__pyx_k_get_error), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1}, {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_importlib, __pyx_k_importlib, sizeof(__pyx_k_importlib), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1}, {&__pyx_n_s_instance, __pyx_k_instance, sizeof(__pyx_k_instance), 0, 0, 1, 1}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_key_modifiers, __pyx_k_key_modifiers, sizeof(__pyx_k_key_modifiers), 0, 0, 1, 1}, {&__pyx_n_s_last_frame_ticks, __pyx_k_last_frame_ticks, sizeof(__pyx_k_last_frame_ticks), 0, 0, 1, 1}, {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1}, {&__pyx_n_s_load_effect, __pyx_k_load_effect, sizeof(__pyx_k_load_effect), 0, 0, 1, 1}, {&__pyx_n_s_load_music, __pyx_k_load_music, sizeof(__pyx_k_load_music), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, {&__pyx_n_s_middle, __pyx_k_middle, sizeof(__pyx_k_middle), 0, 0, 1, 1}, {&__pyx_n_s_mod, __pyx_k_mod, sizeof(__pyx_k_mod), 0, 0, 1, 1}, {&__pyx_n_s_mods, __pyx_k_mods, sizeof(__pyx_k_mods), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, {&__pyx_n_s_mouse, __pyx_k_mouse, sizeof(__pyx_k_mouse), 0, 0, 1, 1}, {&__pyx_n_s_music, __pyx_k_music, sizeof(__pyx_k_music), 0, 0, 1, 1}, {&__pyx_n_s_music_playing, __pyx_k_music_playing, sizeof(__pyx_k_music_playing), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_on_audio_device_added, __pyx_k_on_audio_device_added, sizeof(__pyx_k_on_audio_device_added), 0, 0, 1, 1}, {&__pyx_n_s_on_audio_device_removed, __pyx_k_on_audio_device_removed, sizeof(__pyx_k_on_audio_device_removed), 0, 0, 1, 1}, {&__pyx_n_s_on_controller_button_down, __pyx_k_on_controller_button_down, sizeof(__pyx_k_on_controller_button_down), 0, 0, 1, 1}, {&__pyx_n_s_on_controller_button_up, __pyx_k_on_controller_button_up, sizeof(__pyx_k_on_controller_button_up), 0, 0, 1, 1}, {&__pyx_n_s_on_controller_device_added, __pyx_k_on_controller_device_added, sizeof(__pyx_k_on_controller_device_added), 0, 0, 1, 1}, {&__pyx_n_s_on_controller_device_removed, __pyx_k_on_controller_device_removed, sizeof(__pyx_k_on_controller_device_removed), 0, 0, 1, 1}, {&__pyx_n_s_on_controller_dpad, __pyx_k_on_controller_dpad, sizeof(__pyx_k_on_controller_dpad), 0, 0, 1, 1}, {&__pyx_n_s_on_key_down, __pyx_k_on_key_down, sizeof(__pyx_k_on_key_down), 0, 0, 1, 1}, {&__pyx_n_s_on_key_up, __pyx_k_on_key_up, sizeof(__pyx_k_on_key_up), 0, 0, 1, 1}, {&__pyx_n_s_on_mouse_button_down, __pyx_k_on_mouse_button_down, sizeof(__pyx_k_on_mouse_button_down), 0, 0, 1, 1}, {&__pyx_n_s_on_mouse_button_up, __pyx_k_on_mouse_button_up, sizeof(__pyx_k_on_mouse_button_up), 0, 0, 1, 1}, {&__pyx_n_s_on_mouse_motion, __pyx_k_on_mouse_motion, sizeof(__pyx_k_on_mouse_motion), 0, 0, 1, 1}, {&__pyx_n_s_on_mouse_wheel, __pyx_k_on_mouse_wheel, sizeof(__pyx_k_on_mouse_wheel), 0, 0, 1, 1}, {&__pyx_n_s_on_quit, __pyx_k_on_quit, sizeof(__pyx_k_on_quit), 0, 0, 1, 1}, {&__pyx_n_s_on_render_targets_reset, __pyx_k_on_render_targets_reset, sizeof(__pyx_k_on_render_targets_reset), 0, 0, 1, 1}, {&__pyx_n_s_on_text_input, __pyx_k_on_text_input, sizeof(__pyx_k_on_text_input), 0, 0, 1, 1}, {&__pyx_n_s_on_update_and_render, __pyx_k_on_update_and_render, sizeof(__pyx_k_on_update_and_render), 0, 0, 1, 1}, {&__pyx_n_s_on_window_close, __pyx_k_on_window_close, sizeof(__pyx_k_on_window_close), 0, 0, 1, 1}, {&__pyx_n_s_on_window_enter, __pyx_k_on_window_enter, sizeof(__pyx_k_on_window_enter), 0, 0, 1, 1}, {&__pyx_n_s_on_window_exposed, __pyx_k_on_window_exposed, sizeof(__pyx_k_on_window_exposed), 0, 0, 1, 1}, {&__pyx_n_s_on_window_focus_gained, __pyx_k_on_window_focus_gained, sizeof(__pyx_k_on_window_focus_gained), 0, 0, 1, 1}, {&__pyx_n_s_on_window_focus_lost, __pyx_k_on_window_focus_lost, sizeof(__pyx_k_on_window_focus_lost), 0, 0, 1, 1}, {&__pyx_n_s_on_window_hidden, __pyx_k_on_window_hidden, sizeof(__pyx_k_on_window_hidden), 0, 0, 1, 1}, {&__pyx_n_s_on_window_leave, __pyx_k_on_window_leave, sizeof(__pyx_k_on_window_leave), 0, 0, 1, 1}, {&__pyx_n_s_on_window_maximized, __pyx_k_on_window_maximized, sizeof(__pyx_k_on_window_maximized), 0, 0, 1, 1}, {&__pyx_n_s_on_window_minimized, __pyx_k_on_window_minimized, sizeof(__pyx_k_on_window_minimized), 0, 0, 1, 1}, {&__pyx_n_s_on_window_moved, __pyx_k_on_window_moved, sizeof(__pyx_k_on_window_moved), 0, 0, 1, 1}, {&__pyx_n_s_on_window_restored, __pyx_k_on_window_restored, sizeof(__pyx_k_on_window_restored), 0, 0, 1, 1}, {&__pyx_n_s_on_window_shown, __pyx_k_on_window_shown, sizeof(__pyx_k_on_window_shown), 0, 0, 1, 1}, {&__pyx_n_s_on_window_size_changed, __pyx_k_on_window_size_changed, sizeof(__pyx_k_on_window_size_changed), 0, 0, 1, 1}, {&__pyx_n_s_open_window, __pyx_k_open_window, sizeof(__pyx_k_open_window), 0, 0, 1, 1}, {&__pyx_n_s_play_effect, __pyx_k_play_effect, sizeof(__pyx_k_play_effect), 0, 0, 1, 1}, {&__pyx_n_s_play_music, __pyx_k_play_music, sizeof(__pyx_k_play_music), 0, 0, 1, 1}, {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1}, {&__pyx_n_s_pyxelen, __pyx_k_pyxelen, sizeof(__pyx_k_pyxelen), 0, 0, 1, 1}, {&__pyx_kp_s_pyxelen_pyx, __pyx_k_pyxelen_pyx, sizeof(__pyx_k_pyxelen_pyx), 0, 0, 1, 0}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_remove_controller, __pyx_k_remove_controller, sizeof(__pyx_k_remove_controller), 0, 0, 1, 1}, {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, {&__pyx_n_s_run, __pyx_k_run, sizeof(__pyx_k_run), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_kp_s_self_chunk_cannot_be_converted_t, __pyx_k_self_chunk_cannot_be_converted_t, sizeof(__pyx_k_self_chunk_cannot_be_converted_t), 0, 0, 1, 0}, {&__pyx_kp_s_self_music_cannot_be_converted_t, __pyx_k_self_music_cannot_be_converted_t, sizeof(__pyx_k_self_music_cannot_be_converted_t), 0, 0, 1, 0}, {&__pyx_kp_s_self_renderer_cannot_be_converte, __pyx_k_self_renderer_cannot_be_converte, sizeof(__pyx_k_self_renderer_cannot_be_converte), 0, 0, 1, 0}, {&__pyx_kp_s_self_surface_cannot_be_converted, __pyx_k_self_surface_cannot_be_converted, sizeof(__pyx_k_self_surface_cannot_be_converted), 0, 0, 1, 0}, {&__pyx_kp_s_self_texture_cannot_be_converted, __pyx_k_self_texture_cannot_be_converted, sizeof(__pyx_k_self_texture_cannot_be_converted), 0, 0, 1, 0}, {&__pyx_kp_s_self_window_cannot_be_converted, __pyx_k_self_window_cannot_be_converted, sizeof(__pyx_k_self_window_cannot_be_converted), 0, 0, 1, 0}, {&__pyx_n_s_set_music_volume, __pyx_k_set_music_volume, sizeof(__pyx_k_set_music_volume), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_shift, __pyx_k_shift, sizeof(__pyx_k_shift), 0, 0, 1, 1}, {&__pyx_n_s_src_h, __pyx_k_src_h, sizeof(__pyx_k_src_h), 0, 0, 1, 1}, {&__pyx_n_s_src_w, __pyx_k_src_w, sizeof(__pyx_k_src_w), 0, 0, 1, 1}, {&__pyx_n_s_src_x, __pyx_k_src_x, sizeof(__pyx_k_src_x), 0, 0, 1, 1}, {&__pyx_n_s_src_y, __pyx_k_src_y, sizeof(__pyx_k_src_y), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_n_s_stop_music, __pyx_k_stop_music, sizeof(__pyx_k_stop_music), 0, 0, 1, 1}, {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_texture, __pyx_k_texture, sizeof(__pyx_k_texture), 0, 0, 1, 1}, {&__pyx_n_s_ticks_per_frame, __pyx_k_ticks_per_frame, sizeof(__pyx_k_ticks_per_frame), 0, 0, 1, 1}, {&__pyx_n_s_title, __pyx_k_title, sizeof(__pyx_k_title), 0, 0, 1, 1}, {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0}, {&__pyx_n_s_volume, __pyx_k_volume, sizeof(__pyx_k_volume), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1}, {&__pyx_n_s_window, __pyx_k_window, sizeof(__pyx_k_window), 0, 0, 1, 1}, {&__pyx_n_s_window_event, __pyx_k_window_event, sizeof(__pyx_k_window_event), 0, 0, 1, 1}, {&__pyx_n_s_window_id, __pyx_k_window_id, sizeof(__pyx_k_window_id), 0, 0, 1, 1}, {&__pyx_n_s_windows, __pyx_k_windows, sizeof(__pyx_k_windows), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 980, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 956, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 959, __pyx_L1_error) __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 962, __pyx_L1_error) __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 1090, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 1176, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 1221, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("self.chunk cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.chunk cannot be converted to a Python object for pickling") */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_self_chunk_cannot_be_converted_t); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "(tree fragment)":4 * raise TypeError("self.chunk cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.chunk cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_self_chunk_cannot_be_converted_t); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("self.music cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.music cannot be converted to a Python object for pickling") */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_self_music_cannot_be_converted_t); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "(tree fragment)":4 * raise TypeError("self.music cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.music cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_self_music_cannot_be_converted_t); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "pyxelen.pyx":962 * if c == instance: * return i * raise RuntimeError('Device not found') # <<<<<<<<<<<<<< * * def add_controller(self, int instance): */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Device_not_found); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "pyxelen.pyx":971 * if c == instance: * return i * raise RuntimeError('Cannot add a 17th controller') # <<<<<<<<<<<<<< * * def remove_controller(self, int instance): */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Cannot_add_a_17th_controller); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 971, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "pyxelen.pyx":978 * self._controllers[i] = None * return * raise RuntimeError('Device not found') # <<<<<<<<<<<<<< * * @property */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Device_not_found); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("self.window cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.window cannot be converted to a Python object for pickling") */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_self_window_cannot_be_converted); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* "(tree fragment)":4 * raise TypeError("self.window cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.window cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_self_window_cannot_be_converted); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("self.surface cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.surface cannot be converted to a Python object for pickling") */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_self_surface_cannot_be_converted); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "(tree fragment)":4 * raise TypeError("self.surface cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.surface cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_self_surface_cannot_be_converted); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("self.texture cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.texture cannot be converted to a Python object for pickling") */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_self_texture_cannot_be_converted); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "(tree fragment)":4 * raise TypeError("self.texture cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.texture cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_self_texture_cannot_be_converted); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("self.renderer cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.renderer cannot be converted to a Python object for pickling") */ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_self_renderer_cannot_be_converte); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "(tree fragment)":4 * raise TypeError("self.renderer cannot be converted to a Python object for pickling") * def __setstate_cython__(self, __pyx_state): * raise TypeError("self.renderer cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<< */ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_self_renderer_cannot_be_converte); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* "pyxelen.pyx":1212 * event.jhat.which * ) * x, y = HAT_TO_DIRECTION.get(event.jhat.value, (0, 0)) # <<<<<<<<<<<<<< * event_handler.on_controller_dpad(controller, x, y) * */ __pyx_tuple__16 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 1212, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "pyxelen.pyx":878 * * HAT_TO_DIRECTION = { * SDL_HAT_LEFTUP: (-1, 1), SDL_HAT_UP: (0, 1), SDL_HAT_RIGHTUP: (1, 1), # <<<<<<<<<<<<<< * SDL_HAT_LEFT: (-1, 0), SDL_HAT_CENTERED: (0, 0), SDL_HAT_RIGHT: (1, 0), * SDL_HAT_LEFTDOWN: (-1, -1), SDL_HAT_DOWN: (0, -1), SDL_HAT_RIGHTDOWN: (1, -1), */ __pyx_tuple__17 = PyTuple_Pack(2, __pyx_int_neg_1, __pyx_int_1); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); __pyx_tuple__18 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_1); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_tuple__19 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); /* "pyxelen.pyx":879 * HAT_TO_DIRECTION = { * SDL_HAT_LEFTUP: (-1, 1), SDL_HAT_UP: (0, 1), SDL_HAT_RIGHTUP: (1, 1), * SDL_HAT_LEFT: (-1, 0), SDL_HAT_CENTERED: (0, 0), SDL_HAT_RIGHT: (1, 0), # <<<<<<<<<<<<<< * SDL_HAT_LEFTDOWN: (-1, -1), SDL_HAT_DOWN: (0, -1), SDL_HAT_RIGHTDOWN: (1, -1), * } */ __pyx_tuple__20 = PyTuple_Pack(2, __pyx_int_neg_1, __pyx_int_0); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_tuple__21 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); __pyx_tuple__22 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_0); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); /* "pyxelen.pyx":880 * SDL_HAT_LEFTUP: (-1, 1), SDL_HAT_UP: (0, 1), SDL_HAT_RIGHTUP: (1, 1), * SDL_HAT_LEFT: (-1, 0), SDL_HAT_CENTERED: (0, 0), SDL_HAT_RIGHT: (1, 0), * SDL_HAT_LEFTDOWN: (-1, -1), SDL_HAT_DOWN: (0, -1), SDL_HAT_RIGHTDOWN: (1, -1), # <<<<<<<<<<<<<< * } * */ __pyx_tuple__23 = PyTuple_Pack(2, __pyx_int_neg_1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); __pyx_tuple__24 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_tuple__25 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); /* "pyxelen.pyx":902 * class Audio: * * def __init__(self): # <<<<<<<<<<<<<< * self.music_playing = False * */ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_init, 902, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 902, __pyx_L1_error) /* "pyxelen.pyx":905 * self.music_playing = False * * def set_music_volume(self, int volume): # <<<<<<<<<<<<<< * Mix_VolumeMusic(volume) * */ __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_volume); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_set_music_volume, 905, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 905, __pyx_L1_error) /* "pyxelen.pyx":908 * Mix_VolumeMusic(volume) * * def play_music(self, Music music): # <<<<<<<<<<<<<< * self.stop_music() * Mix_PlayMusic(music.music, -1) */ __pyx_tuple__30 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_music); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_play_music, 908, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 908, __pyx_L1_error) /* "pyxelen.pyx":913 * self.music_playing = True * * def stop_music(self): # <<<<<<<<<<<<<< * if self.music_playing: * self.music_playing = False */ __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_stop_music, 913, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 913, __pyx_L1_error) /* "pyxelen.pyx":918 * Mix_HaltMusic() * * def play_effect(self, Effect effect, int volume): # <<<<<<<<<<<<<< * Mix_VolumeChunk(effect.chunk, volume) * Mix_PlayChannelTimed(-1, effect.chunk, 0, -1) */ __pyx_tuple__34 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_effect, __pyx_n_s_volume); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_play_effect, 918, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 918, __pyx_L1_error) /* "pyxelen.pyx":922 * Mix_PlayChannelTimed(-1, effect.chunk, 0, -1) * * def load_music(self, str filename): # <<<<<<<<<<<<<< * result = Music() * result.music = Mix_LoadMUS(filename.encode('utf-8')) */ __pyx_tuple__36 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_result); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_load_music, 922, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 922, __pyx_L1_error) /* "pyxelen.pyx":927 * return result * * def load_effect(self, str filename): # <<<<<<<<<<<<<< * result = Effect() * result.chunk = Mix_LoadWAV_RW(SDL_RWFromFile(filename.encode('utf-8'), "rb"), 1) */ __pyx_tuple__38 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_filename, __pyx_n_s_result); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 927, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_load_effect, 927, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 927, __pyx_L1_error) /* "pyxelen.pyx":935 * class KeyModifiers: * * def __init__(self, ctrl, shift, alt): # <<<<<<<<<<<<<< * self.ctrl = ctrl * self.shift = shift */ __pyx_tuple__40 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_ctrl, __pyx_n_s_shift, __pyx_n_s_alt); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_init, 935, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 935, __pyx_L1_error) /* "pyxelen.pyx":943 * class Mouse: * * def __init__(self, x, y, left, middle, right, button4, button5): # <<<<<<<<<<<<<< * self.x = x * self.y = y */ __pyx_tuple__42 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_left, __pyx_n_s_middle, __pyx_n_s_right, __pyx_n_s_button4, __pyx_n_s_button5); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(8, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_init, 943, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 943, __pyx_L1_error) /* "pyxelen.pyx":955 * class Controls: * * def __init__(self): # <<<<<<<<<<<<<< * self._controllers = [None for _ in range(16)] * */ __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s__44); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_init, 955, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 955, __pyx_L1_error) /* "pyxelen.pyx":958 * self._controllers = [None for _ in range(16)] * * def find_controller(self, int instance): # <<<<<<<<<<<<<< * for i, c in enumerate(self._controllers): * if c == instance: */ __pyx_tuple__47 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_instance, __pyx_n_s_i, __pyx_n_s_c); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 958, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_find_controller, 958, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 958, __pyx_L1_error) /* "pyxelen.pyx":964 * raise RuntimeError('Device not found') * * def add_controller(self, int instance): # <<<<<<<<<<<<<< * for i, c in enumerate(self._controllers): * if c is None: */ __pyx_tuple__49 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_instance, __pyx_n_s_i, __pyx_n_s_c); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 964, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_add_controller, 964, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 964, __pyx_L1_error) /* "pyxelen.pyx":973 * raise RuntimeError('Cannot add a 17th controller') * * def remove_controller(self, int instance): # <<<<<<<<<<<<<< * for i, c in enumerate(self._controllers): * if c == instance: */ __pyx_tuple__51 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_instance, __pyx_n_s_i, __pyx_n_s_c); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 973, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_remove_controller, 973, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 973, __pyx_L1_error) /* "pyxelen.pyx":981 * * @property * def mouse(self): # <<<<<<<<<<<<<< * cdef int x = 0 * cdef int y = 0 */ __pyx_tuple__53 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_state); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__53); __Pyx_GIVEREF(__pyx_tuple__53); __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_mouse, 981, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 981, __pyx_L1_error) /* "pyxelen.pyx":995 * * @property * def key_modifiers(self): # <<<<<<<<<<<<<< * cdef uint16_t mod = SDL_GetModState() * return KeyModifiers( */ __pyx_tuple__55 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_mod); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__55); __Pyx_GIVEREF(__pyx_tuple__55); __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_key_modifiers, 995, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 995, __pyx_L1_error) /* "pyxelen.pyx":1125 * class Pyxelen: * * def __init__(self): # <<<<<<<<<<<<<< * self.audio = Audio() * self.controls = Controls() */ __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 1125, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__57); __Pyx_GIVEREF(__pyx_tuple__57); __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_init, 1125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 1125, __pyx_L1_error) /* "pyxelen.pyx":1130 * self._windows = [] * * def open_window(self, str title, int width, int height): # <<<<<<<<<<<<<< * result = Window() * result.window = SDL_CreateWindow( */ __pyx_tuple__59 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_title, __pyx_n_s_width, __pyx_n_s_height, __pyx_n_s_result); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__59); __Pyx_GIVEREF(__pyx_tuple__59); __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_open_window, 1130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 1130, __pyx_L1_error) /* "pyxelen.pyx":1141 * return result * * def close_window(self, Window window): # <<<<<<<<<<<<<< * self._windows = [w for w in self._windows if w is not window] * */ __pyx_tuple__61 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_window, __pyx_n_s_w); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 1141, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_close_window, 1141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 1141, __pyx_L1_error) /* "pyxelen.pyx":1144 * self._windows = [w for w in self._windows if w is not window] * * def _find_window(self, int window_id): # <<<<<<<<<<<<<< * return [ * w for w in self._windows */ __pyx_tuple__63 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_window_id, __pyx_n_s_w); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_find_window, 1144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 1144, __pyx_L1_error) /* "pyxelen.pyx":1150 * ][0] * * def run(self, event_handler, fps): # <<<<<<<<<<<<<< * cdef SDL_Event event * assert fps > 0, 'fps must be positive' */ __pyx_tuple__65 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_event_handler, __pyx_n_s_fps, __pyx_n_s_event, __pyx_n_s_ticks_per_frame, __pyx_n_s_current_ticks, __pyx_n_s_last_frame_ticks, __pyx_n_s_button, __pyx_n_s_instance, __pyx_n_s_controller, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_key, __pyx_n_s_window, __pyx_n_s_mods, __pyx_n_s_window_event, __pyx_n_s_w); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 1150, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__65); __Pyx_GIVEREF(__pyx_tuple__65); __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(3, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_run, 1150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 1150, __pyx_L1_error) /* "pyxelen.pyx":1393 * * * def get_error(): # <<<<<<<<<<<<<< * return SDL_GetError().decode('utf-8') * */ __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_get_error, 1393, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 1393, __pyx_L1_error) /* "pyxelen.pyx":1397 * * * def init(): # <<<<<<<<<<<<<< * assert SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER) == 0 * assert IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG) == (IMG_INIT_JPG | IMG_INIT_PNG) */ __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_init_2, 1397, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 1397, __pyx_L1_error) /* "pyxelen.pyx":1404 * * * def quit(): # <<<<<<<<<<<<<< * Mix_CloseAudio() * Mix_Quit() */ __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyxelen_pyx, __pyx_n_s_quit, 1404, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 1404, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { __pyx_umethod_PyString_Type_encode.type = (PyObject*)&PyString_Type; if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static int __Pyx_modinit_global_init_code(void); /*proto*/ static int __Pyx_modinit_variable_export_code(void); /*proto*/ static int __Pyx_modinit_function_export_code(void); /*proto*/ static int __Pyx_modinit_type_init_code(void); /*proto*/ static int __Pyx_modinit_type_import_code(void); /*proto*/ static int __Pyx_modinit_variable_import_code(void); /*proto*/ static int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_7pyxelen_Effect) < 0) __PYX_ERR(0, 884, __pyx_L1_error) __pyx_type_7pyxelen_Effect.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyxelen_Effect.tp_dictoffset && __pyx_type_7pyxelen_Effect.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7pyxelen_Effect.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttrString(__pyx_m, "Effect", (PyObject *)&__pyx_type_7pyxelen_Effect) < 0) __PYX_ERR(0, 884, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyxelen_Effect) < 0) __PYX_ERR(0, 884, __pyx_L1_error) __pyx_ptype_7pyxelen_Effect = &__pyx_type_7pyxelen_Effect; if (PyType_Ready(&__pyx_type_7pyxelen_Music) < 0) __PYX_ERR(0, 892, __pyx_L1_error) __pyx_type_7pyxelen_Music.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyxelen_Music.tp_dictoffset && __pyx_type_7pyxelen_Music.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7pyxelen_Music.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttrString(__pyx_m, "Music", (PyObject *)&__pyx_type_7pyxelen_Music) < 0) __PYX_ERR(0, 892, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyxelen_Music) < 0) __PYX_ERR(0, 892, __pyx_L1_error) __pyx_ptype_7pyxelen_Music = &__pyx_type_7pyxelen_Music; if (PyType_Ready(&__pyx_type_7pyxelen_Window) < 0) __PYX_ERR(0, 1004, __pyx_L1_error) __pyx_type_7pyxelen_Window.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyxelen_Window.tp_dictoffset && __pyx_type_7pyxelen_Window.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7pyxelen_Window.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttrString(__pyx_m, "Window", (PyObject *)&__pyx_type_7pyxelen_Window) < 0) __PYX_ERR(0, 1004, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyxelen_Window) < 0) __PYX_ERR(0, 1004, __pyx_L1_error) __pyx_ptype_7pyxelen_Window = &__pyx_type_7pyxelen_Window; if (PyType_Ready(&__pyx_type_7pyxelen_Surface) < 0) __PYX_ERR(0, 1031, __pyx_L1_error) __pyx_type_7pyxelen_Surface.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyxelen_Surface.tp_dictoffset && __pyx_type_7pyxelen_Surface.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7pyxelen_Surface.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttrString(__pyx_m, "Surface", (PyObject *)&__pyx_type_7pyxelen_Surface) < 0) __PYX_ERR(0, 1031, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyxelen_Surface) < 0) __PYX_ERR(0, 1031, __pyx_L1_error) __pyx_ptype_7pyxelen_Surface = &__pyx_type_7pyxelen_Surface; if (PyType_Ready(&__pyx_type_7pyxelen_Texture) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) __pyx_type_7pyxelen_Texture.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyxelen_Texture.tp_dictoffset && __pyx_type_7pyxelen_Texture.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7pyxelen_Texture.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttrString(__pyx_m, "Texture", (PyObject *)&__pyx_type_7pyxelen_Texture) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyxelen_Texture) < 0) __PYX_ERR(0, 1039, __pyx_L1_error) __pyx_ptype_7pyxelen_Texture = &__pyx_type_7pyxelen_Texture; if (PyType_Ready(&__pyx_type_7pyxelen_Renderer) < 0) __PYX_ERR(0, 1056, __pyx_L1_error) __pyx_type_7pyxelen_Renderer.tp_print = 0; if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyxelen_Renderer.tp_dictoffset && __pyx_type_7pyxelen_Renderer.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7pyxelen_Renderer.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttrString(__pyx_m, "Renderer", (PyObject *)&__pyx_type_7pyxelen_Renderer) < 0) __PYX_ERR(0, 1056, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyxelen_Renderer) < 0) __PYX_ERR(0, 1056, __pyx_L1_error) __pyx_ptype_7pyxelen_Renderer = &__pyx_type_7pyxelen_Renderer; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION < 3 #ifdef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC void #else #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #endif #else #ifdef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyObject * #else #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #endif #endif #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) #else #define CYTHON_SMALL_CODE #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initpyxelen(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initpyxelen(void) #else __Pyx_PyMODINIT_FUNC PyInit_pyxelen(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_pyxelen(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { result = PyDict_SetItemString(moddict, to_name, value); Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static int __pyx_pymod_exec_pyxelen(PyObject *__pyx_pyinit_module) #endif #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0; #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } #endif __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_pyxelen(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("pyxelen", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) #if CYTHON_COMPILING_IN_PYPY Py_INCREF(__pyx_b); #endif if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_pyxelen) { if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "pyxelen")) { if (unlikely(PyDict_SetItemString(modules, "pyxelen", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); (void)__Pyx_modinit_function_export_code(); if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "pyxelen.pyx":1 * import enum # <<<<<<<<<<<<<< * import sys * import importlib */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_enum, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_enum, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":2 * import enum * import sys # <<<<<<<<<<<<<< * import importlib * */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":3 * import enum * import sys * import importlib # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_importlib, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_importlib, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":613 * * * class MouseButton(enum.IntEnum): # <<<<<<<<<<<<<< * LEFT = SDL_BUTTON_LEFT * MIDDLE = SDL_BUTTON_MIDDLE */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_enum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_MouseButton, __pyx_n_s_MouseButton, (PyObject *) NULL, __pyx_n_s_pyxelen, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "pyxelen.pyx":614 * * class MouseButton(enum.IntEnum): * LEFT = SDL_BUTTON_LEFT # <<<<<<<<<<<<<< * MIDDLE = SDL_BUTTON_MIDDLE * RIGHT = SDL_BUTTON_RIGHT */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(SDL_BUTTON_LEFT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LEFT, __pyx_t_4) < 0) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":615 * class MouseButton(enum.IntEnum): * LEFT = SDL_BUTTON_LEFT * MIDDLE = SDL_BUTTON_MIDDLE # <<<<<<<<<<<<<< * RIGHT = SDL_BUTTON_RIGHT * X1 = SDL_BUTTON_X1 */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(SDL_BUTTON_MIDDLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_MIDDLE, __pyx_t_4) < 0) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":616 * LEFT = SDL_BUTTON_LEFT * MIDDLE = SDL_BUTTON_MIDDLE * RIGHT = SDL_BUTTON_RIGHT # <<<<<<<<<<<<<< * X1 = SDL_BUTTON_X1 * X2 = SDL_BUTTON_X2 */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(SDL_BUTTON_RIGHT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_RIGHT, __pyx_t_4) < 0) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":617 * MIDDLE = SDL_BUTTON_MIDDLE * RIGHT = SDL_BUTTON_RIGHT * X1 = SDL_BUTTON_X1 # <<<<<<<<<<<<<< * X2 = SDL_BUTTON_X2 * */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(SDL_BUTTON_X1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_X1, __pyx_t_4) < 0) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":618 * RIGHT = SDL_BUTTON_RIGHT * X1 = SDL_BUTTON_X1 * X2 = SDL_BUTTON_X2 # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(SDL_BUTTON_X2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_X2, __pyx_t_4) < 0) __PYX_ERR(0, 618, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":613 * * * class MouseButton(enum.IntEnum): # <<<<<<<<<<<<<< * LEFT = SDL_BUTTON_LEFT * MIDDLE = SDL_BUTTON_MIDDLE */ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_MouseButton, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MouseButton, __pyx_t_4) < 0) __PYX_ERR(0, 613, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":621 * * * class Key(enum.IntEnum): # <<<<<<<<<<<<<< * UNKNOWN = SDLK_UNKNOWN * RETURN = SDLK_RETURN */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_enum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Key, __pyx_n_s_Key, (PyObject *) NULL, __pyx_n_s_pyxelen, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "pyxelen.pyx":622 * * class Key(enum.IntEnum): * UNKNOWN = SDLK_UNKNOWN # <<<<<<<<<<<<<< * RETURN = SDLK_RETURN * ESCAPE = SDLK_ESCAPE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_UNKNOWN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_UNKNOWN, __pyx_t_4) < 0) __PYX_ERR(0, 622, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":623 * class Key(enum.IntEnum): * UNKNOWN = SDLK_UNKNOWN * RETURN = SDLK_RETURN # <<<<<<<<<<<<<< * ESCAPE = SDLK_ESCAPE * BACKSPACE = SDLK_BACKSPACE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_RETURN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_RETURN, __pyx_t_4) < 0) __PYX_ERR(0, 623, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":624 * UNKNOWN = SDLK_UNKNOWN * RETURN = SDLK_RETURN * ESCAPE = SDLK_ESCAPE # <<<<<<<<<<<<<< * BACKSPACE = SDLK_BACKSPACE * TAB = SDLK_TAB */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_ESCAPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ESCAPE, __pyx_t_4) < 0) __PYX_ERR(0, 624, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":625 * RETURN = SDLK_RETURN * ESCAPE = SDLK_ESCAPE * BACKSPACE = SDLK_BACKSPACE # <<<<<<<<<<<<<< * TAB = SDLK_TAB * SPACE = SDLK_SPACE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_BACKSPACE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BACKSPACE, __pyx_t_4) < 0) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":626 * ESCAPE = SDLK_ESCAPE * BACKSPACE = SDLK_BACKSPACE * TAB = SDLK_TAB # <<<<<<<<<<<<<< * SPACE = SDLK_SPACE * EXCLAIM = SDLK_EXCLAIM */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_TAB); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_TAB, __pyx_t_4) < 0) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":627 * BACKSPACE = SDLK_BACKSPACE * TAB = SDLK_TAB * SPACE = SDLK_SPACE # <<<<<<<<<<<<<< * EXCLAIM = SDLK_EXCLAIM * QUOTEDBL = SDLK_QUOTEDBL */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_SPACE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SPACE, __pyx_t_4) < 0) __PYX_ERR(0, 627, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":628 * TAB = SDLK_TAB * SPACE = SDLK_SPACE * EXCLAIM = SDLK_EXCLAIM # <<<<<<<<<<<<<< * QUOTEDBL = SDLK_QUOTEDBL * HASH = SDLK_HASH */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_EXCLAIM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_EXCLAIM, __pyx_t_4) < 0) __PYX_ERR(0, 628, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":629 * SPACE = SDLK_SPACE * EXCLAIM = SDLK_EXCLAIM * QUOTEDBL = SDLK_QUOTEDBL # <<<<<<<<<<<<<< * HASH = SDLK_HASH * PERCENT = SDLK_PERCENT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_QUOTEDBL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_QUOTEDBL, __pyx_t_4) < 0) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":630 * EXCLAIM = SDLK_EXCLAIM * QUOTEDBL = SDLK_QUOTEDBL * HASH = SDLK_HASH # <<<<<<<<<<<<<< * PERCENT = SDLK_PERCENT * DOLLAR = SDLK_DOLLAR */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_HASH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_HASH, __pyx_t_4) < 0) __PYX_ERR(0, 630, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":631 * QUOTEDBL = SDLK_QUOTEDBL * HASH = SDLK_HASH * PERCENT = SDLK_PERCENT # <<<<<<<<<<<<<< * DOLLAR = SDLK_DOLLAR * AMPERSAND = SDLK_AMPERSAND */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_PERCENT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_PERCENT, __pyx_t_4) < 0) __PYX_ERR(0, 631, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":632 * HASH = SDLK_HASH * PERCENT = SDLK_PERCENT * DOLLAR = SDLK_DOLLAR # <<<<<<<<<<<<<< * AMPERSAND = SDLK_AMPERSAND * QUOTE = SDLK_QUOTE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_DOLLAR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DOLLAR, __pyx_t_4) < 0) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":633 * PERCENT = SDLK_PERCENT * DOLLAR = SDLK_DOLLAR * AMPERSAND = SDLK_AMPERSAND # <<<<<<<<<<<<<< * QUOTE = SDLK_QUOTE * LEFTPAREN = SDLK_LEFTPAREN */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_AMPERSAND); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_AMPERSAND, __pyx_t_4) < 0) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":634 * DOLLAR = SDLK_DOLLAR * AMPERSAND = SDLK_AMPERSAND * QUOTE = SDLK_QUOTE # <<<<<<<<<<<<<< * LEFTPAREN = SDLK_LEFTPAREN * RIGHTPAREN = SDLK_RIGHTPAREN */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_QUOTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_QUOTE, __pyx_t_4) < 0) __PYX_ERR(0, 634, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":635 * AMPERSAND = SDLK_AMPERSAND * QUOTE = SDLK_QUOTE * LEFTPAREN = SDLK_LEFTPAREN # <<<<<<<<<<<<<< * RIGHTPAREN = SDLK_RIGHTPAREN * ASTERISK = SDLK_ASTERISK */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_LEFTPAREN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LEFTPAREN, __pyx_t_4) < 0) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":636 * QUOTE = SDLK_QUOTE * LEFTPAREN = SDLK_LEFTPAREN * RIGHTPAREN = SDLK_RIGHTPAREN # <<<<<<<<<<<<<< * ASTERISK = SDLK_ASTERISK * PLUS = SDLK_PLUS */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_RIGHTPAREN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_RIGHTPAREN, __pyx_t_4) < 0) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":637 * LEFTPAREN = SDLK_LEFTPAREN * RIGHTPAREN = SDLK_RIGHTPAREN * ASTERISK = SDLK_ASTERISK # <<<<<<<<<<<<<< * PLUS = SDLK_PLUS * COMMA = SDLK_COMMA */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_ASTERISK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ASTERISK, __pyx_t_4) < 0) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":638 * RIGHTPAREN = SDLK_RIGHTPAREN * ASTERISK = SDLK_ASTERISK * PLUS = SDLK_PLUS # <<<<<<<<<<<<<< * COMMA = SDLK_COMMA * MINUS = SDLK_MINUS */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_PLUS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_PLUS, __pyx_t_4) < 0) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":639 * ASTERISK = SDLK_ASTERISK * PLUS = SDLK_PLUS * COMMA = SDLK_COMMA # <<<<<<<<<<<<<< * MINUS = SDLK_MINUS * PERIOD = SDLK_PERIOD */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_COMMA); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_COMMA, __pyx_t_4) < 0) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":640 * PLUS = SDLK_PLUS * COMMA = SDLK_COMMA * MINUS = SDLK_MINUS # <<<<<<<<<<<<<< * PERIOD = SDLK_PERIOD * SLASH = SDLK_SLASH */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_MINUS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_MINUS, __pyx_t_4) < 0) __PYX_ERR(0, 640, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":641 * COMMA = SDLK_COMMA * MINUS = SDLK_MINUS * PERIOD = SDLK_PERIOD # <<<<<<<<<<<<<< * SLASH = SDLK_SLASH * K0 = SDLK_0 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_PERIOD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_PERIOD, __pyx_t_4) < 0) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":642 * MINUS = SDLK_MINUS * PERIOD = SDLK_PERIOD * SLASH = SDLK_SLASH # <<<<<<<<<<<<<< * K0 = SDLK_0 * K1 = SDLK_1 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_SLASH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SLASH, __pyx_t_4) < 0) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":643 * PERIOD = SDLK_PERIOD * SLASH = SDLK_SLASH * K0 = SDLK_0 # <<<<<<<<<<<<<< * K1 = SDLK_1 * K2 = SDLK_2 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_K0, __pyx_t_4) < 0) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":644 * SLASH = SDLK_SLASH * K0 = SDLK_0 * K1 = SDLK_1 # <<<<<<<<<<<<<< * K2 = SDLK_2 * K3 = SDLK_3 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_K1, __pyx_t_4) < 0) __PYX_ERR(0, 644, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":645 * K0 = SDLK_0 * K1 = SDLK_1 * K2 = SDLK_2 # <<<<<<<<<<<<<< * K3 = SDLK_3 * K4 = SDLK_4 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_K2, __pyx_t_4) < 0) __PYX_ERR(0, 645, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":646 * K1 = SDLK_1 * K2 = SDLK_2 * K3 = SDLK_3 # <<<<<<<<<<<<<< * K4 = SDLK_4 * K5 = SDLK_5 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_K3, __pyx_t_4) < 0) __PYX_ERR(0, 646, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":647 * K2 = SDLK_2 * K3 = SDLK_3 * K4 = SDLK_4 # <<<<<<<<<<<<<< * K5 = SDLK_5 * K6 = SDLK_6 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_K4, __pyx_t_4) < 0) __PYX_ERR(0, 647, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":648 * K3 = SDLK_3 * K4 = SDLK_4 * K5 = SDLK_5 # <<<<<<<<<<<<<< * K6 = SDLK_6 * K7 = SDLK_7 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_K5, __pyx_t_4) < 0) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":649 * K4 = SDLK_4 * K5 = SDLK_5 * K6 = SDLK_6 # <<<<<<<<<<<<<< * K7 = SDLK_7 * K8 = SDLK_8 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_K6, __pyx_t_4) < 0) __PYX_ERR(0, 649, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":650 * K5 = SDLK_5 * K6 = SDLK_6 * K7 = SDLK_7 # <<<<<<<<<<<<<< * K8 = SDLK_8 * K9 = SDLK_9 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_K7, __pyx_t_4) < 0) __PYX_ERR(0, 650, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":651 * K6 = SDLK_6 * K7 = SDLK_7 * K8 = SDLK_8 # <<<<<<<<<<<<<< * K9 = SDLK_9 * COLON = SDLK_COLON */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_K8, __pyx_t_4) < 0) __PYX_ERR(0, 651, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":652 * K7 = SDLK_7 * K8 = SDLK_8 * K9 = SDLK_9 # <<<<<<<<<<<<<< * COLON = SDLK_COLON * SEMICOLON = SDLK_SEMICOLON */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_K9, __pyx_t_4) < 0) __PYX_ERR(0, 652, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":653 * K8 = SDLK_8 * K9 = SDLK_9 * COLON = SDLK_COLON # <<<<<<<<<<<<<< * SEMICOLON = SDLK_SEMICOLON * LESS = SDLK_LESS */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_COLON); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_COLON, __pyx_t_4) < 0) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":654 * K9 = SDLK_9 * COLON = SDLK_COLON * SEMICOLON = SDLK_SEMICOLON # <<<<<<<<<<<<<< * LESS = SDLK_LESS * EQUALS = SDLK_EQUALS */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_SEMICOLON); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SEMICOLON, __pyx_t_4) < 0) __PYX_ERR(0, 654, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":655 * COLON = SDLK_COLON * SEMICOLON = SDLK_SEMICOLON * LESS = SDLK_LESS # <<<<<<<<<<<<<< * EQUALS = SDLK_EQUALS * GREATER = SDLK_GREATER */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_LESS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LESS, __pyx_t_4) < 0) __PYX_ERR(0, 655, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":656 * SEMICOLON = SDLK_SEMICOLON * LESS = SDLK_LESS * EQUALS = SDLK_EQUALS # <<<<<<<<<<<<<< * GREATER = SDLK_GREATER * QUESTION = SDLK_QUESTION */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_EQUALS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_EQUALS, __pyx_t_4) < 0) __PYX_ERR(0, 656, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":657 * LESS = SDLK_LESS * EQUALS = SDLK_EQUALS * GREATER = SDLK_GREATER # <<<<<<<<<<<<<< * QUESTION = SDLK_QUESTION * AT = SDLK_AT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_GREATER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_GREATER, __pyx_t_4) < 0) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":658 * EQUALS = SDLK_EQUALS * GREATER = SDLK_GREATER * QUESTION = SDLK_QUESTION # <<<<<<<<<<<<<< * AT = SDLK_AT * LEFTBRACKET = SDLK_LEFTBRACKET */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_QUESTION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_QUESTION, __pyx_t_4) < 0) __PYX_ERR(0, 658, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":659 * GREATER = SDLK_GREATER * QUESTION = SDLK_QUESTION * AT = SDLK_AT # <<<<<<<<<<<<<< * LEFTBRACKET = SDLK_LEFTBRACKET * BACKSLASH = SDLK_BACKSLASH */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_AT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_AT, __pyx_t_4) < 0) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":660 * QUESTION = SDLK_QUESTION * AT = SDLK_AT * LEFTBRACKET = SDLK_LEFTBRACKET # <<<<<<<<<<<<<< * BACKSLASH = SDLK_BACKSLASH * RIGHTBRACKET = SDLK_RIGHTBRACKET */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_LEFTBRACKET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LEFTBRACKET, __pyx_t_4) < 0) __PYX_ERR(0, 660, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":661 * AT = SDLK_AT * LEFTBRACKET = SDLK_LEFTBRACKET * BACKSLASH = SDLK_BACKSLASH # <<<<<<<<<<<<<< * RIGHTBRACKET = SDLK_RIGHTBRACKET * CARET = SDLK_CARET */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_BACKSLASH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BACKSLASH, __pyx_t_4) < 0) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":662 * LEFTBRACKET = SDLK_LEFTBRACKET * BACKSLASH = SDLK_BACKSLASH * RIGHTBRACKET = SDLK_RIGHTBRACKET # <<<<<<<<<<<<<< * CARET = SDLK_CARET * UNDERSCORE = SDLK_UNDERSCORE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_RIGHTBRACKET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_RIGHTBRACKET, __pyx_t_4) < 0) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":663 * BACKSLASH = SDLK_BACKSLASH * RIGHTBRACKET = SDLK_RIGHTBRACKET * CARET = SDLK_CARET # <<<<<<<<<<<<<< * UNDERSCORE = SDLK_UNDERSCORE * BACKQUOTE = SDLK_BACKQUOTE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_CARET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CARET, __pyx_t_4) < 0) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":664 * RIGHTBRACKET = SDLK_RIGHTBRACKET * CARET = SDLK_CARET * UNDERSCORE = SDLK_UNDERSCORE # <<<<<<<<<<<<<< * BACKQUOTE = SDLK_BACKQUOTE * A = SDLK_a */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_UNDERSCORE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_UNDERSCORE, __pyx_t_4) < 0) __PYX_ERR(0, 664, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":665 * CARET = SDLK_CARET * UNDERSCORE = SDLK_UNDERSCORE * BACKQUOTE = SDLK_BACKQUOTE # <<<<<<<<<<<<<< * A = SDLK_a * B = SDLK_b */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_BACKQUOTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BACKQUOTE, __pyx_t_4) < 0) __PYX_ERR(0, 665, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":666 * UNDERSCORE = SDLK_UNDERSCORE * BACKQUOTE = SDLK_BACKQUOTE * A = SDLK_a # <<<<<<<<<<<<<< * B = SDLK_b * C = SDLK_c */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_A, __pyx_t_4) < 0) __PYX_ERR(0, 666, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":667 * BACKQUOTE = SDLK_BACKQUOTE * A = SDLK_a * B = SDLK_b # <<<<<<<<<<<<<< * C = SDLK_c * D = SDLK_d */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_b); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_B, __pyx_t_4) < 0) __PYX_ERR(0, 667, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":668 * A = SDLK_a * B = SDLK_b * C = SDLK_c # <<<<<<<<<<<<<< * D = SDLK_d * E = SDLK_e */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_C, __pyx_t_4) < 0) __PYX_ERR(0, 668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":669 * B = SDLK_b * C = SDLK_c * D = SDLK_d # <<<<<<<<<<<<<< * E = SDLK_e * F = SDLK_f */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_D, __pyx_t_4) < 0) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":670 * C = SDLK_c * D = SDLK_d * E = SDLK_e # <<<<<<<<<<<<<< * F = SDLK_f * G = SDLK_g */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_e); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_E, __pyx_t_4) < 0) __PYX_ERR(0, 670, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":671 * D = SDLK_d * E = SDLK_e * F = SDLK_f # <<<<<<<<<<<<<< * G = SDLK_g * H = SDLK_h */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_f); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F, __pyx_t_4) < 0) __PYX_ERR(0, 671, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":672 * E = SDLK_e * F = SDLK_f * G = SDLK_g # <<<<<<<<<<<<<< * H = SDLK_h * I = SDLK_i */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_g); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_G, __pyx_t_4) < 0) __PYX_ERR(0, 672, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":673 * F = SDLK_f * G = SDLK_g * H = SDLK_h # <<<<<<<<<<<<<< * I = SDLK_i * J = SDLK_j */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_H, __pyx_t_4) < 0) __PYX_ERR(0, 673, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":674 * G = SDLK_g * H = SDLK_h * I = SDLK_i # <<<<<<<<<<<<<< * J = SDLK_j * K = SDLK_k */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_I, __pyx_t_4) < 0) __PYX_ERR(0, 674, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":675 * H = SDLK_h * I = SDLK_i * J = SDLK_j # <<<<<<<<<<<<<< * K = SDLK_k * L = SDLK_l */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_j); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_J, __pyx_t_4) < 0) __PYX_ERR(0, 675, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":676 * I = SDLK_i * J = SDLK_j * K = SDLK_k # <<<<<<<<<<<<<< * L = SDLK_l * M = SDLK_m */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_k); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_K, __pyx_t_4) < 0) __PYX_ERR(0, 676, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":677 * J = SDLK_j * K = SDLK_k * L = SDLK_l # <<<<<<<<<<<<<< * M = SDLK_m * N = SDLK_n */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_l); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 677, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_L, __pyx_t_4) < 0) __PYX_ERR(0, 677, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":678 * K = SDLK_k * L = SDLK_l * M = SDLK_m # <<<<<<<<<<<<<< * N = SDLK_n * O = SDLK_o */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_m); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_M, __pyx_t_4) < 0) __PYX_ERR(0, 678, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":679 * L = SDLK_l * M = SDLK_m * N = SDLK_n # <<<<<<<<<<<<<< * O = SDLK_o * P = SDLK_p */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_N, __pyx_t_4) < 0) __PYX_ERR(0, 679, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":680 * M = SDLK_m * N = SDLK_n * O = SDLK_o # <<<<<<<<<<<<<< * P = SDLK_p * Q = SDLK_q */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_o); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_O, __pyx_t_4) < 0) __PYX_ERR(0, 680, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":681 * N = SDLK_n * O = SDLK_o * P = SDLK_p # <<<<<<<<<<<<<< * Q = SDLK_q * R = SDLK_r */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_p); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_P, __pyx_t_4) < 0) __PYX_ERR(0, 681, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":682 * O = SDLK_o * P = SDLK_p * Q = SDLK_q # <<<<<<<<<<<<<< * R = SDLK_r * S = SDLK_s */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_q); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_Q, __pyx_t_4) < 0) __PYX_ERR(0, 682, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":683 * P = SDLK_p * Q = SDLK_q * R = SDLK_r # <<<<<<<<<<<<<< * S = SDLK_s * T = SDLK_t */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_R, __pyx_t_4) < 0) __PYX_ERR(0, 683, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":684 * Q = SDLK_q * R = SDLK_r * S = SDLK_s # <<<<<<<<<<<<<< * T = SDLK_t * U = SDLK_u */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_S, __pyx_t_4) < 0) __PYX_ERR(0, 684, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":685 * R = SDLK_r * S = SDLK_s * T = SDLK_t # <<<<<<<<<<<<<< * U = SDLK_u * V = SDLK_v */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_T, __pyx_t_4) < 0) __PYX_ERR(0, 685, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":686 * S = SDLK_s * T = SDLK_t * U = SDLK_u # <<<<<<<<<<<<<< * V = SDLK_v * W = SDLK_w */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_u); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_U, __pyx_t_4) < 0) __PYX_ERR(0, 686, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":687 * T = SDLK_t * U = SDLK_u * V = SDLK_v # <<<<<<<<<<<<<< * W = SDLK_w * X = SDLK_x */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_V, __pyx_t_4) < 0) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":688 * U = SDLK_u * V = SDLK_v * W = SDLK_w # <<<<<<<<<<<<<< * X = SDLK_x * Y = SDLK_y */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_W, __pyx_t_4) < 0) __PYX_ERR(0, 688, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":689 * V = SDLK_v * W = SDLK_w * X = SDLK_x # <<<<<<<<<<<<<< * Y = SDLK_y * Z = SDLK_z */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_X, __pyx_t_4) < 0) __PYX_ERR(0, 689, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":690 * W = SDLK_w * X = SDLK_x * Y = SDLK_y # <<<<<<<<<<<<<< * Z = SDLK_z * CAPSLOCK = SDLK_CAPSLOCK */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_Y, __pyx_t_4) < 0) __PYX_ERR(0, 690, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":691 * X = SDLK_x * Y = SDLK_y * Z = SDLK_z # <<<<<<<<<<<<<< * CAPSLOCK = SDLK_CAPSLOCK * F1 = SDLK_F1 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_z); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_Z, __pyx_t_4) < 0) __PYX_ERR(0, 691, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":692 * Y = SDLK_y * Z = SDLK_z * CAPSLOCK = SDLK_CAPSLOCK # <<<<<<<<<<<<<< * F1 = SDLK_F1 * F2 = SDLK_F2 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_CAPSLOCK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CAPSLOCK, __pyx_t_4) < 0) __PYX_ERR(0, 692, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":693 * Z = SDLK_z * CAPSLOCK = SDLK_CAPSLOCK * F1 = SDLK_F1 # <<<<<<<<<<<<<< * F2 = SDLK_F2 * F3 = SDLK_F3 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F1, __pyx_t_4) < 0) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":694 * CAPSLOCK = SDLK_CAPSLOCK * F1 = SDLK_F1 * F2 = SDLK_F2 # <<<<<<<<<<<<<< * F3 = SDLK_F3 * F4 = SDLK_F4 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F2, __pyx_t_4) < 0) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":695 * F1 = SDLK_F1 * F2 = SDLK_F2 * F3 = SDLK_F3 # <<<<<<<<<<<<<< * F4 = SDLK_F4 * F5 = SDLK_F5 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F3, __pyx_t_4) < 0) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":696 * F2 = SDLK_F2 * F3 = SDLK_F3 * F4 = SDLK_F4 # <<<<<<<<<<<<<< * F5 = SDLK_F5 * F6 = SDLK_F6 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F4, __pyx_t_4) < 0) __PYX_ERR(0, 696, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":697 * F3 = SDLK_F3 * F4 = SDLK_F4 * F5 = SDLK_F5 # <<<<<<<<<<<<<< * F6 = SDLK_F6 * F7 = SDLK_F7 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F5, __pyx_t_4) < 0) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":698 * F4 = SDLK_F4 * F5 = SDLK_F5 * F6 = SDLK_F6 # <<<<<<<<<<<<<< * F7 = SDLK_F7 * F8 = SDLK_F8 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F6, __pyx_t_4) < 0) __PYX_ERR(0, 698, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":699 * F5 = SDLK_F5 * F6 = SDLK_F6 * F7 = SDLK_F7 # <<<<<<<<<<<<<< * F8 = SDLK_F8 * F9 = SDLK_F9 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F7, __pyx_t_4) < 0) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":700 * F6 = SDLK_F6 * F7 = SDLK_F7 * F8 = SDLK_F8 # <<<<<<<<<<<<<< * F9 = SDLK_F9 * F10 = SDLK_F10 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F8, __pyx_t_4) < 0) __PYX_ERR(0, 700, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":701 * F7 = SDLK_F7 * F8 = SDLK_F8 * F9 = SDLK_F9 # <<<<<<<<<<<<<< * F10 = SDLK_F10 * F11 = SDLK_F11 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F9, __pyx_t_4) < 0) __PYX_ERR(0, 701, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":702 * F8 = SDLK_F8 * F9 = SDLK_F9 * F10 = SDLK_F10 # <<<<<<<<<<<<<< * F11 = SDLK_F11 * F12 = SDLK_F12 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F10, __pyx_t_4) < 0) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":703 * F9 = SDLK_F9 * F10 = SDLK_F10 * F11 = SDLK_F11 # <<<<<<<<<<<<<< * F12 = SDLK_F12 * PRINTSCREEN = SDLK_PRINTSCREEN */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F11, __pyx_t_4) < 0) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":704 * F10 = SDLK_F10 * F11 = SDLK_F11 * F12 = SDLK_F12 # <<<<<<<<<<<<<< * PRINTSCREEN = SDLK_PRINTSCREEN * SCROLLLOCK = SDLK_SCROLLLOCK */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F12, __pyx_t_4) < 0) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":705 * F11 = SDLK_F11 * F12 = SDLK_F12 * PRINTSCREEN = SDLK_PRINTSCREEN # <<<<<<<<<<<<<< * SCROLLLOCK = SDLK_SCROLLLOCK * PAUSE = SDLK_PAUSE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_PRINTSCREEN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_PRINTSCREEN, __pyx_t_4) < 0) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":706 * F12 = SDLK_F12 * PRINTSCREEN = SDLK_PRINTSCREEN * SCROLLLOCK = SDLK_SCROLLLOCK # <<<<<<<<<<<<<< * PAUSE = SDLK_PAUSE * INSERT = SDLK_INSERT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_SCROLLLOCK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SCROLLLOCK, __pyx_t_4) < 0) __PYX_ERR(0, 706, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":707 * PRINTSCREEN = SDLK_PRINTSCREEN * SCROLLLOCK = SDLK_SCROLLLOCK * PAUSE = SDLK_PAUSE # <<<<<<<<<<<<<< * INSERT = SDLK_INSERT * HOME = SDLK_HOME */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_PAUSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_PAUSE, __pyx_t_4) < 0) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":708 * SCROLLLOCK = SDLK_SCROLLLOCK * PAUSE = SDLK_PAUSE * INSERT = SDLK_INSERT # <<<<<<<<<<<<<< * HOME = SDLK_HOME * PAGEUP = SDLK_PAGEUP */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_INSERT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_INSERT, __pyx_t_4) < 0) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":709 * PAUSE = SDLK_PAUSE * INSERT = SDLK_INSERT * HOME = SDLK_HOME # <<<<<<<<<<<<<< * PAGEUP = SDLK_PAGEUP * DELETE = SDLK_DELETE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_HOME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_HOME, __pyx_t_4) < 0) __PYX_ERR(0, 709, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":710 * INSERT = SDLK_INSERT * HOME = SDLK_HOME * PAGEUP = SDLK_PAGEUP # <<<<<<<<<<<<<< * DELETE = SDLK_DELETE * END = SDLK_END */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_PAGEUP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_PAGEUP, __pyx_t_4) < 0) __PYX_ERR(0, 710, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":711 * HOME = SDLK_HOME * PAGEUP = SDLK_PAGEUP * DELETE = SDLK_DELETE # <<<<<<<<<<<<<< * END = SDLK_END * PAGEDOWN = SDLK_PAGEDOWN */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_DELETE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DELETE, __pyx_t_4) < 0) __PYX_ERR(0, 711, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":712 * PAGEUP = SDLK_PAGEUP * DELETE = SDLK_DELETE * END = SDLK_END # <<<<<<<<<<<<<< * PAGEDOWN = SDLK_PAGEDOWN * RIGHT = SDLK_RIGHT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_END); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_END, __pyx_t_4) < 0) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":713 * DELETE = SDLK_DELETE * END = SDLK_END * PAGEDOWN = SDLK_PAGEDOWN # <<<<<<<<<<<<<< * RIGHT = SDLK_RIGHT * LEFT = SDLK_LEFT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_PAGEDOWN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_PAGEDOWN, __pyx_t_4) < 0) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":714 * END = SDLK_END * PAGEDOWN = SDLK_PAGEDOWN * RIGHT = SDLK_RIGHT # <<<<<<<<<<<<<< * LEFT = SDLK_LEFT * DOWN = SDLK_DOWN */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_RIGHT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_RIGHT, __pyx_t_4) < 0) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":715 * PAGEDOWN = SDLK_PAGEDOWN * RIGHT = SDLK_RIGHT * LEFT = SDLK_LEFT # <<<<<<<<<<<<<< * DOWN = SDLK_DOWN * UP = SDLK_UP */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_LEFT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LEFT, __pyx_t_4) < 0) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":716 * RIGHT = SDLK_RIGHT * LEFT = SDLK_LEFT * DOWN = SDLK_DOWN # <<<<<<<<<<<<<< * UP = SDLK_UP * NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_DOWN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DOWN, __pyx_t_4) < 0) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":717 * LEFT = SDLK_LEFT * DOWN = SDLK_DOWN * UP = SDLK_UP # <<<<<<<<<<<<<< * NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR * KP_DIVIDE = SDLK_KP_DIVIDE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_UP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_UP, __pyx_t_4) < 0) __PYX_ERR(0, 717, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":718 * DOWN = SDLK_DOWN * UP = SDLK_UP * NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR # <<<<<<<<<<<<<< * KP_DIVIDE = SDLK_KP_DIVIDE * KP_MULTIPLY = SDLK_KP_MULTIPLY */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_NUMLOCKCLEAR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NUMLOCKCLEAR, __pyx_t_4) < 0) __PYX_ERR(0, 718, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":719 * UP = SDLK_UP * NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR * KP_DIVIDE = SDLK_KP_DIVIDE # <<<<<<<<<<<<<< * KP_MULTIPLY = SDLK_KP_MULTIPLY * KP_MINUS = SDLK_KP_MINUS */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_DIVIDE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_DIVIDE, __pyx_t_4) < 0) __PYX_ERR(0, 719, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":720 * NUMLOCKCLEAR = SDLK_NUMLOCKCLEAR * KP_DIVIDE = SDLK_KP_DIVIDE * KP_MULTIPLY = SDLK_KP_MULTIPLY # <<<<<<<<<<<<<< * KP_MINUS = SDLK_KP_MINUS * KP_PLUS = SDLK_KP_PLUS */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_MULTIPLY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_MULTIPLY, __pyx_t_4) < 0) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":721 * KP_DIVIDE = SDLK_KP_DIVIDE * KP_MULTIPLY = SDLK_KP_MULTIPLY * KP_MINUS = SDLK_KP_MINUS # <<<<<<<<<<<<<< * KP_PLUS = SDLK_KP_PLUS * KP_ENTER = SDLK_KP_ENTER */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_MINUS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_MINUS, __pyx_t_4) < 0) __PYX_ERR(0, 721, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":722 * KP_MULTIPLY = SDLK_KP_MULTIPLY * KP_MINUS = SDLK_KP_MINUS * KP_PLUS = SDLK_KP_PLUS # <<<<<<<<<<<<<< * KP_ENTER = SDLK_KP_ENTER * KP_1 = SDLK_KP_1 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_PLUS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_PLUS, __pyx_t_4) < 0) __PYX_ERR(0, 722, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":723 * KP_MINUS = SDLK_KP_MINUS * KP_PLUS = SDLK_KP_PLUS * KP_ENTER = SDLK_KP_ENTER # <<<<<<<<<<<<<< * KP_1 = SDLK_KP_1 * KP_2 = SDLK_KP_2 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_ENTER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_ENTER, __pyx_t_4) < 0) __PYX_ERR(0, 723, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":724 * KP_PLUS = SDLK_KP_PLUS * KP_ENTER = SDLK_KP_ENTER * KP_1 = SDLK_KP_1 # <<<<<<<<<<<<<< * KP_2 = SDLK_KP_2 * KP_3 = SDLK_KP_3 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_1, __pyx_t_4) < 0) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":725 * KP_ENTER = SDLK_KP_ENTER * KP_1 = SDLK_KP_1 * KP_2 = SDLK_KP_2 # <<<<<<<<<<<<<< * KP_3 = SDLK_KP_3 * KP_4 = SDLK_KP_4 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_2, __pyx_t_4) < 0) __PYX_ERR(0, 725, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":726 * KP_1 = SDLK_KP_1 * KP_2 = SDLK_KP_2 * KP_3 = SDLK_KP_3 # <<<<<<<<<<<<<< * KP_4 = SDLK_KP_4 * KP_5 = SDLK_KP_5 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_3, __pyx_t_4) < 0) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":727 * KP_2 = SDLK_KP_2 * KP_3 = SDLK_KP_3 * KP_4 = SDLK_KP_4 # <<<<<<<<<<<<<< * KP_5 = SDLK_KP_5 * KP_6 = SDLK_KP_6 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_4, __pyx_t_4) < 0) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":728 * KP_3 = SDLK_KP_3 * KP_4 = SDLK_KP_4 * KP_5 = SDLK_KP_5 # <<<<<<<<<<<<<< * KP_6 = SDLK_KP_6 * KP_7 = SDLK_KP_7 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_5, __pyx_t_4) < 0) __PYX_ERR(0, 728, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":729 * KP_4 = SDLK_KP_4 * KP_5 = SDLK_KP_5 * KP_6 = SDLK_KP_6 # <<<<<<<<<<<<<< * KP_7 = SDLK_KP_7 * KP_8 = SDLK_KP_8 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_6, __pyx_t_4) < 0) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":730 * KP_5 = SDLK_KP_5 * KP_6 = SDLK_KP_6 * KP_7 = SDLK_KP_7 # <<<<<<<<<<<<<< * KP_8 = SDLK_KP_8 * KP_9 = SDLK_KP_9 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_7, __pyx_t_4) < 0) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":731 * KP_6 = SDLK_KP_6 * KP_7 = SDLK_KP_7 * KP_8 = SDLK_KP_8 # <<<<<<<<<<<<<< * KP_9 = SDLK_KP_9 * KP_0 = SDLK_KP_0 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_8, __pyx_t_4) < 0) __PYX_ERR(0, 731, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":732 * KP_7 = SDLK_KP_7 * KP_8 = SDLK_KP_8 * KP_9 = SDLK_KP_9 # <<<<<<<<<<<<<< * KP_0 = SDLK_KP_0 * KP_PERIOD = SDLK_KP_PERIOD */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_9, __pyx_t_4) < 0) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":733 * KP_8 = SDLK_KP_8 * KP_9 = SDLK_KP_9 * KP_0 = SDLK_KP_0 # <<<<<<<<<<<<<< * KP_PERIOD = SDLK_KP_PERIOD * APPLICATION = SDLK_APPLICATION */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_0, __pyx_t_4) < 0) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":734 * KP_9 = SDLK_KP_9 * KP_0 = SDLK_KP_0 * KP_PERIOD = SDLK_KP_PERIOD # <<<<<<<<<<<<<< * APPLICATION = SDLK_APPLICATION * POWER = SDLK_POWER */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_PERIOD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_PERIOD, __pyx_t_4) < 0) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":735 * KP_0 = SDLK_KP_0 * KP_PERIOD = SDLK_KP_PERIOD * APPLICATION = SDLK_APPLICATION # <<<<<<<<<<<<<< * POWER = SDLK_POWER * KP_EQUALS = SDLK_KP_EQUALS */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_APPLICATION); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_APPLICATION, __pyx_t_4) < 0) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":736 * KP_PERIOD = SDLK_KP_PERIOD * APPLICATION = SDLK_APPLICATION * POWER = SDLK_POWER # <<<<<<<<<<<<<< * KP_EQUALS = SDLK_KP_EQUALS * F13 = SDLK_F13 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_POWER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_POWER, __pyx_t_4) < 0) __PYX_ERR(0, 736, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":737 * APPLICATION = SDLK_APPLICATION * POWER = SDLK_POWER * KP_EQUALS = SDLK_KP_EQUALS # <<<<<<<<<<<<<< * F13 = SDLK_F13 * F14 = SDLK_F14 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_EQUALS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_EQUALS, __pyx_t_4) < 0) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":738 * POWER = SDLK_POWER * KP_EQUALS = SDLK_KP_EQUALS * F13 = SDLK_F13 # <<<<<<<<<<<<<< * F14 = SDLK_F14 * F15 = SDLK_F15 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F13, __pyx_t_4) < 0) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":739 * KP_EQUALS = SDLK_KP_EQUALS * F13 = SDLK_F13 * F14 = SDLK_F14 # <<<<<<<<<<<<<< * F15 = SDLK_F15 * F16 = SDLK_F16 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F14, __pyx_t_4) < 0) __PYX_ERR(0, 739, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":740 * F13 = SDLK_F13 * F14 = SDLK_F14 * F15 = SDLK_F15 # <<<<<<<<<<<<<< * F16 = SDLK_F16 * F17 = SDLK_F17 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F15); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F15, __pyx_t_4) < 0) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":741 * F14 = SDLK_F14 * F15 = SDLK_F15 * F16 = SDLK_F16 # <<<<<<<<<<<<<< * F17 = SDLK_F17 * F18 = SDLK_F18 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F16); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F16, __pyx_t_4) < 0) __PYX_ERR(0, 741, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":742 * F15 = SDLK_F15 * F16 = SDLK_F16 * F17 = SDLK_F17 # <<<<<<<<<<<<<< * F18 = SDLK_F18 * F19 = SDLK_F19 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F17); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F17, __pyx_t_4) < 0) __PYX_ERR(0, 742, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":743 * F16 = SDLK_F16 * F17 = SDLK_F17 * F18 = SDLK_F18 # <<<<<<<<<<<<<< * F19 = SDLK_F19 * F20 = SDLK_F20 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F18); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F18, __pyx_t_4) < 0) __PYX_ERR(0, 743, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":744 * F17 = SDLK_F17 * F18 = SDLK_F18 * F19 = SDLK_F19 # <<<<<<<<<<<<<< * F20 = SDLK_F20 * F21 = SDLK_F21 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F19); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F19, __pyx_t_4) < 0) __PYX_ERR(0, 744, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":745 * F18 = SDLK_F18 * F19 = SDLK_F19 * F20 = SDLK_F20 # <<<<<<<<<<<<<< * F21 = SDLK_F21 * F22 = SDLK_F22 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F20); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F20, __pyx_t_4) < 0) __PYX_ERR(0, 745, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":746 * F19 = SDLK_F19 * F20 = SDLK_F20 * F21 = SDLK_F21 # <<<<<<<<<<<<<< * F22 = SDLK_F22 * F23 = SDLK_F23 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F21); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F21, __pyx_t_4) < 0) __PYX_ERR(0, 746, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":747 * F20 = SDLK_F20 * F21 = SDLK_F21 * F22 = SDLK_F22 # <<<<<<<<<<<<<< * F23 = SDLK_F23 * F24 = SDLK_F24 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F22); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F22, __pyx_t_4) < 0) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":748 * F21 = SDLK_F21 * F22 = SDLK_F22 * F23 = SDLK_F23 # <<<<<<<<<<<<<< * F24 = SDLK_F24 * EXECUTE = SDLK_EXECUTE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F23); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F23, __pyx_t_4) < 0) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":749 * F22 = SDLK_F22 * F23 = SDLK_F23 * F24 = SDLK_F24 # <<<<<<<<<<<<<< * EXECUTE = SDLK_EXECUTE * HELP = SDLK_HELP */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_F24); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_F24, __pyx_t_4) < 0) __PYX_ERR(0, 749, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":750 * F23 = SDLK_F23 * F24 = SDLK_F24 * EXECUTE = SDLK_EXECUTE # <<<<<<<<<<<<<< * HELP = SDLK_HELP * MENU = SDLK_MENU */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_EXECUTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_EXECUTE, __pyx_t_4) < 0) __PYX_ERR(0, 750, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":751 * F24 = SDLK_F24 * EXECUTE = SDLK_EXECUTE * HELP = SDLK_HELP # <<<<<<<<<<<<<< * MENU = SDLK_MENU * SELECT = SDLK_SELECT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_HELP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_HELP, __pyx_t_4) < 0) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":752 * EXECUTE = SDLK_EXECUTE * HELP = SDLK_HELP * MENU = SDLK_MENU # <<<<<<<<<<<<<< * SELECT = SDLK_SELECT * STOP = SDLK_STOP */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_MENU); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_MENU, __pyx_t_4) < 0) __PYX_ERR(0, 752, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":753 * HELP = SDLK_HELP * MENU = SDLK_MENU * SELECT = SDLK_SELECT # <<<<<<<<<<<<<< * STOP = SDLK_STOP * AGAIN = SDLK_AGAIN */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_SELECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SELECT, __pyx_t_4) < 0) __PYX_ERR(0, 753, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":754 * MENU = SDLK_MENU * SELECT = SDLK_SELECT * STOP = SDLK_STOP # <<<<<<<<<<<<<< * AGAIN = SDLK_AGAIN * UNDO = SDLK_UNDO */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_STOP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_STOP, __pyx_t_4) < 0) __PYX_ERR(0, 754, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":755 * SELECT = SDLK_SELECT * STOP = SDLK_STOP * AGAIN = SDLK_AGAIN # <<<<<<<<<<<<<< * UNDO = SDLK_UNDO * CUT = SDLK_CUT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_AGAIN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_AGAIN, __pyx_t_4) < 0) __PYX_ERR(0, 755, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":756 * STOP = SDLK_STOP * AGAIN = SDLK_AGAIN * UNDO = SDLK_UNDO # <<<<<<<<<<<<<< * CUT = SDLK_CUT * COPY = SDLK_COPY */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_UNDO); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 756, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_UNDO, __pyx_t_4) < 0) __PYX_ERR(0, 756, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":757 * AGAIN = SDLK_AGAIN * UNDO = SDLK_UNDO * CUT = SDLK_CUT # <<<<<<<<<<<<<< * COPY = SDLK_COPY * PASTE = SDLK_PASTE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_CUT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CUT, __pyx_t_4) < 0) __PYX_ERR(0, 757, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":758 * UNDO = SDLK_UNDO * CUT = SDLK_CUT * COPY = SDLK_COPY # <<<<<<<<<<<<<< * PASTE = SDLK_PASTE * FIND = SDLK_FIND */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_COPY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_COPY, __pyx_t_4) < 0) __PYX_ERR(0, 758, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":759 * CUT = SDLK_CUT * COPY = SDLK_COPY * PASTE = SDLK_PASTE # <<<<<<<<<<<<<< * FIND = SDLK_FIND * MUTE = SDLK_MUTE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_PASTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_PASTE, __pyx_t_4) < 0) __PYX_ERR(0, 759, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":760 * COPY = SDLK_COPY * PASTE = SDLK_PASTE * FIND = SDLK_FIND # <<<<<<<<<<<<<< * MUTE = SDLK_MUTE * VOLUMEUP = SDLK_VOLUMEUP */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_FIND); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_FIND, __pyx_t_4) < 0) __PYX_ERR(0, 760, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":761 * PASTE = SDLK_PASTE * FIND = SDLK_FIND * MUTE = SDLK_MUTE # <<<<<<<<<<<<<< * VOLUMEUP = SDLK_VOLUMEUP * VOLUMEDOWN = SDLK_VOLUMEDOWN */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_MUTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_MUTE, __pyx_t_4) < 0) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":762 * FIND = SDLK_FIND * MUTE = SDLK_MUTE * VOLUMEUP = SDLK_VOLUMEUP # <<<<<<<<<<<<<< * VOLUMEDOWN = SDLK_VOLUMEDOWN * KP_COMMA = SDLK_KP_COMMA */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_VOLUMEUP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 762, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_VOLUMEUP, __pyx_t_4) < 0) __PYX_ERR(0, 762, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":763 * MUTE = SDLK_MUTE * VOLUMEUP = SDLK_VOLUMEUP * VOLUMEDOWN = SDLK_VOLUMEDOWN # <<<<<<<<<<<<<< * KP_COMMA = SDLK_KP_COMMA * KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_VOLUMEDOWN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_VOLUMEDOWN, __pyx_t_4) < 0) __PYX_ERR(0, 763, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":764 * VOLUMEUP = SDLK_VOLUMEUP * VOLUMEDOWN = SDLK_VOLUMEDOWN * KP_COMMA = SDLK_KP_COMMA # <<<<<<<<<<<<<< * KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 * ALTERASE = SDLK_ALTERASE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_COMMA); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_COMMA, __pyx_t_4) < 0) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":765 * VOLUMEDOWN = SDLK_VOLUMEDOWN * KP_COMMA = SDLK_KP_COMMA * KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 # <<<<<<<<<<<<<< * ALTERASE = SDLK_ALTERASE * SYSREQ = SDLK_SYSREQ */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_EQUALSAS400); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_EQUALSAS400, __pyx_t_4) < 0) __PYX_ERR(0, 765, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":766 * KP_COMMA = SDLK_KP_COMMA * KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 * ALTERASE = SDLK_ALTERASE # <<<<<<<<<<<<<< * SYSREQ = SDLK_SYSREQ * CANCEL = SDLK_CANCEL */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_ALTERASE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_ALTERASE, __pyx_t_4) < 0) __PYX_ERR(0, 766, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":767 * KP_EQUALSAS400 = SDLK_KP_EQUALSAS400 * ALTERASE = SDLK_ALTERASE * SYSREQ = SDLK_SYSREQ # <<<<<<<<<<<<<< * CANCEL = SDLK_CANCEL * CLEAR = SDLK_CLEAR */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_SYSREQ); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SYSREQ, __pyx_t_4) < 0) __PYX_ERR(0, 767, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":768 * ALTERASE = SDLK_ALTERASE * SYSREQ = SDLK_SYSREQ * CANCEL = SDLK_CANCEL # <<<<<<<<<<<<<< * CLEAR = SDLK_CLEAR * PRIOR = SDLK_PRIOR */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_CANCEL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CANCEL, __pyx_t_4) < 0) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":769 * SYSREQ = SDLK_SYSREQ * CANCEL = SDLK_CANCEL * CLEAR = SDLK_CLEAR # <<<<<<<<<<<<<< * PRIOR = SDLK_PRIOR * RETURN2 = SDLK_RETURN2 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_CLEAR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CLEAR, __pyx_t_4) < 0) __PYX_ERR(0, 769, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":770 * CANCEL = SDLK_CANCEL * CLEAR = SDLK_CLEAR * PRIOR = SDLK_PRIOR # <<<<<<<<<<<<<< * RETURN2 = SDLK_RETURN2 * SEPARATOR = SDLK_SEPARATOR */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_PRIOR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_PRIOR, __pyx_t_4) < 0) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":771 * CLEAR = SDLK_CLEAR * PRIOR = SDLK_PRIOR * RETURN2 = SDLK_RETURN2 # <<<<<<<<<<<<<< * SEPARATOR = SDLK_SEPARATOR * OUT = SDLK_OUT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_RETURN2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_RETURN2, __pyx_t_4) < 0) __PYX_ERR(0, 771, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":772 * PRIOR = SDLK_PRIOR * RETURN2 = SDLK_RETURN2 * SEPARATOR = SDLK_SEPARATOR # <<<<<<<<<<<<<< * OUT = SDLK_OUT * OPER = SDLK_OPER */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_SEPARATOR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SEPARATOR, __pyx_t_4) < 0) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":773 * RETURN2 = SDLK_RETURN2 * SEPARATOR = SDLK_SEPARATOR * OUT = SDLK_OUT # <<<<<<<<<<<<<< * OPER = SDLK_OPER * CLEARAGAIN = SDLK_CLEARAGAIN */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_OUT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_OUT, __pyx_t_4) < 0) __PYX_ERR(0, 773, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":774 * SEPARATOR = SDLK_SEPARATOR * OUT = SDLK_OUT * OPER = SDLK_OPER # <<<<<<<<<<<<<< * CLEARAGAIN = SDLK_CLEARAGAIN * CRSEL = SDLK_CRSEL */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_OPER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_OPER, __pyx_t_4) < 0) __PYX_ERR(0, 774, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":775 * OUT = SDLK_OUT * OPER = SDLK_OPER * CLEARAGAIN = SDLK_CLEARAGAIN # <<<<<<<<<<<<<< * CRSEL = SDLK_CRSEL * EXSEL = SDLK_EXSEL */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_CLEARAGAIN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CLEARAGAIN, __pyx_t_4) < 0) __PYX_ERR(0, 775, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":776 * OPER = SDLK_OPER * CLEARAGAIN = SDLK_CLEARAGAIN * CRSEL = SDLK_CRSEL # <<<<<<<<<<<<<< * EXSEL = SDLK_EXSEL * KP_00 = SDLK_KP_00 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_CRSEL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CRSEL, __pyx_t_4) < 0) __PYX_ERR(0, 776, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":777 * CLEARAGAIN = SDLK_CLEARAGAIN * CRSEL = SDLK_CRSEL * EXSEL = SDLK_EXSEL # <<<<<<<<<<<<<< * KP_00 = SDLK_KP_00 * KP_000 = SDLK_KP_000 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_EXSEL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 777, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_EXSEL, __pyx_t_4) < 0) __PYX_ERR(0, 777, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":778 * CRSEL = SDLK_CRSEL * EXSEL = SDLK_EXSEL * KP_00 = SDLK_KP_00 # <<<<<<<<<<<<<< * KP_000 = SDLK_KP_000 * THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_00); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_00, __pyx_t_4) < 0) __PYX_ERR(0, 778, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":779 * EXSEL = SDLK_EXSEL * KP_00 = SDLK_KP_00 * KP_000 = SDLK_KP_000 # <<<<<<<<<<<<<< * THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR * DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_000); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_000, __pyx_t_4) < 0) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":780 * KP_00 = SDLK_KP_00 * KP_000 = SDLK_KP_000 * THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR # <<<<<<<<<<<<<< * DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR * CURRENCYUNIT = SDLK_CURRENCYUNIT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_THOUSANDSSEPARATOR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_THOUSANDSSEPARATOR, __pyx_t_4) < 0) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":781 * KP_000 = SDLK_KP_000 * THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR * DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR # <<<<<<<<<<<<<< * CURRENCYUNIT = SDLK_CURRENCYUNIT * CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_DECIMALSEPARATOR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DECIMALSEPARATOR, __pyx_t_4) < 0) __PYX_ERR(0, 781, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":782 * THOUSANDSSEPARATOR = SDLK_THOUSANDSSEPARATOR * DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR * CURRENCYUNIT = SDLK_CURRENCYUNIT # <<<<<<<<<<<<<< * CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT * KP_LEFTPAREN = SDLK_KP_LEFTPAREN */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_CURRENCYUNIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CURRENCYUNIT, __pyx_t_4) < 0) __PYX_ERR(0, 782, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":783 * DECIMALSEPARATOR = SDLK_DECIMALSEPARATOR * CURRENCYUNIT = SDLK_CURRENCYUNIT * CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT # <<<<<<<<<<<<<< * KP_LEFTPAREN = SDLK_KP_LEFTPAREN * KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_CURRENCYSUBUNIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CURRENCYSUBUNIT, __pyx_t_4) < 0) __PYX_ERR(0, 783, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":784 * CURRENCYUNIT = SDLK_CURRENCYUNIT * CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT * KP_LEFTPAREN = SDLK_KP_LEFTPAREN # <<<<<<<<<<<<<< * KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN * KP_LEFTBRACE = SDLK_KP_LEFTBRACE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_LEFTPAREN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 784, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_LEFTPAREN, __pyx_t_4) < 0) __PYX_ERR(0, 784, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":785 * CURRENCYSUBUNIT = SDLK_CURRENCYSUBUNIT * KP_LEFTPAREN = SDLK_KP_LEFTPAREN * KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN # <<<<<<<<<<<<<< * KP_LEFTBRACE = SDLK_KP_LEFTBRACE * KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_RIGHTPAREN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_RIGHTPAREN, __pyx_t_4) < 0) __PYX_ERR(0, 785, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":786 * KP_LEFTPAREN = SDLK_KP_LEFTPAREN * KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN * KP_LEFTBRACE = SDLK_KP_LEFTBRACE # <<<<<<<<<<<<<< * KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE * KP_TAB = SDLK_KP_TAB */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_LEFTBRACE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_LEFTBRACE, __pyx_t_4) < 0) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":787 * KP_RIGHTPAREN = SDLK_KP_RIGHTPAREN * KP_LEFTBRACE = SDLK_KP_LEFTBRACE * KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE # <<<<<<<<<<<<<< * KP_TAB = SDLK_KP_TAB * KP_BACKSPACE = SDLK_KP_BACKSPACE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_RIGHTBRACE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 787, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_RIGHTBRACE, __pyx_t_4) < 0) __PYX_ERR(0, 787, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":788 * KP_LEFTBRACE = SDLK_KP_LEFTBRACE * KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE * KP_TAB = SDLK_KP_TAB # <<<<<<<<<<<<<< * KP_BACKSPACE = SDLK_KP_BACKSPACE * KP_A = SDLK_KP_A */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_TAB); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_TAB, __pyx_t_4) < 0) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":789 * KP_RIGHTBRACE = SDLK_KP_RIGHTBRACE * KP_TAB = SDLK_KP_TAB * KP_BACKSPACE = SDLK_KP_BACKSPACE # <<<<<<<<<<<<<< * KP_A = SDLK_KP_A * KP_B = SDLK_KP_B */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_BACKSPACE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_BACKSPACE, __pyx_t_4) < 0) __PYX_ERR(0, 789, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":790 * KP_TAB = SDLK_KP_TAB * KP_BACKSPACE = SDLK_KP_BACKSPACE * KP_A = SDLK_KP_A # <<<<<<<<<<<<<< * KP_B = SDLK_KP_B * KP_C = SDLK_KP_C */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_A); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_A, __pyx_t_4) < 0) __PYX_ERR(0, 790, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":791 * KP_BACKSPACE = SDLK_KP_BACKSPACE * KP_A = SDLK_KP_A * KP_B = SDLK_KP_B # <<<<<<<<<<<<<< * KP_C = SDLK_KP_C * KP_D = SDLK_KP_D */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_B); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_B, __pyx_t_4) < 0) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":792 * KP_A = SDLK_KP_A * KP_B = SDLK_KP_B * KP_C = SDLK_KP_C # <<<<<<<<<<<<<< * KP_D = SDLK_KP_D * KP_E = SDLK_KP_E */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_C); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_C, __pyx_t_4) < 0) __PYX_ERR(0, 792, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":793 * KP_B = SDLK_KP_B * KP_C = SDLK_KP_C * KP_D = SDLK_KP_D # <<<<<<<<<<<<<< * KP_E = SDLK_KP_E * KP_F = SDLK_KP_F */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_D); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_D, __pyx_t_4) < 0) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":794 * KP_C = SDLK_KP_C * KP_D = SDLK_KP_D * KP_E = SDLK_KP_E # <<<<<<<<<<<<<< * KP_F = SDLK_KP_F * KP_XOR = SDLK_KP_XOR */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_E); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_E, __pyx_t_4) < 0) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":795 * KP_D = SDLK_KP_D * KP_E = SDLK_KP_E * KP_F = SDLK_KP_F # <<<<<<<<<<<<<< * KP_XOR = SDLK_KP_XOR * KP_POWER = SDLK_KP_POWER */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_F); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_F, __pyx_t_4) < 0) __PYX_ERR(0, 795, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":796 * KP_E = SDLK_KP_E * KP_F = SDLK_KP_F * KP_XOR = SDLK_KP_XOR # <<<<<<<<<<<<<< * KP_POWER = SDLK_KP_POWER * KP_PERCENT = SDLK_KP_PERCENT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_XOR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_XOR, __pyx_t_4) < 0) __PYX_ERR(0, 796, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":797 * KP_F = SDLK_KP_F * KP_XOR = SDLK_KP_XOR * KP_POWER = SDLK_KP_POWER # <<<<<<<<<<<<<< * KP_PERCENT = SDLK_KP_PERCENT * KP_LESS = SDLK_KP_LESS */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_POWER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_POWER, __pyx_t_4) < 0) __PYX_ERR(0, 797, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":798 * KP_XOR = SDLK_KP_XOR * KP_POWER = SDLK_KP_POWER * KP_PERCENT = SDLK_KP_PERCENT # <<<<<<<<<<<<<< * KP_LESS = SDLK_KP_LESS * KP_GREATER = SDLK_KP_GREATER */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_PERCENT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 798, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_PERCENT, __pyx_t_4) < 0) __PYX_ERR(0, 798, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":799 * KP_POWER = SDLK_KP_POWER * KP_PERCENT = SDLK_KP_PERCENT * KP_LESS = SDLK_KP_LESS # <<<<<<<<<<<<<< * KP_GREATER = SDLK_KP_GREATER * KP_AMPERSAND = SDLK_KP_AMPERSAND */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_LESS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 799, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_LESS, __pyx_t_4) < 0) __PYX_ERR(0, 799, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":800 * KP_PERCENT = SDLK_KP_PERCENT * KP_LESS = SDLK_KP_LESS * KP_GREATER = SDLK_KP_GREATER # <<<<<<<<<<<<<< * KP_AMPERSAND = SDLK_KP_AMPERSAND * KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_GREATER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_GREATER, __pyx_t_4) < 0) __PYX_ERR(0, 800, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":801 * KP_LESS = SDLK_KP_LESS * KP_GREATER = SDLK_KP_GREATER * KP_AMPERSAND = SDLK_KP_AMPERSAND # <<<<<<<<<<<<<< * KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND * KP_VERTICALBAR = SDLK_KP_VERTICALBAR */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_AMPERSAND); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 801, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_AMPERSAND, __pyx_t_4) < 0) __PYX_ERR(0, 801, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":802 * KP_GREATER = SDLK_KP_GREATER * KP_AMPERSAND = SDLK_KP_AMPERSAND * KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND # <<<<<<<<<<<<<< * KP_VERTICALBAR = SDLK_KP_VERTICALBAR * KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_DBLAMPERSAND); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_DBLAMPERSAND, __pyx_t_4) < 0) __PYX_ERR(0, 802, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":803 * KP_AMPERSAND = SDLK_KP_AMPERSAND * KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND * KP_VERTICALBAR = SDLK_KP_VERTICALBAR # <<<<<<<<<<<<<< * KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR * KP_COLON = SDLK_KP_COLON */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_VERTICALBAR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 803, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_VERTICALBAR, __pyx_t_4) < 0) __PYX_ERR(0, 803, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":804 * KP_DBLAMPERSAND = SDLK_KP_DBLAMPERSAND * KP_VERTICALBAR = SDLK_KP_VERTICALBAR * KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR # <<<<<<<<<<<<<< * KP_COLON = SDLK_KP_COLON * KP_HASH = SDLK_KP_HASH */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_DBLVERTICALBAR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_DBLVERTICALBAR, __pyx_t_4) < 0) __PYX_ERR(0, 804, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":805 * KP_VERTICALBAR = SDLK_KP_VERTICALBAR * KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR * KP_COLON = SDLK_KP_COLON # <<<<<<<<<<<<<< * KP_HASH = SDLK_KP_HASH * KP_SPACE = SDLK_KP_SPACE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_COLON); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_COLON, __pyx_t_4) < 0) __PYX_ERR(0, 805, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":806 * KP_DBLVERTICALBAR = SDLK_KP_DBLVERTICALBAR * KP_COLON = SDLK_KP_COLON * KP_HASH = SDLK_KP_HASH # <<<<<<<<<<<<<< * KP_SPACE = SDLK_KP_SPACE * KP_AT = SDLK_KP_AT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_HASH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_HASH, __pyx_t_4) < 0) __PYX_ERR(0, 806, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":807 * KP_COLON = SDLK_KP_COLON * KP_HASH = SDLK_KP_HASH * KP_SPACE = SDLK_KP_SPACE # <<<<<<<<<<<<<< * KP_AT = SDLK_KP_AT * KP_EXCLAM = SDLK_KP_EXCLAM */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_SPACE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_SPACE, __pyx_t_4) < 0) __PYX_ERR(0, 807, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":808 * KP_HASH = SDLK_KP_HASH * KP_SPACE = SDLK_KP_SPACE * KP_AT = SDLK_KP_AT # <<<<<<<<<<<<<< * KP_EXCLAM = SDLK_KP_EXCLAM * KP_MEMSTORE = SDLK_KP_MEMSTORE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_AT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_AT, __pyx_t_4) < 0) __PYX_ERR(0, 808, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":809 * KP_SPACE = SDLK_KP_SPACE * KP_AT = SDLK_KP_AT * KP_EXCLAM = SDLK_KP_EXCLAM # <<<<<<<<<<<<<< * KP_MEMSTORE = SDLK_KP_MEMSTORE * KP_MEMRECALL = SDLK_KP_MEMRECALL */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_EXCLAM); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_EXCLAM, __pyx_t_4) < 0) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":810 * KP_AT = SDLK_KP_AT * KP_EXCLAM = SDLK_KP_EXCLAM * KP_MEMSTORE = SDLK_KP_MEMSTORE # <<<<<<<<<<<<<< * KP_MEMRECALL = SDLK_KP_MEMRECALL * KP_MEMCLEAR = SDLK_KP_MEMCLEAR */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_MEMSTORE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_MEMSTORE, __pyx_t_4) < 0) __PYX_ERR(0, 810, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":811 * KP_EXCLAM = SDLK_KP_EXCLAM * KP_MEMSTORE = SDLK_KP_MEMSTORE * KP_MEMRECALL = SDLK_KP_MEMRECALL # <<<<<<<<<<<<<< * KP_MEMCLEAR = SDLK_KP_MEMCLEAR * KP_MEMADD = SDLK_KP_MEMADD */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_MEMRECALL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_MEMRECALL, __pyx_t_4) < 0) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":812 * KP_MEMSTORE = SDLK_KP_MEMSTORE * KP_MEMRECALL = SDLK_KP_MEMRECALL * KP_MEMCLEAR = SDLK_KP_MEMCLEAR # <<<<<<<<<<<<<< * KP_MEMADD = SDLK_KP_MEMADD * KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_MEMCLEAR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_MEMCLEAR, __pyx_t_4) < 0) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":813 * KP_MEMRECALL = SDLK_KP_MEMRECALL * KP_MEMCLEAR = SDLK_KP_MEMCLEAR * KP_MEMADD = SDLK_KP_MEMADD # <<<<<<<<<<<<<< * KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT * KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_MEMADD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_MEMADD, __pyx_t_4) < 0) __PYX_ERR(0, 813, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":814 * KP_MEMCLEAR = SDLK_KP_MEMCLEAR * KP_MEMADD = SDLK_KP_MEMADD * KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT # <<<<<<<<<<<<<< * KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY * KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_MEMSUBTRACT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_MEMSUBTRACT, __pyx_t_4) < 0) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":815 * KP_MEMADD = SDLK_KP_MEMADD * KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT * KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY # <<<<<<<<<<<<<< * KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE * KP_PLUSMINUS = SDLK_KP_PLUSMINUS */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_MEMMULTIPLY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_MEMMULTIPLY, __pyx_t_4) < 0) __PYX_ERR(0, 815, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":816 * KP_MEMSUBTRACT = SDLK_KP_MEMSUBTRACT * KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY * KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE # <<<<<<<<<<<<<< * KP_PLUSMINUS = SDLK_KP_PLUSMINUS * KP_CLEAR = SDLK_KP_CLEAR */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_MEMDIVIDE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_MEMDIVIDE, __pyx_t_4) < 0) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":817 * KP_MEMMULTIPLY = SDLK_KP_MEMMULTIPLY * KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE * KP_PLUSMINUS = SDLK_KP_PLUSMINUS # <<<<<<<<<<<<<< * KP_CLEAR = SDLK_KP_CLEAR * KP_CLEARENTRY = SDLK_KP_CLEARENTRY */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_PLUSMINUS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_PLUSMINUS, __pyx_t_4) < 0) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":818 * KP_MEMDIVIDE = SDLK_KP_MEMDIVIDE * KP_PLUSMINUS = SDLK_KP_PLUSMINUS * KP_CLEAR = SDLK_KP_CLEAR # <<<<<<<<<<<<<< * KP_CLEARENTRY = SDLK_KP_CLEARENTRY * KP_BINARY = SDLK_KP_BINARY */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_CLEAR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_CLEAR, __pyx_t_4) < 0) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":819 * KP_PLUSMINUS = SDLK_KP_PLUSMINUS * KP_CLEAR = SDLK_KP_CLEAR * KP_CLEARENTRY = SDLK_KP_CLEARENTRY # <<<<<<<<<<<<<< * KP_BINARY = SDLK_KP_BINARY * KP_OCTAL = SDLK_KP_OCTAL */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_CLEARENTRY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 819, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_CLEARENTRY, __pyx_t_4) < 0) __PYX_ERR(0, 819, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":820 * KP_CLEAR = SDLK_KP_CLEAR * KP_CLEARENTRY = SDLK_KP_CLEARENTRY * KP_BINARY = SDLK_KP_BINARY # <<<<<<<<<<<<<< * KP_OCTAL = SDLK_KP_OCTAL * KP_DECIMAL = SDLK_KP_DECIMAL */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_BINARY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_BINARY, __pyx_t_4) < 0) __PYX_ERR(0, 820, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":821 * KP_CLEARENTRY = SDLK_KP_CLEARENTRY * KP_BINARY = SDLK_KP_BINARY * KP_OCTAL = SDLK_KP_OCTAL # <<<<<<<<<<<<<< * KP_DECIMAL = SDLK_KP_DECIMAL * KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_OCTAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_OCTAL, __pyx_t_4) < 0) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":822 * KP_BINARY = SDLK_KP_BINARY * KP_OCTAL = SDLK_KP_OCTAL * KP_DECIMAL = SDLK_KP_DECIMAL # <<<<<<<<<<<<<< * KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL * LCTRL = SDLK_LCTRL */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_DECIMAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_DECIMAL, __pyx_t_4) < 0) __PYX_ERR(0, 822, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":823 * KP_OCTAL = SDLK_KP_OCTAL * KP_DECIMAL = SDLK_KP_DECIMAL * KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL # <<<<<<<<<<<<<< * LCTRL = SDLK_LCTRL * LSHIFT = SDLK_LSHIFT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KP_HEXADECIMAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KP_HEXADECIMAL, __pyx_t_4) < 0) __PYX_ERR(0, 823, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":824 * KP_DECIMAL = SDLK_KP_DECIMAL * KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL * LCTRL = SDLK_LCTRL # <<<<<<<<<<<<<< * LSHIFT = SDLK_LSHIFT * LALT = SDLK_LALT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_LCTRL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 824, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LCTRL, __pyx_t_4) < 0) __PYX_ERR(0, 824, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":825 * KP_HEXADECIMAL = SDLK_KP_HEXADECIMAL * LCTRL = SDLK_LCTRL * LSHIFT = SDLK_LSHIFT # <<<<<<<<<<<<<< * LALT = SDLK_LALT * LGUI = SDLK_LGUI */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_LSHIFT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LSHIFT, __pyx_t_4) < 0) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":826 * LCTRL = SDLK_LCTRL * LSHIFT = SDLK_LSHIFT * LALT = SDLK_LALT # <<<<<<<<<<<<<< * LGUI = SDLK_LGUI * RCTRL = SDLK_RCTRL */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_LALT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LALT, __pyx_t_4) < 0) __PYX_ERR(0, 826, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":827 * LSHIFT = SDLK_LSHIFT * LALT = SDLK_LALT * LGUI = SDLK_LGUI # <<<<<<<<<<<<<< * RCTRL = SDLK_RCTRL * RSHIFT = SDLK_RSHIFT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_LGUI); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LGUI, __pyx_t_4) < 0) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":828 * LALT = SDLK_LALT * LGUI = SDLK_LGUI * RCTRL = SDLK_RCTRL # <<<<<<<<<<<<<< * RSHIFT = SDLK_RSHIFT * RALT = SDLK_RALT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_RCTRL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_RCTRL, __pyx_t_4) < 0) __PYX_ERR(0, 828, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":829 * LGUI = SDLK_LGUI * RCTRL = SDLK_RCTRL * RSHIFT = SDLK_RSHIFT # <<<<<<<<<<<<<< * RALT = SDLK_RALT * RGUI = SDLK_RGUI */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_RSHIFT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 829, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_RSHIFT, __pyx_t_4) < 0) __PYX_ERR(0, 829, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":830 * RCTRL = SDLK_RCTRL * RSHIFT = SDLK_RSHIFT * RALT = SDLK_RALT # <<<<<<<<<<<<<< * RGUI = SDLK_RGUI * MODE = SDLK_MODE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_RALT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_RALT, __pyx_t_4) < 0) __PYX_ERR(0, 830, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":831 * RSHIFT = SDLK_RSHIFT * RALT = SDLK_RALT * RGUI = SDLK_RGUI # <<<<<<<<<<<<<< * MODE = SDLK_MODE * AUDIONEXT = SDLK_AUDIONEXT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_RGUI); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_RGUI, __pyx_t_4) < 0) __PYX_ERR(0, 831, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":832 * RALT = SDLK_RALT * RGUI = SDLK_RGUI * MODE = SDLK_MODE # <<<<<<<<<<<<<< * AUDIONEXT = SDLK_AUDIONEXT * AUDIOPREV = SDLK_AUDIOPREV */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_MODE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_MODE, __pyx_t_4) < 0) __PYX_ERR(0, 832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":833 * RGUI = SDLK_RGUI * MODE = SDLK_MODE * AUDIONEXT = SDLK_AUDIONEXT # <<<<<<<<<<<<<< * AUDIOPREV = SDLK_AUDIOPREV * AUDIOSTOP = SDLK_AUDIOSTOP */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_AUDIONEXT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_AUDIONEXT, __pyx_t_4) < 0) __PYX_ERR(0, 833, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":834 * MODE = SDLK_MODE * AUDIONEXT = SDLK_AUDIONEXT * AUDIOPREV = SDLK_AUDIOPREV # <<<<<<<<<<<<<< * AUDIOSTOP = SDLK_AUDIOSTOP * AUDIOPLAY = SDLK_AUDIOPLAY */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_AUDIOPREV); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_AUDIOPREV, __pyx_t_4) < 0) __PYX_ERR(0, 834, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":835 * AUDIONEXT = SDLK_AUDIONEXT * AUDIOPREV = SDLK_AUDIOPREV * AUDIOSTOP = SDLK_AUDIOSTOP # <<<<<<<<<<<<<< * AUDIOPLAY = SDLK_AUDIOPLAY * AUDIOMUTE = SDLK_AUDIOMUTE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_AUDIOSTOP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_AUDIOSTOP, __pyx_t_4) < 0) __PYX_ERR(0, 835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":836 * AUDIOPREV = SDLK_AUDIOPREV * AUDIOSTOP = SDLK_AUDIOSTOP * AUDIOPLAY = SDLK_AUDIOPLAY # <<<<<<<<<<<<<< * AUDIOMUTE = SDLK_AUDIOMUTE * MEDIASELECT = SDLK_MEDIASELECT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_AUDIOPLAY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_AUDIOPLAY, __pyx_t_4) < 0) __PYX_ERR(0, 836, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":837 * AUDIOSTOP = SDLK_AUDIOSTOP * AUDIOPLAY = SDLK_AUDIOPLAY * AUDIOMUTE = SDLK_AUDIOMUTE # <<<<<<<<<<<<<< * MEDIASELECT = SDLK_MEDIASELECT * WWW = SDLK_WWW */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_AUDIOMUTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_AUDIOMUTE, __pyx_t_4) < 0) __PYX_ERR(0, 837, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":838 * AUDIOPLAY = SDLK_AUDIOPLAY * AUDIOMUTE = SDLK_AUDIOMUTE * MEDIASELECT = SDLK_MEDIASELECT # <<<<<<<<<<<<<< * WWW = SDLK_WWW * MAIL = SDLK_MAIL */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_MEDIASELECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_MEDIASELECT, __pyx_t_4) < 0) __PYX_ERR(0, 838, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":839 * AUDIOMUTE = SDLK_AUDIOMUTE * MEDIASELECT = SDLK_MEDIASELECT * WWW = SDLK_WWW # <<<<<<<<<<<<<< * MAIL = SDLK_MAIL * CALCULATOR = SDLK_CALCULATOR */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_WWW); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_WWW, __pyx_t_4) < 0) __PYX_ERR(0, 839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":840 * MEDIASELECT = SDLK_MEDIASELECT * WWW = SDLK_WWW * MAIL = SDLK_MAIL # <<<<<<<<<<<<<< * CALCULATOR = SDLK_CALCULATOR * COMPUTER = SDLK_COMPUTER */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_MAIL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_MAIL, __pyx_t_4) < 0) __PYX_ERR(0, 840, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":841 * WWW = SDLK_WWW * MAIL = SDLK_MAIL * CALCULATOR = SDLK_CALCULATOR # <<<<<<<<<<<<<< * COMPUTER = SDLK_COMPUTER * AC_SEARCH = SDLK_AC_SEARCH */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_CALCULATOR); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_CALCULATOR, __pyx_t_4) < 0) __PYX_ERR(0, 841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":842 * MAIL = SDLK_MAIL * CALCULATOR = SDLK_CALCULATOR * COMPUTER = SDLK_COMPUTER # <<<<<<<<<<<<<< * AC_SEARCH = SDLK_AC_SEARCH * AC_HOME = SDLK_AC_HOME */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_COMPUTER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_COMPUTER, __pyx_t_4) < 0) __PYX_ERR(0, 842, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":843 * CALCULATOR = SDLK_CALCULATOR * COMPUTER = SDLK_COMPUTER * AC_SEARCH = SDLK_AC_SEARCH # <<<<<<<<<<<<<< * AC_HOME = SDLK_AC_HOME * AC_BACK = SDLK_AC_BACK */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_AC_SEARCH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_AC_SEARCH, __pyx_t_4) < 0) __PYX_ERR(0, 843, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":844 * COMPUTER = SDLK_COMPUTER * AC_SEARCH = SDLK_AC_SEARCH * AC_HOME = SDLK_AC_HOME # <<<<<<<<<<<<<< * AC_BACK = SDLK_AC_BACK * AC_FORWARD = SDLK_AC_FORWARD */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_AC_HOME); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_AC_HOME, __pyx_t_4) < 0) __PYX_ERR(0, 844, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":845 * AC_SEARCH = SDLK_AC_SEARCH * AC_HOME = SDLK_AC_HOME * AC_BACK = SDLK_AC_BACK # <<<<<<<<<<<<<< * AC_FORWARD = SDLK_AC_FORWARD * AC_STOP = SDLK_AC_STOP */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_AC_BACK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_AC_BACK, __pyx_t_4) < 0) __PYX_ERR(0, 845, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":846 * AC_HOME = SDLK_AC_HOME * AC_BACK = SDLK_AC_BACK * AC_FORWARD = SDLK_AC_FORWARD # <<<<<<<<<<<<<< * AC_STOP = SDLK_AC_STOP * AC_REFRESH = SDLK_AC_REFRESH */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_AC_FORWARD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 846, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_AC_FORWARD, __pyx_t_4) < 0) __PYX_ERR(0, 846, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":847 * AC_BACK = SDLK_AC_BACK * AC_FORWARD = SDLK_AC_FORWARD * AC_STOP = SDLK_AC_STOP # <<<<<<<<<<<<<< * AC_REFRESH = SDLK_AC_REFRESH * AC_BOOKMARKS = SDLK_AC_BOOKMARKS */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_AC_STOP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_AC_STOP, __pyx_t_4) < 0) __PYX_ERR(0, 847, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":848 * AC_FORWARD = SDLK_AC_FORWARD * AC_STOP = SDLK_AC_STOP * AC_REFRESH = SDLK_AC_REFRESH # <<<<<<<<<<<<<< * AC_BOOKMARKS = SDLK_AC_BOOKMARKS * BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_AC_REFRESH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_AC_REFRESH, __pyx_t_4) < 0) __PYX_ERR(0, 848, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":849 * AC_STOP = SDLK_AC_STOP * AC_REFRESH = SDLK_AC_REFRESH * AC_BOOKMARKS = SDLK_AC_BOOKMARKS # <<<<<<<<<<<<<< * BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN * BRIGHTNESSUP = SDLK_BRIGHTNESSUP */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_AC_BOOKMARKS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_AC_BOOKMARKS, __pyx_t_4) < 0) __PYX_ERR(0, 849, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":850 * AC_REFRESH = SDLK_AC_REFRESH * AC_BOOKMARKS = SDLK_AC_BOOKMARKS * BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN # <<<<<<<<<<<<<< * BRIGHTNESSUP = SDLK_BRIGHTNESSUP * DISPLAYSWITCH = SDLK_DISPLAYSWITCH */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_BRIGHTNESSDOWN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BRIGHTNESSDOWN, __pyx_t_4) < 0) __PYX_ERR(0, 850, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":851 * AC_BOOKMARKS = SDLK_AC_BOOKMARKS * BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN * BRIGHTNESSUP = SDLK_BRIGHTNESSUP # <<<<<<<<<<<<<< * DISPLAYSWITCH = SDLK_DISPLAYSWITCH * KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_BRIGHTNESSUP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_BRIGHTNESSUP, __pyx_t_4) < 0) __PYX_ERR(0, 851, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":852 * BRIGHTNESSDOWN = SDLK_BRIGHTNESSDOWN * BRIGHTNESSUP = SDLK_BRIGHTNESSUP * DISPLAYSWITCH = SDLK_DISPLAYSWITCH # <<<<<<<<<<<<<< * KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE * KBDILLUMDOWN = SDLK_KBDILLUMDOWN */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_DISPLAYSWITCH); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_DISPLAYSWITCH, __pyx_t_4) < 0) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":853 * BRIGHTNESSUP = SDLK_BRIGHTNESSUP * DISPLAYSWITCH = SDLK_DISPLAYSWITCH * KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE # <<<<<<<<<<<<<< * KBDILLUMDOWN = SDLK_KBDILLUMDOWN * KBDILLUMUP = SDLK_KBDILLUMUP */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KBDILLUMTOGGLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KBDILLUMTOGGLE, __pyx_t_4) < 0) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":854 * DISPLAYSWITCH = SDLK_DISPLAYSWITCH * KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE * KBDILLUMDOWN = SDLK_KBDILLUMDOWN # <<<<<<<<<<<<<< * KBDILLUMUP = SDLK_KBDILLUMUP * EJECT = SDLK_EJECT */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KBDILLUMDOWN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KBDILLUMDOWN, __pyx_t_4) < 0) __PYX_ERR(0, 854, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":855 * KBDILLUMTOGGLE = SDLK_KBDILLUMTOGGLE * KBDILLUMDOWN = SDLK_KBDILLUMDOWN * KBDILLUMUP = SDLK_KBDILLUMUP # <<<<<<<<<<<<<< * EJECT = SDLK_EJECT * SLEEP = SDLK_SLEEP */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_KBDILLUMUP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_KBDILLUMUP, __pyx_t_4) < 0) __PYX_ERR(0, 855, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":856 * KBDILLUMDOWN = SDLK_KBDILLUMDOWN * KBDILLUMUP = SDLK_KBDILLUMUP * EJECT = SDLK_EJECT # <<<<<<<<<<<<<< * SLEEP = SDLK_SLEEP * APP1 = SDLK_APP1 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_EJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_EJECT, __pyx_t_4) < 0) __PYX_ERR(0, 856, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":857 * KBDILLUMUP = SDLK_KBDILLUMUP * EJECT = SDLK_EJECT * SLEEP = SDLK_SLEEP # <<<<<<<<<<<<<< * APP1 = SDLK_APP1 * APP2 = SDLK_APP2 */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_SLEEP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SLEEP, __pyx_t_4) < 0) __PYX_ERR(0, 857, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":858 * EJECT = SDLK_EJECT * SLEEP = SDLK_SLEEP * APP1 = SDLK_APP1 # <<<<<<<<<<<<<< * APP2 = SDLK_APP2 * AUDIOREWIND = SDLK_AUDIOREWIND */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_APP1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_APP1, __pyx_t_4) < 0) __PYX_ERR(0, 858, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":859 * SLEEP = SDLK_SLEEP * APP1 = SDLK_APP1 * APP2 = SDLK_APP2 # <<<<<<<<<<<<<< * AUDIOREWIND = SDLK_AUDIOREWIND * AUDIOFASTFORWARD = SDLK_AUDIOFASTFORWARD */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_APP2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_APP2, __pyx_t_4) < 0) __PYX_ERR(0, 859, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":860 * APP1 = SDLK_APP1 * APP2 = SDLK_APP2 * AUDIOREWIND = SDLK_AUDIOREWIND # <<<<<<<<<<<<<< * AUDIOFASTFORWARD = SDLK_AUDIOFASTFORWARD * */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_AUDIOREWIND); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_AUDIOREWIND, __pyx_t_4) < 0) __PYX_ERR(0, 860, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":861 * APP2 = SDLK_APP2 * AUDIOREWIND = SDLK_AUDIOREWIND * AUDIOFASTFORWARD = SDLK_AUDIOFASTFORWARD # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __Pyx_PyInt_From_int32_t(SDLK_AUDIOFASTFORWARD); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_AUDIOFASTFORWARD, __pyx_t_4) < 0) __PYX_ERR(0, 861, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":621 * * * class Key(enum.IntEnum): # <<<<<<<<<<<<<< * UNKNOWN = SDLK_UNKNOWN * RETURN = SDLK_RETURN */ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Key, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Key, __pyx_t_4) < 0) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":864 * * * class ControllerButton(enum.IntEnum): # <<<<<<<<<<<<<< * A = SDL_CONTROLLER_BUTTON_A * B = SDL_CONTROLLER_BUTTON_B */ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_enum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ControllerButton, __pyx_n_s_ControllerButton, (PyObject *) NULL, __pyx_n_s_pyxelen, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "pyxelen.pyx":865 * * class ControllerButton(enum.IntEnum): * A = SDL_CONTROLLER_BUTTON_A # <<<<<<<<<<<<<< * B = SDL_CONTROLLER_BUTTON_B * X = SDL_CONTROLLER_BUTTON_X */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(SDL_CONTROLLER_BUTTON_A); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_A, __pyx_t_4) < 0) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":866 * class ControllerButton(enum.IntEnum): * A = SDL_CONTROLLER_BUTTON_A * B = SDL_CONTROLLER_BUTTON_B # <<<<<<<<<<<<<< * X = SDL_CONTROLLER_BUTTON_X * Y = SDL_CONTROLLER_BUTTON_Y */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(SDL_CONTROLLER_BUTTON_B); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_B, __pyx_t_4) < 0) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":867 * A = SDL_CONTROLLER_BUTTON_A * B = SDL_CONTROLLER_BUTTON_B * X = SDL_CONTROLLER_BUTTON_X # <<<<<<<<<<<<<< * Y = SDL_CONTROLLER_BUTTON_Y * SELECT = SDL_CONTROLLER_BUTTON_BACK */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(SDL_CONTROLLER_BUTTON_X); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_X, __pyx_t_4) < 0) __PYX_ERR(0, 867, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":868 * B = SDL_CONTROLLER_BUTTON_B * X = SDL_CONTROLLER_BUTTON_X * Y = SDL_CONTROLLER_BUTTON_Y # <<<<<<<<<<<<<< * SELECT = SDL_CONTROLLER_BUTTON_BACK * START = SDL_CONTROLLER_BUTTON_START */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(SDL_CONTROLLER_BUTTON_Y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_Y, __pyx_t_4) < 0) __PYX_ERR(0, 868, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":869 * X = SDL_CONTROLLER_BUTTON_X * Y = SDL_CONTROLLER_BUTTON_Y * SELECT = SDL_CONTROLLER_BUTTON_BACK # <<<<<<<<<<<<<< * START = SDL_CONTROLLER_BUTTON_START * LEFT_STICK = SDL_CONTROLLER_BUTTON_LEFTSTICK */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(SDL_CONTROLLER_BUTTON_BACK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SELECT, __pyx_t_4) < 0) __PYX_ERR(0, 869, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":870 * Y = SDL_CONTROLLER_BUTTON_Y * SELECT = SDL_CONTROLLER_BUTTON_BACK * START = SDL_CONTROLLER_BUTTON_START # <<<<<<<<<<<<<< * LEFT_STICK = SDL_CONTROLLER_BUTTON_LEFTSTICK * RIGHT_STICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(SDL_CONTROLLER_BUTTON_START); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_START, __pyx_t_4) < 0) __PYX_ERR(0, 870, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":871 * SELECT = SDL_CONTROLLER_BUTTON_BACK * START = SDL_CONTROLLER_BUTTON_START * LEFT_STICK = SDL_CONTROLLER_BUTTON_LEFTSTICK # <<<<<<<<<<<<<< * RIGHT_STICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK * LEFT_SHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(SDL_CONTROLLER_BUTTON_LEFTSTICK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LEFT_STICK, __pyx_t_4) < 0) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":872 * START = SDL_CONTROLLER_BUTTON_START * LEFT_STICK = SDL_CONTROLLER_BUTTON_LEFTSTICK * RIGHT_STICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK # <<<<<<<<<<<<<< * LEFT_SHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER * RIGHT_SHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(SDL_CONTROLLER_BUTTON_RIGHTSTICK); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_RIGHT_STICK, __pyx_t_4) < 0) __PYX_ERR(0, 872, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":873 * LEFT_STICK = SDL_CONTROLLER_BUTTON_LEFTSTICK * RIGHT_STICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK * LEFT_SHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER # <<<<<<<<<<<<<< * RIGHT_SHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER * */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(SDL_CONTROLLER_BUTTON_LEFTSHOULDER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_LEFT_SHOULDER, __pyx_t_4) < 0) __PYX_ERR(0, 873, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":874 * RIGHT_STICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK * LEFT_SHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER * RIGHT_SHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER # <<<<<<<<<<<<<< * * */ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(SDL_CONTROLLER_BUTTON_RIGHTSHOULDER); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_RIGHT_SHOULDER, __pyx_t_4) < 0) __PYX_ERR(0, 874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "pyxelen.pyx":864 * * * class ControllerButton(enum.IntEnum): # <<<<<<<<<<<<<< * A = SDL_CONTROLLER_BUTTON_A * B = SDL_CONTROLLER_BUTTON_B */ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ControllerButton, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ControllerButton, __pyx_t_4) < 0) __PYX_ERR(0, 864, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":878 * * HAT_TO_DIRECTION = { * SDL_HAT_LEFTUP: (-1, 1), SDL_HAT_UP: (0, 1), SDL_HAT_RIGHTUP: (1, 1), # <<<<<<<<<<<<<< * SDL_HAT_LEFT: (-1, 0), SDL_HAT_CENTERED: (0, 0), SDL_HAT_RIGHT: (1, 0), * SDL_HAT_LEFTDOWN: (-1, -1), SDL_HAT_DOWN: (0, -1), SDL_HAT_RIGHTDOWN: (1, -1), */ __pyx_t_1 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyInt_From_uint8_t(SDL_HAT_LEFTUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_tuple__17) < 0) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint8_t(SDL_HAT_UP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_tuple__18) < 0) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint8_t(SDL_HAT_RIGHTUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_tuple__19) < 0) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":879 * HAT_TO_DIRECTION = { * SDL_HAT_LEFTUP: (-1, 1), SDL_HAT_UP: (0, 1), SDL_HAT_RIGHTUP: (1, 1), * SDL_HAT_LEFT: (-1, 0), SDL_HAT_CENTERED: (0, 0), SDL_HAT_RIGHT: (1, 0), # <<<<<<<<<<<<<< * SDL_HAT_LEFTDOWN: (-1, -1), SDL_HAT_DOWN: (0, -1), SDL_HAT_RIGHTDOWN: (1, -1), * } */ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(SDL_HAT_LEFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_tuple__20) < 0) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint8_t(SDL_HAT_CENTERED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_tuple__21) < 0) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint8_t(SDL_HAT_RIGHT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_tuple__22) < 0) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":880 * SDL_HAT_LEFTUP: (-1, 1), SDL_HAT_UP: (0, 1), SDL_HAT_RIGHTUP: (1, 1), * SDL_HAT_LEFT: (-1, 0), SDL_HAT_CENTERED: (0, 0), SDL_HAT_RIGHT: (1, 0), * SDL_HAT_LEFTDOWN: (-1, -1), SDL_HAT_DOWN: (0, -1), SDL_HAT_RIGHTDOWN: (1, -1), # <<<<<<<<<<<<<< * } * */ __pyx_t_2 = __Pyx_PyInt_From_uint8_t(SDL_HAT_LEFTDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_tuple__23) < 0) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint8_t(SDL_HAT_DOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_tuple__24) < 0) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyInt_From_uint8_t(SDL_HAT_RIGHTDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_tuple__25) < 0) __PYX_ERR(0, 878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_HAT_TO_DIRECTION, __pyx_t_1) < 0) __PYX_ERR(0, 877, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":900 * * * class Audio: # <<<<<<<<<<<<<< * * def __init__(self): */ __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Audio, __pyx_n_s_Audio, (PyObject *) NULL, __pyx_n_s_pyxelen, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "pyxelen.pyx":902 * class Audio: * * def __init__(self): # <<<<<<<<<<<<<< * self.music_playing = False * */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_5Audio_1__init__, 0, __pyx_n_s_Audio___init, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 902, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":905 * self.music_playing = False * * def set_music_volume(self, int volume): # <<<<<<<<<<<<<< * Mix_VolumeMusic(volume) * */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_5Audio_3set_music_volume, 0, __pyx_n_s_Audio_set_music_volume, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_set_music_volume, __pyx_t_2) < 0) __PYX_ERR(0, 905, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":908 * Mix_VolumeMusic(volume) * * def play_music(self, Music music): # <<<<<<<<<<<<<< * self.stop_music() * Mix_PlayMusic(music.music, -1) */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_5Audio_5play_music, 0, __pyx_n_s_Audio_play_music, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_play_music, __pyx_t_2) < 0) __PYX_ERR(0, 908, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":913 * self.music_playing = True * * def stop_music(self): # <<<<<<<<<<<<<< * if self.music_playing: * self.music_playing = False */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_5Audio_7stop_music, 0, __pyx_n_s_Audio_stop_music, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_stop_music, __pyx_t_2) < 0) __PYX_ERR(0, 913, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":918 * Mix_HaltMusic() * * def play_effect(self, Effect effect, int volume): # <<<<<<<<<<<<<< * Mix_VolumeChunk(effect.chunk, volume) * Mix_PlayChannelTimed(-1, effect.chunk, 0, -1) */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_5Audio_9play_effect, 0, __pyx_n_s_Audio_play_effect, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_play_effect, __pyx_t_2) < 0) __PYX_ERR(0, 918, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":922 * Mix_PlayChannelTimed(-1, effect.chunk, 0, -1) * * def load_music(self, str filename): # <<<<<<<<<<<<<< * result = Music() * result.music = Mix_LoadMUS(filename.encode('utf-8')) */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_5Audio_11load_music, 0, __pyx_n_s_Audio_load_music, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_load_music, __pyx_t_2) < 0) __PYX_ERR(0, 922, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":927 * return result * * def load_effect(self, str filename): # <<<<<<<<<<<<<< * result = Effect() * result.chunk = Mix_LoadWAV_RW(SDL_RWFromFile(filename.encode('utf-8'), "rb"), 1) */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_5Audio_13load_effect, 0, __pyx_n_s_Audio_load_effect, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_load_effect, __pyx_t_2) < 0) __PYX_ERR(0, 927, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":900 * * * class Audio: # <<<<<<<<<<<<<< * * def __init__(self): */ __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Audio, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Audio, __pyx_t_2) < 0) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":933 * * * class KeyModifiers: # <<<<<<<<<<<<<< * * def __init__(self, ctrl, shift, alt): */ __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_KeyModifiers, __pyx_n_s_KeyModifiers, (PyObject *) NULL, __pyx_n_s_pyxelen, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "pyxelen.pyx":935 * class KeyModifiers: * * def __init__(self, ctrl, shift, alt): # <<<<<<<<<<<<<< * self.ctrl = ctrl * self.shift = shift */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_12KeyModifiers_1__init__, 0, __pyx_n_s_KeyModifiers___init, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 935, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":933 * * * class KeyModifiers: # <<<<<<<<<<<<<< * * def __init__(self, ctrl, shift, alt): */ __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_KeyModifiers, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_KeyModifiers, __pyx_t_2) < 0) __PYX_ERR(0, 933, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":941 * * * class Mouse: # <<<<<<<<<<<<<< * * def __init__(self, x, y, left, middle, right, button4, button5): */ __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Mouse, __pyx_n_s_Mouse, (PyObject *) NULL, __pyx_n_s_pyxelen, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "pyxelen.pyx":943 * class Mouse: * * def __init__(self, x, y, left, middle, right, button4, button5): # <<<<<<<<<<<<<< * self.x = x * self.y = y */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_5Mouse_1__init__, 0, __pyx_n_s_Mouse___init, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 943, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":941 * * * class Mouse: # <<<<<<<<<<<<<< * * def __init__(self, x, y, left, middle, right, button4, button5): */ __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Mouse, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Mouse, __pyx_t_2) < 0) __PYX_ERR(0, 941, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":953 * * * class Controls: # <<<<<<<<<<<<<< * * def __init__(self): */ __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Controls, __pyx_n_s_Controls, (PyObject *) NULL, __pyx_n_s_pyxelen, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "pyxelen.pyx":955 * class Controls: * * def __init__(self): # <<<<<<<<<<<<<< * self._controllers = [None for _ in range(16)] * */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_8Controls_1__init__, 0, __pyx_n_s_Controls___init, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":958 * self._controllers = [None for _ in range(16)] * * def find_controller(self, int instance): # <<<<<<<<<<<<<< * for i, c in enumerate(self._controllers): * if c == instance: */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_8Controls_3find_controller, 0, __pyx_n_s_Controls_find_controller, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 958, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_find_controller, __pyx_t_2) < 0) __PYX_ERR(0, 958, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":964 * raise RuntimeError('Device not found') * * def add_controller(self, int instance): # <<<<<<<<<<<<<< * for i, c in enumerate(self._controllers): * if c is None: */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_8Controls_5add_controller, 0, __pyx_n_s_Controls_add_controller, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_add_controller, __pyx_t_2) < 0) __PYX_ERR(0, 964, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":973 * raise RuntimeError('Cannot add a 17th controller') * * def remove_controller(self, int instance): # <<<<<<<<<<<<<< * for i, c in enumerate(self._controllers): * if c == instance: */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_8Controls_7remove_controller, 0, __pyx_n_s_Controls_remove_controller, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_remove_controller, __pyx_t_2) < 0) __PYX_ERR(0, 973, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":981 * * @property * def mouse(self): # <<<<<<<<<<<<<< * cdef int x = 0 * cdef int y = 0 */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_8Controls_9mouse, 0, __pyx_n_s_Controls_mouse, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "pyxelen.pyx":980 * raise RuntimeError('Device not found') * * @property # <<<<<<<<<<<<<< * def mouse(self): * cdef int x = 0 */ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_mouse, __pyx_t_3) < 0) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "pyxelen.pyx":995 * * @property * def key_modifiers(self): # <<<<<<<<<<<<<< * cdef uint16_t mod = SDL_GetModState() * return KeyModifiers( */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_8Controls_11key_modifiers, 0, __pyx_n_s_Controls_key_modifiers, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); /* "pyxelen.pyx":994 * ) * * @property # <<<<<<<<<<<<<< * def key_modifiers(self): * cdef uint16_t mod = SDL_GetModState() */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_key_modifiers, __pyx_t_2) < 0) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":953 * * * class Controls: # <<<<<<<<<<<<<< * * def __init__(self): */ __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Controls, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Controls, __pyx_t_2) < 0) __PYX_ERR(0, 953, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1123 * * * class Pyxelen: # <<<<<<<<<<<<<< * * def __init__(self): */ __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Pyxelen, __pyx_n_s_Pyxelen, (PyObject *) NULL, __pyx_n_s_pyxelen, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); /* "pyxelen.pyx":1125 * class Pyxelen: * * def __init__(self): # <<<<<<<<<<<<<< * self.audio = Audio() * self.controls = Controls() */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_7Pyxelen_1__init__, 0, __pyx_n_s_Pyxelen___init, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 1125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":1130 * self._windows = [] * * def open_window(self, str title, int width, int height): # <<<<<<<<<<<<<< * result = Window() * result.window = SDL_CreateWindow( */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_7Pyxelen_3open_window, 0, __pyx_n_s_Pyxelen_open_window, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_open_window, __pyx_t_2) < 0) __PYX_ERR(0, 1130, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":1141 * return result * * def close_window(self, Window window): # <<<<<<<<<<<<<< * self._windows = [w for w in self._windows if w is not window] * */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_7Pyxelen_5close_window, 0, __pyx_n_s_Pyxelen_close_window, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_close_window, __pyx_t_2) < 0) __PYX_ERR(0, 1141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":1144 * self._windows = [w for w in self._windows if w is not window] * * def _find_window(self, int window_id): # <<<<<<<<<<<<<< * return [ * w for w in self._windows */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_7Pyxelen_7_find_window, 0, __pyx_n_s_Pyxelen__find_window, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_find_window, __pyx_t_2) < 0) __PYX_ERR(0, 1144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":1150 * ][0] * * def run(self, event_handler, fps): # <<<<<<<<<<<<<< * cdef SDL_Event event * assert fps > 0, 'fps must be positive' */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyxelen_7Pyxelen_9run, 0, __pyx_n_s_Pyxelen_run, NULL, __pyx_n_s_pyxelen, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_run, __pyx_t_2) < 0) __PYX_ERR(0, 1150, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "pyxelen.pyx":1123 * * * class Pyxelen: # <<<<<<<<<<<<<< * * def __init__(self): */ __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Pyxelen, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Pyxelen, __pyx_t_2) < 0) __PYX_ERR(0, 1123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1393 * * * def get_error(): # <<<<<<<<<<<<<< * return SDL_GetError().decode('utf-8') * */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyxelen_1get_error, NULL, __pyx_n_s_pyxelen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_error, __pyx_t_1) < 0) __PYX_ERR(0, 1393, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1397 * * * def init(): # <<<<<<<<<<<<<< * assert SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER) == 0 * assert IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG) == (IMG_INIT_JPG | IMG_INIT_PNG) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyxelen_3init, NULL, __pyx_n_s_pyxelen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_2, __pyx_t_1) < 0) __PYX_ERR(0, 1397, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1404 * * * def quit(): # <<<<<<<<<<<<<< * Mix_CloseAudio() * Mix_Quit() */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyxelen_5quit, NULL, __pyx_n_s_pyxelen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_1) < 0) __PYX_ERR(0, 1404, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "pyxelen.pyx":1 * import enum # <<<<<<<<<<<<<< * import sys * import importlib */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init pyxelen", 0, __pyx_lineno, __pyx_filename); } Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init pyxelen"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro)) return tp->tp_getattro(obj, attr_name); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_getattr)) return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); #endif return PyObject_GetAttr(obj, attr_name); } #endif /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); if (unlikely(!result)) { PyErr_Format(PyExc_NameError, #if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); #else "name '%.200s' is not defined", PyString_AS_STRING(name)); #endif } return result; } /* PyObjectCall */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { PyObject *result; ternaryfunc call = func->ob_type->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare Py_XINCREF(type); if (!value || value == Py_None) value = NULL; else Py_INCREF(value); if (!tb || tb == Py_None) tb = NULL; else { Py_INCREF(tb); if (!PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } } if (PyType_Check(type)) { #if CYTHON_COMPILING_IN_PYPY if (!value) { Py_INCREF(Py_None); value = Py_None; } #endif PyErr_NormalizeException(&type, &value, &tb); } else { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } value = type; type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (PyExceptionClass_Check(type)) { PyObject *instance_class = NULL; if (value && PyExceptionInstance_Check(value)) { instance_class = (PyObject*) Py_TYPE(value); if (instance_class != type) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } if (!instance_class) { PyObject *args; if (!value) args = PyTuple_New(0); else if (PyTuple_Check(value)) { Py_INCREF(value); args = value; } else args = PyTuple_Pack(1, value); if (!args) goto bad; owned_instance = PyObject_Call(type, args, NULL); Py_DECREF(args); if (!owned_instance) goto bad; value = owned_instance; if (!PyExceptionInstance_Check(value)) { PyErr_Format(PyExc_TypeError, "calling %R should have returned an instance of " "BaseException, not %R", type, Py_TYPE(value)); goto bad; } } } else { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } if (cause) { PyObject *fixed_cause; if (cause == Py_None) { fixed_cause = NULL; } else if (PyExceptionClass_Check(cause)) { fixed_cause = PyObject_CallObject(cause, NULL); if (fixed_cause == NULL) goto bad; } else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; Py_INCREF(fixed_cause); } else { PyErr_SetString(PyExc_TypeError, "exception causes must derive from " "BaseException"); goto bad; } PyException_SetCause(value, fixed_cause); } PyErr_SetObject(type, value); if (tb) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_setattro)) return tp->tp_setattro(obj, attr_name, value); #if PY_MAJOR_VERSION < 3 if (likely(tp->tp_setattr)) return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value); #endif return PyObject_SetAttr(obj, attr_name, value); } #endif /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", func_name, more_or_less, num_expected, (num_expected == 1) ? "" : "s", num_found); } /* RaiseDoubleKeywords */ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AsString(kw_name)); #endif } /* ParseKeywords */ static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; continue; } name = first_kw_arg; #if PY_MAJOR_VERSION < 3 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { while (*name) { if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) && _PyString_Eq(**name, key)) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { if ((**argname == key) || ( (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) && _PyString_Eq(**argname, key))) { goto arg_passed_twice; } argname++; } } } else #endif if (likely(PyUnicode_Check(key))) { while (*name) { int cmp = (**name == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**name, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) { values[name-argnames] = value; break; } name++; } if (*name) continue; else { PyObject*** argname = argnames; while (argname != first_kw_arg) { int cmp = (**argname == key) ? 0 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : #endif PyUnicode_Compare(**argname, key); if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; if (cmp == 0) goto arg_passed_twice; argname++; } } } else goto invalid_keyword_type; if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%.200s() got an unexpected keyword argument '%.200s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); return 0; } /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { PyCFunctionObject *func = (PyCFunctionObject*)func_obj; PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); int flags = PyCFunction_GET_FLAGS(func); assert(PyCFunction_Check(func)); assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))); assert(nargs >= 0); assert(nargs == 0 || args != NULL); /* _PyCFunction_FastCallDict() must not be called with an exception set, because it may clear it (directly or indirectly) and so the caller loses its exception */ assert(!PyErr_Occurred()); if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL); } else { return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs); } } #endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL #include "frameobject.h" static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = f->f_localsplus; for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { return NULL; } if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif if (likely(PyCFunction_Check(func))) { if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { return __Pyx_PyCFunction_FastCall(func, &arg, 1); #endif } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) { #else if (likely(PyCFunction_Check(func))) { #endif if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif /* UnpackUnboundCMethod */ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { PyObject *method; method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); if (unlikely(!method)) return -1; target->method = method; #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; target->func = descr->d_method->ml_meth; target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST); } #endif return 0; } /* CallUnboundCMethod1 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { if (likely(cfunc->func)) { int flag = cfunc->flag; if (flag == METH_O) { return (*(cfunc->func))(self, arg); } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) { if (PY_VERSION_HEX >= 0x030700A0) { return (*(__Pyx_PyCFunctionFast)cfunc->func)(self, &arg, 1); } else { return (*(__Pyx_PyCFunctionFastWithKeywords)cfunc->func)(self, &arg, 1, NULL); } } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) { return (*(__Pyx_PyCFunctionFastWithKeywords)cfunc->func)(self, &arg, 1, NULL); } } return __Pyx__CallUnboundCMethod1(cfunc, self, arg); } #endif static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(1); if (unlikely(!args)) goto bad; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(2, self, arg); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) { #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a + b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif /* GetModuleGlobalName */ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); if (likely(result)) { Py_INCREF(result); } else if (unlikely(PyErr_Occurred())) { result = NULL; } else { #else result = PyDict_GetItem(__pyx_d, name); if (likely(result)) { Py_INCREF(result); } else { #endif #else result = PyObject_GetItem(__pyx_d, name); if (!result) { PyErr_Clear(); #endif result = __Pyx_GetBuiltinName(name); } return result; } /* RaiseTooManyValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); } /* RaiseNeedMoreValuesToUnpack */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", index, (index == 1) ? "" : "s"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) { PyObject *exc_value, *exc_tb; exc_value = tstate->curexc_value; exc_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; Py_DECREF(exc_type); Py_XDECREF(exc_value); Py_XDECREF(exc_tb); return 0; } else { return -1; } } return 0; #else if (unlikely(PyErr_Occurred())) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { PyErr_Clear(); return 0; } else { return -1; } } return 0; #endif } /* UnpackItemEndCheck */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { if (unlikely(retval)) { Py_DECREF(retval); __Pyx_RaiseTooManyValuesError(expected); return -1; } else { return __Pyx_IterFinish(); } return 0; } /* PyObjectCallMethod1 */ static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = NULL; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(method))) { PyObject *self = PyMethod_GET_SELF(method); if (likely(self)) { PyObject *args; PyObject *function = PyMethod_GET_FUNCTION(method); #if CYTHON_FAST_PYCALL if (PyFunction_Check(function)) { PyObject *args[2] = {self, arg}; result = __Pyx_PyFunction_FastCall(function, args, 2); goto done; } #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(function)) { PyObject *args[2] = {self, arg}; result = __Pyx_PyCFunction_FastCall(function, args, 2); goto done; } #endif args = PyTuple_New(2); if (unlikely(!args)) goto done; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); Py_INCREF(function); result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); return result; } } #endif result = __Pyx_PyObject_CallOneArg(method, arg); goto done; done: return result; } static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method, *result; method = __Pyx_PyObject_GetAttrStr(obj, method_name); if (unlikely(!method)) return NULL; result = __Pyx__PyObject_CallMethod1(method, arg); Py_DECREF(method); return result; } /* append */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1; } else { PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x); if (unlikely(!retval)) return -1; Py_DECREF(retval); } return 0; } /* GetItemInt */ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); Py_INCREF(r); return r; } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); #else return PySequence_GetItem(o, i); #endif } static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { PyObject *r = PyList_GET_ITEM(o, n); Py_INCREF(r); return r; } } else if (PyTuple_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, n); Py_INCREF(r); return r; } } else { PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; if (likely(m && m->sq_item)) { if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { Py_ssize_t l = m->sq_length(o); if (likely(l >= 0)) { i += l; } else { if (!PyErr_ExceptionMatches(PyExc_OverflowError)) return NULL; PyErr_Clear(); } } return m->sq_item(o, i); } } #else if (is_list || PySequence_Check(o)) { return PySequence_GetItem(o, i); } #endif return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #if PY_MAJOR_VERSION >= 3 if (likely(PyUnicode_Check(n))) #else if (likely(PyString_Check(n))) #endif return __Pyx_PyObject_GetAttrStr(o, n); #endif return PyObject_GetAttr(o, n); } /* HasAttr */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (unlikely(!r)) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if PY_VERSION_HEX >= 0x030700A2 *type = tstate->exc_state.exc_type; *value = tstate->exc_state.exc_value; *tb = tstate->exc_state.exc_traceback; #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; #endif Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if PY_VERSION_HEX >= 0x030700A2 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; tstate->exc_state.exc_type = type; tstate->exc_state.exc_value = value; tstate->exc_state.exc_traceback = tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i<n; i++) { if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1; } #endif for (i=0; i<n; i++) { if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1; } return 0; } static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) { PyObject *exc_type = tstate->curexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; if (unlikely(PyTuple_Check(err))) return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { #endif PyObject *local_type, *local_value, *local_tb; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; #else PyErr_Fetch(&local_type, &local_value, &local_tb); #endif PyErr_NormalizeException(&local_type, &local_value, &local_tb); #if CYTHON_FAST_THREAD_STATE if (unlikely(tstate->curexc_type)) #else if (unlikely(PyErr_Occurred())) #endif goto bad; #if PY_MAJOR_VERSION >= 3 if (local_tb) { if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; } #endif Py_XINCREF(local_tb); Py_XINCREF(local_type); Py_XINCREF(local_value); *type = local_type; *value = local_value; *tb = local_tb; #if CYTHON_FAST_THREAD_STATE #if PY_VERSION_HEX >= 0x030700A2 tmp_type = tstate->exc_state.exc_type; tmp_value = tstate->exc_state.exc_value; tmp_tb = tstate->exc_state.exc_traceback; tstate->exc_state.exc_type = local_type; tstate->exc_state.exc_value = local_value; tstate->exc_state.exc_traceback = local_tb; #else tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); #else PyErr_SetExcInfo(local_type, local_value, local_tb); #endif return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } /* decode_c_string */ static CYTHON_INLINE PyObject* __Pyx_decode_c_string( const char* cstring, Py_ssize_t start, Py_ssize_t stop, const char* encoding, const char* errors, PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) { Py_ssize_t length; if (unlikely((start < 0) | (stop < 0))) { size_t slen = strlen(cstring); if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) { PyErr_SetString(PyExc_OverflowError, "c-string too long to convert to Python"); return NULL; } length = (Py_ssize_t) slen; if (start < 0) { start += length; if (start < 0) start = 0; } if (stop < 0) stop += length; } length = stop - start; if (unlikely(length <= 0)) return PyUnicode_FromUnicode(NULL, 0); cstring += start; if (decode_func) { return decode_func(cstring, length, errors); } else { return PyUnicode_Decode(cstring, length, encoding, errors); } } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'%.50s' object has no attribute '%U'", tp->tp_name, attr_name); #else "'%.50s' object has no attribute '%.400s'", tp->tp_name, PyString_AS_STRING(attr_name)); #endif return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; #if CYTHON_USE_PYTYPE_LOOKUP if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD; #else if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD; #endif #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD; ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD; setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD; ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD; } PyType_Modified((PyTypeObject*)type_obj); } } goto GOOD; BAD: if (!PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); ret = -1; GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } /* Import */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; #if PY_MAJOR_VERSION < 3 PyObject *py_import; py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); if (!py_import) goto bad; #endif if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; { #if PY_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* CalculateMetaclass */ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); for (i=0; i < nbases; i++) { PyTypeObject *tmptype; PyObject *tmp = PyTuple_GET_ITEM(bases, i); tmptype = Py_TYPE(tmp); #if PY_MAJOR_VERSION < 3 if (tmptype == &PyClass_Type) continue; #endif if (!metaclass) { metaclass = tmptype; continue; } if (PyType_IsSubtype(metaclass, tmptype)) continue; if (PyType_IsSubtype(tmptype, metaclass)) { metaclass = tmptype; continue; } PyErr_SetString(PyExc_TypeError, "metaclass conflict: " "the metaclass of a derived class " "must be a (non-strict) subclass " "of the metaclasses of all its bases"); return NULL; } if (!metaclass) { #if PY_MAJOR_VERSION < 3 metaclass = &PyClass_Type; #else metaclass = &PyType_Type; #endif } Py_INCREF((PyObject*) metaclass); return (PyObject*) metaclass; } /* Py3ClassCreate */ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { PyObject *ns; if (metaclass) { PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); if (prep) { PyObject *pargs = PyTuple_Pack(2, name, bases); if (unlikely(!pargs)) { Py_DECREF(prep); return NULL; } ns = PyObject_Call(prep, pargs, mkw); Py_DECREF(prep); Py_DECREF(pargs); } else { if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; PyErr_Clear(); ns = PyDict_New(); } } else { ns = PyDict_New(); } if (unlikely(!ns)) return NULL; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; return ns; bad: Py_DECREF(ns); return NULL; } static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass) { PyObject *result, *margs; PyObject *owned_metaclass = NULL; if (allow_py2_metaclass) { owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); if (owned_metaclass) { metaclass = owned_metaclass; } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { PyErr_Clear(); } else { return NULL; } } if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); Py_XDECREF(owned_metaclass); if (unlikely(!metaclass)) return NULL; owned_metaclass = metaclass; } margs = PyTuple_Pack(3, name, bases, dict); if (unlikely(!margs)) { result = NULL; } else { result = PyObject_Call(metaclass, margs, mkw); Py_DECREF(margs); } Py_XDECREF(owned_metaclass); return result; } /* FetchCommonType */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { PyObject* fake_module; PyTypeObject* cached_type = NULL; fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); if (!fake_module) return NULL; Py_INCREF(fake_module); cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); if (cached_type) { if (!PyType_Check((PyObject*)cached_type)) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s is not a type object", type->tp_name); goto bad; } if (cached_type->tp_basicsize != type->tp_basicsize) { PyErr_Format(PyExc_TypeError, "Shared Cython type %.200s has the wrong size, try recompiling", type->tp_name); goto bad; } } else { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; PyErr_Clear(); if (PyType_Ready(type) < 0) goto bad; if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) goto bad; Py_INCREF(type); cached_type = type; } done: Py_DECREF(fake_module); return cached_type; bad: Py_XDECREF(cached_type); cached_type = NULL; goto done; } /* CythonFunction */ #include <structmember.h> static PyObject * __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) { if (unlikely(op->func_doc == NULL)) { if (op->func.m_ml->ml_doc) { #if PY_MAJOR_VERSION >= 3 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); #else op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); #endif if (unlikely(op->func_doc == NULL)) return NULL; } else { Py_INCREF(Py_None); return Py_None; } } Py_INCREF(op->func_doc); return op->func_doc; } static int __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) { if (unlikely(op->func_name == NULL)) { #if PY_MAJOR_VERSION >= 3 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); #else op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); #endif if (unlikely(op->func_name == NULL)) return NULL; } Py_INCREF(op->func_name); return op->func_name; } static int __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__name__ must be set to a string object"); return -1; } tmp = op->func_name; Py_INCREF(value); op->func_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; #if PY_MAJOR_VERSION >= 3 if (unlikely(value == NULL || !PyUnicode_Check(value))) { #else if (unlikely(value == NULL || !PyString_Check(value))) { #endif PyErr_SetString(PyExc_TypeError, "__qualname__ must be set to a string object"); return -1; } tmp = op->func_qualname; Py_INCREF(value); op->func_qualname = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) { PyObject *self; self = m->func_closure; if (self == NULL) self = Py_None; Py_INCREF(self); return self; } static PyObject * __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) { if (unlikely(op->func_dict == NULL)) { op->func_dict = PyDict_New(); if (unlikely(op->func_dict == NULL)) return NULL; } Py_INCREF(op->func_dict); return op->func_dict; } static int __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) { PyObject *tmp; if (unlikely(value == NULL)) { PyErr_SetString(PyExc_TypeError, "function's dictionary may not be deleted"); return -1; } if (unlikely(!PyDict_Check(value))) { PyErr_SetString(PyExc_TypeError, "setting function's dictionary to a non-dict"); return -1; } tmp = op->func_dict; Py_INCREF(value); op->func_dict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS op->defaults_tuple = PyTuple_GET_ITEM(res, 0); Py_INCREF(op->defaults_tuple); op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); Py_INCREF(op->defaults_kwdict); #else op->defaults_tuple = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "__defaults__ must be set to a tuple object"); return -1; } Py_INCREF(value); tmp = op->defaults_tuple; op->defaults_tuple = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_tuple; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_tuple; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value) { value = Py_None; } else if (value != Py_None && !PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__kwdefaults__ must be set to a dict object"); return -1; } Py_INCREF(value); tmp = op->defaults_kwdict; op->defaults_kwdict = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { PyObject* result = op->defaults_kwdict; if (unlikely(!result)) { if (op->defaults_getter) { if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; result = op->defaults_kwdict; } else { result = Py_None; } } Py_INCREF(result); return result; } static int __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { PyObject* tmp; if (!value || value == Py_None) { value = NULL; } else if (!PyDict_Check(value)) { PyErr_SetString(PyExc_TypeError, "__annotations__ must be set to a dict object"); return -1; } Py_XINCREF(value); tmp = op->func_annotations; op->func_annotations = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { PyObject* result = op->func_annotations; if (unlikely(!result)) { result = PyDict_New(); if (unlikely(!result)) return NULL; op->func_annotations = result; } Py_INCREF(result); return result; } static PyGetSetDef __pyx_CyFunction_getsets[] = { {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, {0, 0, 0, 0, 0} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0}, {0, 0, 0, 0, 0} }; static PyObject * __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromString(m->func.m_ml->ml_name); #else return PyString_FromString(m->func.m_ml->ml_name); #endif } static PyMethodDef __pyx_CyFunction_methods[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); if (op == NULL) return NULL; op->flags = flags; __Pyx_CyFunction_weakreflist(op) = NULL; op->func.m_ml = ml; op->func.m_self = (PyObject *) op; Py_XINCREF(closure); op->func_closure = closure; Py_XINCREF(module); op->func.m_module = module; op->func_dict = NULL; op->func_name = NULL; Py_INCREF(qualname); op->func_qualname = qualname; op->func_doc = NULL; op->func_classobj = NULL; op->func_globals = globals; Py_INCREF(op->func_globals); Py_XINCREF(code); op->func_code = code; op->defaults_pyobjects = 0; op->defaults = NULL; op->defaults_tuple = NULL; op->defaults_kwdict = NULL; op->defaults_getter = NULL; op->func_annotations = NULL; PyObject_GC_Track(op); return (PyObject *) op; } static int __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) { Py_CLEAR(m->func_closure); Py_CLEAR(m->func.m_module); Py_CLEAR(m->func_dict); Py_CLEAR(m->func_name); Py_CLEAR(m->func_qualname); Py_CLEAR(m->func_doc); Py_CLEAR(m->func_globals); Py_CLEAR(m->func_code); Py_CLEAR(m->func_classobj); Py_CLEAR(m->defaults_tuple); Py_CLEAR(m->defaults_kwdict); Py_CLEAR(m->func_annotations); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_XDECREF(pydefaults[i]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(m); } static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) { Py_VISIT(m->func_closure); Py_VISIT(m->func.m_module); Py_VISIT(m->func_dict); Py_VISIT(m->func_name); Py_VISIT(m->func_qualname); Py_VISIT(m->func_doc); Py_VISIT(m->func_globals); Py_VISIT(m->func_code); Py_VISIT(m->func_classobj); Py_VISIT(m->defaults_tuple); Py_VISIT(m->defaults_kwdict); if (m->defaults) { PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); int i; for (i = 0; i < m->defaults_pyobjects; i++) Py_VISIT(pydefaults[i]); } return 0; } static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { Py_INCREF(func); return func; } if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { if (type == NULL) type = (PyObject *)(Py_TYPE(obj)); return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return __Pyx_PyMethod_New(func, obj, type); } static PyObject* __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) { #if PY_MAJOR_VERSION >= 3 return PyUnicode_FromFormat("<cyfunction %U at %p>", op->func_qualname, (void *)op); #else return PyString_FromFormat("<cyfunction %s at %p>", PyString_AsString(op->func_qualname), (void *)op); #endif } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; Py_ssize_t size; switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; case METH_O: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)", f->m_ml->ml_name, size); return NULL; } break; default: PyErr_SetString(PyExc_SystemError, "Bad call flags in " "__Pyx_CyFunction_Call. METH_OLDARGS is no " "longer supported!"); return NULL; } PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", f->m_ml->ml_name); return NULL; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; argc = PyTuple_GET_SIZE(args); new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif }; static int __pyx_CyFunction_init(void) { __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (unlikely(__pyx_CyFunctionType == NULL)) { return -1; } return 0; } static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults = PyObject_Malloc(size); if (unlikely(!m->defaults)) return PyErr_NoMemory(); memset(m->defaults, 0, size); m->defaults_pyobjects = pyobjects; return m->defaults; } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_tuple = tuple; Py_INCREF(tuple); } static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->defaults_kwdict = dict; Py_INCREF(dict); } static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; m->func_annotations = dict; Py_INCREF(dict); } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback); } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (PyObject_Not(use_cline) != 0) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { return count; } while (start < end) { mid = start + (end - start) / 2; if (code_line < entries[mid].code_line) { end = mid; } else if (code_line > entries[mid].code_line) { start = mid + 1; } else { return mid; } } if (code_line <= entries[mid].code_line) { return mid; } else { return mid + 1; } } static PyCodeObject *__pyx_find_code_object(int code_line) { PyCodeObject* code_object; int pos; if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { return NULL; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { return NULL; } code_object = __pyx_code_cache.entries[pos].code_object; Py_INCREF(code_object); return code_object; } static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { int pos, i; __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = 64; __pyx_code_cache.count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { PyCodeObject* tmp = entries[pos].code_object; entries[pos].code_object = code_object; Py_DECREF(tmp); return; } if (__pyx_code_cache.count == __pyx_code_cache.max_count) { int new_max = __pyx_code_cache.max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } __pyx_code_cache.entries = entries; __pyx_code_cache.max_count = new_max; } for (i=__pyx_code_cache.count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; __pyx_code_cache.count++; Py_INCREF(code_object); } /* AddTraceback */ #include "compile.h" #include "frameobject.h" #include "traceback.h" static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyObject *py_srcfile = 0; PyObject *py_funcname = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(filename); #else py_srcfile = PyUnicode_FromString(filename); #endif if (!py_srcfile) goto bad; if (c_line) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_code = __Pyx_PyCode_New( 0, 0, 0, 0, 0, __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ py_line, __pyx_empty_bytes /*PyObject *lnotab*/ ); Py_DECREF(py_srcfile); Py_DECREF(py_funcname); return py_code; bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } py_code = __pyx_find_code_object(c_line ? -c_line : py_line); if (!py_code) { py_code = __Pyx_CreateCodeObjectForTraceback( funcname, c_line, py_line, filename); if (!py_code) goto bad; __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); } py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint8_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint8_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint8_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) { const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int32_t), little, !is_unsigned); } } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(int) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(int) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(int) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(int), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(uint32_t), little, !is_unsigned); } } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { return PyInt_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* Print */ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 static PyObject *__Pyx_GetStdout(void) { PyObject *f = PySys_GetObject((char *)"stdout"); if (!f) { PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); } return f; } static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { int i; if (!f) { if (!(f = __Pyx_GetStdout())) return -1; } Py_INCREF(f); for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { PyObject* v; if (PyFile_SoftSpace(f, 1)) { if (PyFile_WriteString(" ", f) < 0) goto error; } v = PyTuple_GET_ITEM(arg_tuple, i); if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) goto error; if (PyString_Check(v)) { char *s = PyString_AsString(v); Py_ssize_t len = PyString_Size(v); if (len > 0) { switch (s[len-1]) { case ' ': break; case '\f': case '\r': case '\n': case '\t': case '\v': PyFile_SoftSpace(f, 0); break; default: break; } } } } if (newline) { if (PyFile_WriteString("\n", f) < 0) goto error; PyFile_SoftSpace(f, 0); } Py_DECREF(f); return 0; error: Py_DECREF(f); return -1; } #else static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { PyObject* kwargs = 0; PyObject* result = 0; PyObject* end_string; if (unlikely(!__pyx_print)) { __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); if (!__pyx_print) return -1; } if (stream) { kwargs = PyDict_New(); if (unlikely(!kwargs)) return -1; if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) goto bad; if (!newline) { end_string = PyUnicode_FromStringAndSize(" ", 1); if (unlikely(!end_string)) goto bad; if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { Py_DECREF(end_string); goto bad; } Py_DECREF(end_string); } } else if (!newline) { if (unlikely(!__pyx_print_kwargs)) { __pyx_print_kwargs = PyDict_New(); if (unlikely(!__pyx_print_kwargs)) return -1; end_string = PyUnicode_FromStringAndSize(" ", 1); if (unlikely(!end_string)) return -1; if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { Py_DECREF(end_string); return -1; } Py_DECREF(end_string); } kwargs = __pyx_print_kwargs; } result = PyObject_Call(__pyx_print, arg_tuple, kwargs); if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) Py_DECREF(kwargs); if (!result) return -1; Py_DECREF(result); return 0; bad: if (kwargs != __pyx_print_kwargs) Py_XDECREF(kwargs); return -1; } #endif /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) -1, const_zero = (int) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(int) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else int val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (int) -1; } } else { int val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) -1, const_zero = (long) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(long) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else long val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (long) -1; } } else { long val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) { const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint8_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint8_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint8_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint8_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, digits[0]) case 2: if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT) { return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 3: if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT) { return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; case 4: if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT) { return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint8_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint8_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint8_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint8_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint8_t, digit, +digits[0]) case -2: if (8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint8_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint8_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint8_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT) { return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]))); } } break; } #endif if (sizeof(uint8_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint8_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint8_t) -1; } } else { uint8_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint8_t) -1; val = __Pyx_PyInt_As_uint8_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint8_t"); return (uint8_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint8_t"); return (uint8_t) -1; } /* CIntFromPy */ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0; const int is_unsigned = neg_one > const_zero; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x))) { if (sizeof(uint32_t) < sizeof(long)) { __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (uint32_t) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0]) case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) { return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) { return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) { return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (uint32_t) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(uint32_t) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (uint32_t) 0; case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, +digits[0]) case -2: if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 2: if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -3: if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 3: if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case -4: if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; case 4: if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) { return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]))); } } break; } #endif if (sizeof(uint32_t) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) PyErr_SetString(PyExc_RuntimeError, "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); #else uint32_t val; PyObject *v = __Pyx_PyNumber_IntOrLong(x); #if PY_MAJOR_VERSION < 3 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } #endif return (uint32_t) -1; } } else { uint32_t val; PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); if (!tmp) return (uint32_t) -1; val = __Pyx_PyInt_As_uint32_t(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to uint32_t"); return (uint32_t) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to uint32_t"); return (uint32_t) -1; } /* PrintOne */ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 static int __Pyx_PrintOne(PyObject* f, PyObject *o) { if (!f) { if (!(f = __Pyx_GetStdout())) return -1; } Py_INCREF(f); if (PyFile_SoftSpace(f, 0)) { if (PyFile_WriteString(" ", f) < 0) goto error; } if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) goto error; if (PyFile_WriteString("\n", f) < 0) goto error; Py_DECREF(f); return 0; error: Py_DECREF(f); return -1; /* the line below is just to avoid C compiler * warnings about unused functions */ return __Pyx_Print(f, NULL, 0); } #else static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { int res; PyObject* arg_tuple = PyTuple_Pack(1, o); if (unlikely(!arg_tuple)) return -1; res = __Pyx_Print(stream, arg_tuple, 1); Py_DECREF(arg_tuple); return res; } #endif /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = a->tp_base; if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; if (!res) { res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } return res; } #endif static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) { if (likely(err == exc_type)) return 1; if (likely(PyExceptionClass_Check(err))) { return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type); } return PyErr_GivenExceptionMatches(err, exc_type); } static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) { if (likely(err == exc_type1 || err == exc_type2)) return 1; if (likely(PyExceptionClass_Check(err))) { return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2); } return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2)); } #endif /* CheckBinaryVersion */ static int __Pyx_check_binary_version(void) { char ctversion[4], rtversion[4]; PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { char message[200]; PyOS_snprintf(message, sizeof(message), "compiletime version %s of module '%.100s' " "does not match runtime version %s", ctversion, __Pyx_MODULE_NAME, rtversion); return PyErr_WarnEx(NULL, message, 1); } return 0; } /* InitStrings */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; if (PyObject_Hash(*t->p) == -1) return -1; ++t; } return 0; } static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); } static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { char* defenc_c; PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); if (!defenc) return NULL; defenc_c = PyBytes_AS_STRING(defenc); #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII { char* end = defenc_c + PyBytes_GET_SIZE(defenc); char* c; for (c = defenc_c; c < end; c++) { if ((unsigned char) (*c) >= 128) { PyUnicode_AsASCIIString(o); return NULL; } } } #endif *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT if ( #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII __Pyx_sys_getdefaultencoding_not_ascii && #endif PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #endif { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); if (unlikely(r < 0)) { return NULL; } else { return result; } } } static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type %.200s). " "The ability to return an instance of a strict subclass of int " "is deprecated, and may be removed in a future version of Python.", Py_TYPE(result)->tp_name)) { Py_DECREF(result); return NULL; } return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", type_name, type_name, Py_TYPE(result)->tp_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(b))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(x); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */
0.867188
1
Code/Framework/AzToolsFramework/AzToolsFramework/PythonTerminal/ScriptTermDialog.h
cypherdotXd/o3de
11
7997355
/* * Copyright (c) Contributors to the Open 3D Engine Project. * For complete copyright and license terms please see the LICENSE at the root of this distribution. * * SPDX-License-Identifier: Apache-2.0 OR MIT * */ // Description : Dialog for python script terminal #ifndef CRYINCLUDE_EDITOR_SCRIPTTERMDIALOG_H #define CRYINCLUDE_EDITOR_SCRIPTTERMDIALOG_H #pragma once #if !defined(Q_MOC_RUN) #include <AzToolsFramework/API/EditorPythonConsoleBus.h> #include <AzToolsFramework/PythonTerminal/ScriptTermDialog.h> #include <AzToolsFramework/Editor/EditorSettingsAPIBus.h> #include <QWidget> #include <QColor> #include <QScopedPointer> #endif #define SCRIPT_TERM_WINDOW_NAME "Python Console" class QStringListModel; namespace Ui { class CScriptTermDialog; } namespace AzToolsFramework { class CScriptTermDialog : public QWidget , protected EditorPythonConsoleNotificationBus::Handler , protected EditorPreferencesNotificationBus::Handler { Q_OBJECT public: explicit CScriptTermDialog(QWidget* parent = nullptr); ~CScriptTermDialog(); void AppendText(const char* pText); static void RegisterViewClass(); protected: bool eventFilter(QObject* obj, QEvent* e) override; //! EditorPythonConsoleNotificationBus::Handler void OnTraceMessage(AZStd::string_view message) override; void OnErrorMessage(AZStd::string_view message) override; void OnExceptionMessage(AZStd::string_view message) override; //! EditorPreferencesNotificationBus void OnEditorPreferencesChanged() override; private slots: void OnScriptHelp(); void OnOK(); void OnScriptInputTextChanged(const QString& text); private: void RefreshStyle(); void InitCompleter(); void ExecuteAndPrint(const char* cmd); void AppendToConsole(const QString& string, const QColor& color, bool bold = false); QScopedPointer<Ui::CScriptTermDialog> ui; QStringListModel* m_completionModel; QStringListModel* m_lastCommandModel; QStringList m_lastCommands; QColor m_textColor; QColor m_warningColor; QColor m_errorColor; int m_upArrowLastCommandIndex = -1; }; } // namespace AzToolsFramework #endif // CRYINCLUDE_EDITOR_SCRIPTTERMDIALOG_H
1.367188
1
CSE_102_Practice_Online/04- 11/Practice 2b.c
ishtiaqniloy/BUET-CSE-102
0
7997363
int testPowTwo(int x); int main(){ int a,b,i; scanf("%d %d",&a,&b); for(i=a;i<=b;i++){ if(testPowTwo(i)==1){ printf("%d\n",i); } } return main(); } int testPowTwo(int x){ int result=0,test; for(test=2; test<=x;test*=2){ if(test==x){ result=1; break; } } return result; }
1.945313
2
usr/src/lib/libc/port/gen/getnetgrent.c
AsahiOS/gate
0
7997371
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" /* * getnetgrent.c * * - name-service switch frontend routines for the netgroup API. * * Policy decision: * If netgroup A refers to netgroup B, both must occur in the same * source (any other choice gives very confusing semantics). This * assumption is deeply embedded in the code below and in the backends. * * innetgr() is implemented on top of something called __multi_innetgr(), * which replaces each (char *) argument of innetgr() with a counted vector * of (char *). The semantics are the same as an OR of the results of * innetgr() operations on each possible 4-tuple picked from the arguments, * but it's possible to implement some cases more efficiently. This is * important for mountd, which used to read YP netgroup.byhost directly in * order to determine efficiently whether a given host belonged to any one * of a long list of netgroups. Wildcarded arguments are indicated by a * count of zero. */ #include "lint.h" #include <string.h> #include <synch.h> #include <nss_dbdefs.h> #include <mtlib.h> #include <libc.h> static DEFINE_NSS_DB_ROOT(db_root); void _nss_initf_netgroup(p) nss_db_params_t *p; { p->name = NSS_DBNAM_NETGROUP; p->default_config = NSS_DEFCONF_NETGROUP; } /* * The netgroup routines aren't quite like the majority of the switch clients. * innetgr() more-or-less fits the getXXXbyYYY mould, but for the others: * - setnetgrent("netgroup") is really a getXXXbyYYY routine, i.e. it * searches the sources until it finds an entry with the given name. * Rather than returning the (potentially large) entry, it simply * initializes a cursor, and then... * - getnetgrent(...) is repeatedly invoked by the user to extract the * contents of the entry found by setnetgrent(). * - endnetgrent() is almost like a real endXXXent routine. * The behaviour in NSS was: * If we were certain that all the backends could provide netgroup information * in a common form, we could make the setnetgrent() backend return the entire * entry to the frontend, then implement getnetgrent() and endnetgrent() * strictly in the frontend (aka here). But we're not certain, so we won't. * In NSS2: * Since nscd returns the results, and it is nscd that accumulates * the results, then we can return the entire result on the setnetgrent. * * NOTE: * In the SunOS 4.x (YP) version of this code, innetgr() did not * affect the state of {set,get,end}netgrent(). Somewhere out * there probably lurks a program that depends on this behaviour, * so this version (both frontend and backends) had better * behave the same way. */ /* ===> ?? fix "__" name */ int __multi_innetgr(ngroup, pgroup, nhost, phost, nuser, puser, ndomain, pdomain) nss_innetgr_argc ngroup, nhost, nuser, ndomain; nss_innetgr_argv pgroup, phost, puser, pdomain; { struct nss_innetgr_args ia; if (ngroup == 0) { return (0); /* One thing fewer to worry backends */ } ia.groups.argc = ngroup; ia.groups.argv = pgroup; ia.arg[NSS_NETGR_MACHINE].argc = nhost; ia.arg[NSS_NETGR_MACHINE].argv = phost; ia.arg[NSS_NETGR_USER].argc = nuser; ia.arg[NSS_NETGR_USER].argv = puser; ia.arg[NSS_NETGR_DOMAIN].argc = ndomain; ia.arg[NSS_NETGR_DOMAIN].argv = pdomain; ia.status = NSS_NETGR_NO; (void) nss_search(&db_root, _nss_initf_netgroup, NSS_DBOP_NETGROUP_IN, &ia); return (ia.status == NSS_NETGR_FOUND); } int innetgr(group, host, user, domain) const char *group, *host, *user, *domain; { #define IA(charp) \ (nss_innetgr_argc)((charp) != 0), (nss_innetgr_argv)(&(charp)) return (__multi_innetgr(IA(group), IA(host), IA(user), IA(domain))); } /* * Context for setnetgrent()/getnetgrent(). If the user is being sensible * the requests will be serialized anyway, but let's play safe and * serialize them ourselves (anything to prevent a coredump)... * We can't use lmutex_lock() here because we don't know what the backends * that we call may call in turn. They might call malloc()/free(). * So we use the brute-force callout_lock_enter() instead. */ static nss_backend_t *getnetgrent_backend; int setnetgrent(const char *netgroup) { nss_backend_t *be; if (netgroup == NULL) { /* Prevent coredump, otherwise don't do anything profound */ netgroup = ""; } callout_lock_enter(); be = getnetgrent_backend; if (be != NULL && NSS_INVOKE_DBOP(be, NSS_DBOP_SETENT, (void *)netgroup) != NSS_SUCCESS) { (void) NSS_INVOKE_DBOP(be, NSS_DBOP_DESTRUCTOR, 0); be = NULL; } if (be == NULL) { struct nss_setnetgrent_args args; args.netgroup = netgroup; args.iterator = 0; (void) nss_search(&db_root, _nss_initf_netgroup, NSS_DBOP_NETGROUP_SET, &args); be = args.iterator; } getnetgrent_backend = be; callout_lock_exit(); return (0); } int getnetgrent_r(machinep, namep, domainp, buffer, buflen) char **machinep; char **namep; char **domainp; char *buffer; int buflen; { struct nss_getnetgrent_args args; args.buffer = buffer; args.buflen = buflen; args.status = NSS_NETGR_NO; callout_lock_enter(); if (getnetgrent_backend != 0) { (void) NSS_INVOKE_DBOP(getnetgrent_backend, NSS_DBOP_GETENT, &args); } callout_lock_exit(); if (args.status == NSS_NETGR_FOUND) { *machinep = args.retp[NSS_NETGR_MACHINE]; *namep = args.retp[NSS_NETGR_USER]; *domainp = args.retp[NSS_NETGR_DOMAIN]; return (1); } else { return (0); } } static nss_XbyY_buf_t *buf; int getnetgrent(machinep, namep, domainp) char **machinep; char **namep; char **domainp; { (void) NSS_XbyY_ALLOC(&buf, 0, NSS_BUFLEN_NETGROUP); return (getnetgrent_r(machinep, namep, domainp, buf->buffer, buf->buflen)); } int endnetgrent() { callout_lock_enter(); if (getnetgrent_backend != 0) { (void) NSS_INVOKE_DBOP(getnetgrent_backend, NSS_DBOP_DESTRUCTOR, 0); getnetgrent_backend = 0; } callout_lock_exit(); nss_delete(&db_root); /* === ? */ NSS_XbyY_FREE(&buf); return (0); }
1.359375
1
src/lib/Logging.h
keestux/tuxcap
2
7997379
/* * File: Logging.h * Author: <NAME> * * Created on December 9, 2010, 9:53 PM */ #ifndef LOGGING_H #define LOGGING_H #include <string> #include <map> #include <cstdio> #include <cstdarg> #include "Timer.h" #ifdef DEBUG #define LOG(facil, lvl, txt) Logger::log(facil, lvl, txt) #define TLOG(facil, lvl, txt) Logger::tlog(facil, lvl, txt) #else #define LOG(facil, lvl, txt) #define TLOG(facil, lvl, txt) #endif class LoggerException : std::exception { public: LoggerException(const std::string & msg) : std::exception(), mMessage(msg) {} virtual ~LoggerException() throw (){} virtual const std::string getMessage() const { return mMessage; } private: std::string mMessage; }; class LoggerFacil { public: static LoggerFacil * find(const std::string & name); static void add(const std::string & name, int min_level); int getLevel() const { return _level; } std::string getName() const { return _name; } private: LoggerFacil(const std::string & name, int level) : _name(name), _level(level) {} std::string _name; int _level; static std::map<const std::string, LoggerFacil *> _all_facils; }; class Logger { public: Logger(); virtual ~Logger() {} static bool set_log_level(const std::string & txt); static void log(LoggerFacil * facil, int lvl, const char * txt); static void log(LoggerFacil * facil, int lvl, const std::string & txt); // tlog also writes the timer value static void tlog(LoggerFacil * facil, int lvl, const char * txt); static void tlog(LoggerFacil * facil, int lvl, const std::string & txt); static std::string quote(const std::string& str, char qu='"'); static std::string format(const char* fmt, ...); private: virtual void write_str(const char * txt) const = 0; virtual void write_str(const std::string & txt) const = 0; static std::string vformat(const char* fmt, va_list argPtr); protected: static Timer * _timer; static double _start_time; static Logger * _logger; }; class StdoutLogger : Logger { public: static void create_logger(); private: StdoutLogger(); void write_str(const char * txt) const; void write_str(const std::string & txt) const; }; class FileLogger : Logger { public: static void create_logger(const char * fname); static void create_logger(const std::string & fname); private: FileLogger(const char * fname); FileLogger(const std::string & fname); void write_str(const char * txt) const; void write_str(const std::string & txt) const; const char * _fname; FILE * _fp; }; #endif /* LOGGING_H */
1.484375
1
lista_de_atividades_2/a.31.c
Douglasbm040/PROGRAMACAO-1-
0
7997387
int main (){ int num,resultado; printf("digite o numero : "); scanf("%d",&num); resultado = num % 10 ; if (resultado == 0 ){ printf("o %d e divisivel por 2, 5 e por 10 ",num); }else { resultado = num % 5 ; if (resultado == 0 ){ printf("o %d e divisivel por 5 e por ",num); }else{ resultado = num % 2 ; if(resultado == 0){ printf("o %d e divisivel por 2 ",num); }else{ printf("o %d nao e divisivel por 2 , 5 e 10",num); } } } return 0; }
2.296875
2
GLEngine/Shader.h
Darker1300/GLEngine_2017_Alpha
0
7997395
#pragma once #include <string> class ParticleSystem; class Shader { public: friend class ParticleSystem; Shader(const std::string& vertexPath, const std::string& fragPath); ~Shader(); Shader(const Shader& _other) = delete; Shader(Shader&& _other); Shader& operator=(const Shader& _other) = delete; unsigned int GetProgramID() const { return m_programID; } private: void MakeShaderProgram(const std::string& _vertexPath, const std::string& _fragPath); static unsigned int MakeShader(unsigned int _type, const std::string& _path); static void TestCompilation(unsigned int _programID); static std::string LoadText(const std::string& _path); unsigned int m_programID; };
1.351563
1
src/example5.7/src/example5.7.c
billsix/cprogrammingbook
0
7997403
#include <stdio.h> /* * Compare two strings for equality. * Return 'false' if they are. */ int32_t str_eq(const char *s1, const char *s2) { while (*s1 == *s2) { /* * At end of string return 0. */ if (*s1 == 0) return 0; s1++; s2++; } /* Difference detected! */ return 1; } int main(int argc, char *argv[]) { char *str1 = "str1"; char *str2 = "str2"; char *str3 = "str1"; printf("str1 compared to str2 is %d\n", str_eq(str1, str2)); printf("str1 compared to str3 is %d\n", str_eq(str1, str3)); printf("str2 compared to str3 is %d\n", str_eq(str2, str3)); }
2.34375
2
src/Random.h
martinjrobins/Aboria
57
7997411
#ifndef RANDOM_H_ #define RANDOM_H_ #include "PrngEngine.h" namespace Aboria { typedef sitmo::prng_engine generator_type; } #endif // RANDOM_H_
0.300781
0
Source/Tools.h
sleepingburrito/DoinkBoink
1
7997419
#ifndef TOOLS_H #define TOOLS_H #include <SDL.h> #include "GameStructs.h" //macros // //fix point tools #define REMOVE_FIXPOINT(rawLoc) ((rawLoc) >> FIX_POINT_OFFSET) #define TO_FIXPOINT(val) ((val) << FIX_POINT_OFFSET) //flag helpers #define ENUM_TO_MASK_BIT(ENUM) (1 << (ENUM)) #define ENUM_TO_MASK_BYTE(ENUM) (8 *(ENUM)) //flags #define FLAG_SET(flagToSet, enumVal) ((flagToSet) |= ENUM_TO_MASK_BIT(enumVal)) #define FLAG_ZERO(flagToZero, enumVal) ((flagToZero) &= ~ENUM_TO_MASK_BIT(enumVal)) #define FLAG_TEST(flagToTest, enumVal) ((((flagToTest) & ENUM_TO_MASK_BIT(enumVal)) != 0)) //math #define POW2(x) ((x)*(x)) //pad #define PADIO_INDEX(PAD_STATE, PLAYER) ((PAD_STATE) + (PLAYER) * PAD_STATE_COUNT) // //end of macros //mem tools // void ZeroOut(uint8_t * const zeroMe, const size_t byteCount) { if (zeroMe == NULL) { #ifdef NDEBUG return; #else printf("ZeroOut Null ptr"); assert(false); #endif } for (size_t i = 0; i < byteCount; ++i) { zeroMe[i] = 0; } } void ByteCopy(const uint8_t* const from, uint8_t* const to, const size_t byteCount) { if (from == NULL || to == NULL) { #ifdef NDEBUG return; #else printf("ByteCopy Null ptr"); assert(false); #endif } for (size_t i = 0; i < byteCount; ++i) { to[i] = from[i]; } } uint8_t CheckSum(uint8_t* const checkSumMe, const size_t byteCount) { uint8_t sum = 0; for (size_t i = 0; i < byteCount; ++i) { sum += checkSumMe[i]; } return sum; } // //end of mem //string // char* BufferStringAppend(const bool reset, const char* const textToAdd) { //adds text to a internal string and returns a pointer to it //this is used as a temp string for drawing text to the screen or to load files static char buffer[TOOLS_STRING_BUFFER]; static uint16_t size = 0; if (textToAdd == NULL) { #ifdef NDEBUG return buffer; #else printf("ByteCopy Null ptr"); assert(false); #endif } if (reset) { ZeroOut((uint8_t*)buffer, TOOLS_STRING_BUFFER); size = 0; } for (uint16_t i = 0; textToAdd[i] != 0; i++) { buffer[size] = textToAdd[i]; ++size; if (size >= TOOLS_STRING_BUFFER - 1) { #ifdef NDEBUG #else printf("BufferStringAppend string lengh too long \n buffer: %s \n to add: %s\n", buffer, textToAdd); assert(false); #endif --size; break; } } return buffer; } char* BufferStringMakeBaseDir(const char * const fileName) { //Use SDL to get the base path of the exe and append the file name we are looking for and return that BufferStringAppend(true, SDL_GetBasePath()); return BufferStringAppend(false, fileName); } // //end of string //timing //these are in milliseconds // int64_t MsClock(void) { //find out how many how many ms the app has been running static int64_t MasterMsClock = 0; static int32_t timeLast = 0; static int64_t MasterMsClockOld = 0; int32_t delta = 0; //rollover protection if ((int32_t)SDL_GetTicks() >= timeLast) { delta = SDL_GetTicks() - timeLast; } else { delta = UINT32_MAX - timeLast + SDL_GetTicks(); } timeLast += delta; MasterMsClock += delta; #ifdef NDEBUG #else if (MasterMsClockOld > MasterMsClock) { printf("MasterMsClock overflow\n"); assert(false); } #endif return MasterMsClockOld = MasterMsClock; } int32_t FPScounterMs(void) { //run this only once evey frame, after 1 second it will display fps static int64_t fpsCounterTimer = 0; static int32_t fps = 0; static int32_t fpsDisp = 0; ++fps; if (fpsCounterTimer < MsClock()) { fpsDisp = fps; fpsCounterTimer = MsClock() + 1000; fps = 0; } return fpsDisp; } //this timer is in frames void DiscernmentAllTimers(timer* timers, uint8_t count) { if (timers == NULL) { #ifdef NDEBUG return; #else printf("DiscernmentAllTimers Null ptr"); assert(false); #endif } //Discernment all timers but dont go below zero for (uint8_t i = 0; i < count; ++i) { if (timers[i] > 0) { timers[i] -= 1; } } } // //end of timing //flag // flags BitCopy(const flags flagSource, const uint8_t offsetSource, const flags flagDest, const uint8_t offsetDest) { return (flagDest & ~(1 << offsetDest)) | (((flagSource >> offsetSource) & 1) << offsetDest); } void CopyTestToFlag(flags* const in, const uint8_t offset, const bool test) { if (NULL == in) { #ifdef NDEBUG return; #else printf("CopyTestToFlag Null ptr"); assert(false); #endif } if (test) { FLAG_SET(*in, offset); } else { FLAG_ZERO(*in, offset); } } // //end of flag //math // void AddUint8Capped(uint8_t * const current, const uint8_t add) { //it will add a number to a uint8_t but wont let it rollover if (current == NULL) { #ifdef NDEBUG return; #else printf("AddUint8Capped Null ptr"); assert(false); #endif } const uint8_t old = *current; *current += add; if (*current < old) { *current = UINT8_MAX; } } void AddInt8Capped(int8_t* const current, const int8_t add) { //it will add a number to a int8_t but wont let it rollover if (current == NULL) { #ifdef NDEBUG return; #else printf("AddInt8Capped Null ptr"); assert(false); #endif } //copy sign const int8_t sign = 128 & *current; //add *current += add; //check for overflow if ((int8_t)(128 & *current) != sign) { *current = UINT8_MAX & sign; } } int32_t DistancePart(const uint16_t x1, const uint16_t y1, const uint16_t x2, const uint16_t y2) { //find Distance leaving off the sq root const int32_t x = (int32_t)x1 - (int32_t)x2; const int32_t y = (int32_t)y1 - (int32_t)y2; return POW2(x) + POW2(y); } int16_t Abs16(const int16_t in) { if (in < 0) { return -in; } return in; //return in < 0 ? -in : in; } // //end of math //box //note x/y are in fixpoint // void CheckBoxErrors(const boxWorldSpace* const boxIn) { if (boxIn == NULL) { #ifdef NDEBUG return; #else printf("CheckBoxErrors Null ptr"); assert(false); #endif } if (boxIn->topLeft.x >= TO_FIXPOINT(BASE_RES_WIDTH) || boxIn->bottomRight.x >= TO_FIXPOINT(BASE_RES_WIDTH) || boxIn->topLeft.y >= TO_FIXPOINT(BASE_RES_HEIGHT) || boxIn->bottomRight.y >= TO_FIXPOINT(BASE_RES_HEIGHT)) { #ifdef NDEBUG return; #else printf("box out of map"); assert(false); #endif } if (boxIn->topLeft.x + boxIn->boxSize.width != boxIn->bottomRight.x || boxIn->topLeft.y + boxIn->boxSize.height != boxIn->bottomRight.y) { #ifdef NDEBUG return; #else printf("box sides are missalinged"); assert(false); #endif } if (boxIn->boxSize.width <= REMOVE_FIXPOINT(MAX_SPEED) || boxIn->boxSize.height <= REMOVE_FIXPOINT(MAX_SPEED)) { #ifdef NDEBUG return; #else printf("box too small"); assert(false); #endif } } boxWorldSpace InitBox(const location x, const location y, const dimension height, const dimension width) { boxWorldSpace returnBox; returnBox.topLeft.x = x; returnBox.topLeft.y = y; returnBox.boxSize.height = height; returnBox.boxSize.width = width; returnBox.bottomRight.y = returnBox.topLeft.y + returnBox.boxSize.height; returnBox.bottomRight.x = returnBox.topLeft.x + returnBox.boxSize.width; #ifdef NDEBUG #else CheckBoxErrors(&returnBox); #endif return returnBox; } void SetBox(boxWorldSpace * const boxIn, const location x, const location y) { boxIn->topLeft.x = x; boxIn->topLeft.y = y; boxIn->bottomRight.x = x + boxIn->boxSize.width; boxIn->bottomRight.y = y + boxIn->boxSize.height; #ifdef NDEBUG return; #else CheckBoxErrors(boxIn); #endif } void MoveBoxRelative(boxWorldSpace * const boxIn, const int16_t x, const int16_t y) { SetBox(boxIn, boxIn->topLeft.x + x, boxIn->topLeft.y + y); } bool BoxOverlap(const boxWorldSpace * const boxInA, const boxWorldSpace * const boxInB) { #ifdef NDEBUG #else CheckBoxErrors(boxInA); CheckBoxErrors(boxInB); #endif return !(boxInA->topLeft.x >= boxInB->bottomRight.x || boxInA->bottomRight.x <= boxInB->topLeft.x || boxInA->topLeft.y >= boxInB->bottomRight.y || boxInA->bottomRight.y <= boxInB->topLeft.y); } void RightOfBox(boxWorldSpace * const moveMe, const boxWorldSpace * const toHere){ #ifdef NDEBUG #else CheckBoxErrors(moveMe); CheckBoxErrors(toHere); #endif SetBox(moveMe, toHere->bottomRight.x, moveMe->topLeft.y); } void LeftOfBox(boxWorldSpace * const moveMe, const boxWorldSpace * const toHere) { #ifdef NDEBUG #else CheckBoxErrors(moveMe); CheckBoxErrors(toHere); #endif SetBox(moveMe, toHere->topLeft.x - moveMe->boxSize.width, moveMe->topLeft.y); } void BottomOfBox(boxWorldSpace * const moveMe, const boxWorldSpace * const toHere) { #ifdef NDEBUG #else CheckBoxErrors(moveMe); CheckBoxErrors(toHere); #endif SetBox(moveMe, moveMe->topLeft.x, toHere->bottomRight.y); } void TopOfBox(boxWorldSpace * const moveMe, const boxWorldSpace * const toHere) { #ifdef NDEBUG #else CheckBoxErrors(moveMe); CheckBoxErrors(toHere); #endif SetBox(moveMe, moveMe->topLeft.x, toHere->topLeft.y - moveMe->boxSize.height); } void BoxMoveHalfWay(boxWorldSpace* const boxMove, const boxWorldSpace* const boxMoveTo) { //Sets boxMove to be always between its current location and boxMoveTo //used for linear interpolation (like to smooth out slow mo smoothing) //note: use for display only. has bugs with certain types of movements. //it will try and exit early in those cases //zero in a move two is buggy, skip it if you find one if (boxMove->topLeft.x == 0 || boxMove->topLeft.y == 0 || boxMoveTo->topLeft.x == 0 || boxMoveTo->topLeft.y == 0) { return; } //if (boxMoveTo->topLeft.x == 0 || boxMoveTo->topLeft.y == 0) { // return; //} const uint16_t x = (int16_t)boxMove->topLeft.x + (((int16_t)boxMove->topLeft.x - (int16_t)boxMoveTo->topLeft.x) >> 1); const uint16_t y = (int16_t)boxMove->topLeft.y + (((int16_t)boxMove->topLeft.y - (int16_t)boxMoveTo->topLeft.y) >> 1); SetBox(boxMove, x, y); } // //end of box tools #endif
1.546875
2
src/game/client/dod/clientmode_dod.h
cstom4994/SourceEngineRebuild
6
7997427
//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: // //=============================================================================// #ifndef DOD_CLIENTMODE_H #define DOD_CLIENTMODE_H #ifdef _WIN32 #pragma once #endif #include "clientmode_shared.h" #include "dodviewport.h" class CDODFreezePanel; class ClientModeDODNormal : public ClientModeShared { DECLARE_CLASS( ClientModeDODNormal, ClientModeShared ); private: // IClientMode overrides. public: ClientModeDODNormal(); virtual void Init(); virtual void InitViewport(); virtual float GetViewModelFOV( void ); int GetDeathMessageStartHeight( void ); virtual void FireGameEvent( IGameEvent * event); virtual void PostRenderVGui(); virtual bool ShouldDrawViewModel( void ); virtual int HudElementKeyInput( int down, ButtonCode_t keynum, const char *pszCurrentBinding ); private: // void UpdateSpectatorMode( void ); void RadioMessage( const char *pszSoundName, const char *pszSubtitle, const char *pszSender = NULL, int iSenderIndex = 0 ); char m_szLastRadioSound[128]; CDODFreezePanel *m_pFreezePanel; }; extern IClientMode *GetClientModeNormal(); extern ClientModeDODNormal* GetClientModeDODNormal(); #endif // DOD_CLIENTMODE_H
1.140625
1
zdk/include/zdk/config/bsd.h
cristivlas/zerobugs
2
7997435
#ifndef BSD_H__CD4770C7_4E32_11DA_B332_00C04F09BBCC #define BSD_H__CD4770C7_4E32_11DA_B332_00C04F09BBCC // // $Id$ // // ------------------------------------------------------------------------- // This file is part of ZeroBugs, Copyright (c) 2010 <NAME> // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // ------------------------------------------------------------------------- #include <boost/static_assert.hpp> #define HAVE_ELF 1 #define HAVE_PROC_SERVICE_H 1 #define HAVE_THREAD_DB_H 1 /* address type in link_map struct is caddr_t */ #define HAVE_LINK_MAP_CADDR_T 1 #define HAVE_PRSTATUS_GREGSETSZ 1 #define HAVE_PTRACE_CADDR_T 1 /* ptrace can set and read the reg struct */ #define HAVE_PTRACE_REGS 1 #define HAVE_PT_CLEARSTEP 1 #define HAVE_KSE_THREADS 1 #define ADDR_CAST(a) reinterpret_cast<const addr_t&>(a) /* true when using our very own libelf.h (minielf) */ #define HAVE_ELF_NHDR 1 #if defined(__i386__) #include "zdk/config/bsd386.h" #elif defined(__x86_64__) #include "zdk/config/bsd-x86_64.h" #endif /* compatibility */ #include <sys/types.h> #include <machine/ptrace.h> #include <machine/reg.h> #include <sys/signal.h> typedef sig_t sighandler_t; /* PT_GETREGS, PT_GETFPREGS etc expect the register struct in the address field */ #define GETREGS(regp) reinterpret_cast<addr_t>(regp), 0 #define GETREGS_NATIVE(regp) reinterpret_cast<caddr_t>(regp), 0 #define PTRACE_ATTACH PT_ATTACH #define PTRACE_DETACH PT_DETACH #define PTRACE_TRACEME PT_TRACE_ME #define PTRACE_PEEKDATA PT_READ_D #define PTRACE_POKEDATA PT_WRITE_D #define PTRACE_PEEKTEXT PT_READ_I #define PTRACE_POKETEXT PT_WRITE_I #define PTRACE_GETREGS PT_GETREGS #define PTRACE_SETREGS PT_SETREGS #define PTRACE_GETFPREGS PT_GETFPREGS #define PTRACE_SETFPREGS PT_SETFPREGS #define PTRACE_GETFPXREGS PT_GETFPREGS #define PTRACE_SETFPXREGS PT_SETFPREGS #define PTRACE_KILL PT_KILL #define PTRACE_CONT PT_CONTINUE #define PTRACE_SINGLESTEP PT_STEP #define PTRACE_SYSCALL PT_SYSCALL #define __WCLONE WLINUXCLONE #define __WALL 0 typedef int __ptrace_request; typedef struct reg user_regs_struct; typedef struct fpreg user_fpregs_struct; typedef struct prstatus elf_prstatus; typedef struct prpsinfo elf_prpsinfo; BOOST_STATIC_ASSERT(sizeof(off_t) == 8); typedef off_t loff_t; inline loff_t lseek64(int fd, loff_t offset, int whence) { return lseek(fd, offset, whence); } #endif // BSD_H__CD4770C7_4E32_11DA_B332_00C04F09BBCC // vim: tabstop=4:softtabstop=4:expandtab:shiftwidth=4
1.164063
1
Twitter-Dumped/7.52/_TtC9T1Twitter30URTTimelineMomentCardViewModel-T1Twitter.h
ichitaso/TwitterListEnabler
1
7997443
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by <NAME>. // #import <T1Twitter/_TtC9T1Twitter30URTTimelineMomentCardViewModel.h> #import <T1Twitter/TFNTwitterMomentCardStreamItem-Protocol.h> @class NSString; @interface _TtC9T1Twitter30URTTimelineMomentCardViewModel (T1Twitter) <TFNTwitterMomentCardStreamItem> @property(nonatomic, readonly) NSString *timeString; @property(nonatomic, readonly) NSString *title; @property(nonatomic, readonly) NSString *momentID; @property(nonatomic, readonly) long long entryType; @end
0.585938
1
src/kernel/net/tcp_output.c
cashlisa/mos
302
7997451
#include <proc/task.h> #include <system/time.h> #include <utils/math.h> #include <utils/string.h> #include "tcp.h" extern volatile struct thread *current_thread; struct sk_buff *tcp_create_skb(struct socket *sock, uint32_t sequence_number, uint32_t ack_number, uint16_t flags, void *options, uint16_t option_len, void *payload, uint16_t payload_len) { struct tcp_sock *tsk = tcp_sk(sock->sk); struct sk_buff *skb = skb_alloc(MAX_TCP_HEADER + option_len, payload_len); skb->dev = tsk->inet.sk.dev; skb_put(skb, payload_len); memcpy(skb->data, payload, payload_len); skb_push(skb, sizeof(struct tcp_packet) + option_len); skb->h.tcph = (struct tcp_packet *)skb->data; tcp_build_header(skb->h.tcph, tsk->inet.ssin.sin_addr, tsk->inet.ssin.sin_port, tsk->inet.dsin.sin_addr, tsk->inet.dsin.sin_port, sequence_number, ack_number, flags, tsk->rcv_wnd, options, option_len, skb->len); skb_push(skb, sizeof(struct ip4_packet)); skb->nh.iph = (struct ip4_packet *)skb->data; ip4_build_header(skb->nh.iph, skb->len, IP4_PROTOCAL_TCP, tsk->inet.ssin.sin_addr, tsk->inet.dsin.sin_addr, rand()); skb_push(skb, sizeof(struct ethernet_packet)); skb->mac.eh = (struct ethernet_packet *)skb->data; uint8_t *dest_mac = lookup_mac_addr_for_ethernet(skb->dev, tsk->inet.dsin.sin_addr); ethernet_build_header(skb->mac.eh, ETH_P_IP, skb->dev->dev_addr, dest_mac); struct tcp_skb_cb *cb = (struct tcp_skb_cb *)skb->cb; cb->seq = sequence_number; // payload_len counts both lower and upper boundary cb->end_seq = sequence_number + max(0, (int)payload_len - 1); cb->flags = flags; return skb; } void tcp_send_skb(struct socket *sock, struct sk_buff *skb, bool is_retransmitted) { struct tcp_sock *tsk = tcp_sk(sock->sk); struct tcp_skb_cb *cb = (struct tcp_skb_cb *)skb->cb; uint16_t payload_len = tcp_payload_lenth(skb); bool is_actived_send = !is_retransmitted && (payload_len > 0 || skb->h.tcph->syn || skb->h.tcph->fin); tsk->flight_size += payload_len; // we increase snd nxt only if data, syn, fin (ghost segment) and not retransmitted segment if (is_actived_send) tsk->snd_nxt = cb->end_seq + 1; cb->when = get_milliseconds(NULL); cb->expires = cb->when + tsk->rto; tcp_state_transition(sock, cb->flags); // if retransmit timer is not actived -> there are 3 scenarios // - start the connection via three way handshake // - receive the ack segment which ack all outstanding segments (in one batch window) // - after receiving ack from retransmittion // # do not active timer if we are no the one who initiate if (!is_actived_timer(&tsk->retransmit_timer) && is_actived_send) mod_timer(&tsk->retransmit_timer, cb->expires); ethernet_sendmsg(skb); } void tcp_transmit(struct socket *sock) { struct tcp_sock *tsk = tcp_sk(sock->sk); while (!list_empty(&sock->sk->tx_queue)) { // NOTE: MQ 2020-07-20 // we lock scheduler (interrupt) until sending all pending packets (on queue not yet sent) // -> tx_queue now only contains outstanding packets // measure sending with 65535 avaliable window takes ~ 2ms (which less than average RTT for each packet) // the reason is prevent interrupting the sending flow which causes unexpected behaviors // for example // case 1 // - send -> tx_queue = 1 2 3 4 5 6 (interrupt at 6) // - receive ack 7 -> tx => empty // case 2 // - send -> tx_queue = 1 2 3 4 5 6 (interrupt at 5) // - receive ack 5 -> tx = 5 6 // case 3 // - send all segments but get interrutped when just out of loop and haven't updated/scheduled yet // - receive ack for all segments -> back to interrupted point above // -> schedule again which don't have anything to wait -> thread is waiting forever lock_scheduler(); while (tcp_sender_available_window(tsk) > 0 && sock->sk->send_head) { struct sk_buff *skb = list_entry(sock->sk->send_head, struct sk_buff, sibling); tcp_send_skb(sock, skb, false); sock->sk->send_head = sock->sk->send_head->next; if (sock->sk->send_head == &sock->sk->tx_queue) sock->sk->send_head = NULL; // according to rfc6298, kick off only one RTT measurement at the time // the segment has to be at the beginning of tx_queue if (!tsk->rtt_time) { assert(&skb->sibling == sock->sk->tx_queue.next); struct tcp_skb_cb *cb = TCP_SKB_CB(skb); tsk->rtt_end_seq = cb->end_seq; tsk->rtt_time = cb->when; } } update_thread(current_thread, THREAD_WAITING); unlock_scheduler(); schedule(); } }; void tcp_tx_queue_add_skb(struct socket *sock, struct sk_buff *skb) { if (!sock->sk->send_head) sock->sk->send_head = &skb->sibling; list_add_tail(&skb->sibling, &sock->sk->tx_queue); } void tcp_transmit_skb(struct socket *sock, struct sk_buff *skb) { tcp_tx_queue_add_skb(sock, skb); tcp_transmit(sock); }
1.578125
2
src/thread/disruptor/sequence.h
ichc/rocketmq-client-cpp
1
7997459
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Copyright (c) 2011, <NAME> // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of the disruptor-- nor the // names of its contributors may be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL FRANÇOIS SAINT-JACQUES BE LIABLE FOR ANY // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef CACHE_LINE_SIZE_IN_BYTES // NOLINT #define CACHE_LINE_SIZE_IN_BYTES 64 // NOLINT #endif // NOLINT #define ATOMIC_SEQUENCE_PADDING_LENGTH \ (CACHE_LINE_SIZE_IN_BYTES - sizeof(boost::atomic<int64_t>))/8 #define SEQUENCE_PADDING_LENGTH \ (CACHE_LINE_SIZE_IN_BYTES - sizeof(int64_t))/8 #ifndef DISRUPTOR_SEQUENCE_H_ // NOLINT #define DISRUPTOR_SEQUENCE_H_ // NOLINT #include <boost/atomic.hpp> #include <boost/memory_order.hpp> #include <boost/noncopyable.hpp> #include <vector> #include <limits> using namespace boost; namespace rocketmq { const int64_t kInitialCursorValue = -1L; // Sequence counter. class Sequence:public noncopyable { public: // Construct a sequence counter that can be tracked across threads. // // @param initial_value for the counter. Sequence(int64_t initial_value = kInitialCursorValue) : value_(initial_value) {} // Get the current value of the {@link Sequence}. // // @return the current value. int64_t sequence() const { return value_.load(boost::memory_order_acquire); } // Set the current value of the {@link Sequence}. // // @param the value to which the {@link Sequence} will be set. void set_sequence(int64_t value) { value_.store(value, boost::memory_order_release); } // Increment and return the value of the {@link Sequence}. // // @param increment the {@link Sequence}. // @return the new value incremented. int64_t IncrementAndGet(const int64_t& increment) { return value_.fetch_add(increment, boost::memory_order_release) + increment; } private: // members boost::atomic<int64_t> value_; }; // Cache line padded sequence counter. // // Can be used across threads without worrying about false sharing if a // located adjacent to another counter in memory. class PaddedSequence : public Sequence { public: PaddedSequence(int64_t initial_value = kInitialCursorValue) : Sequence(initial_value) {} //private: // padding //int64_t padding_[ATOMIC_SEQUENCE_PADDING_LENGTH]; }; // Non-atomic sequence counter. // // This counter is not thread safe. class MutableLong { public: MutableLong(int64_t initial_value = kInitialCursorValue) : sequence_(initial_value) {} int64_t sequence() const { return sequence_; } void set_sequence(const int64_t& sequence) { sequence_ = sequence; }; int64_t IncrementAndGet(const int64_t& delta) { sequence_ += delta; return sequence_; } private: volatile int64_t sequence_; }; // Cache line padded non-atomic sequence counter. // // This counter is not thread safe. class PaddedLong : public MutableLong { public: PaddedLong(int64_t initial_value = kInitialCursorValue) : MutableLong(initial_value) {} //private: //int64_t padding_[SEQUENCE_PADDING_LENGTH]; }; int64_t GetMinimumSequence( const std::vector<Sequence*>& sequences) { int64_t minimum = std::numeric_limits<int64_t>::max(); std::vector<Sequence*>::const_iterator it= sequences.begin(); for (;it!=sequences.end();it++) { int64_t sequence = (*it)->sequence(); minimum = minimum < sequence ? minimum : sequence; } return minimum; }; }; // namespace rocketmq #endif // DISRUPTOR_SEQUENCE_H_ NOLINT
1.085938
1
chrome/browser/ui/webui/print_preview/policy_settings.h
Yannic/chromium
76
7997467
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_POLICY_SETTINGS_H_ #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_POLICY_SETTINGS_H_ #include "base/macros.h" namespace user_prefs { class PrefRegistrySyncable; } namespace printing { // Registers the enterprise policy prefs that should be enforced in print // preview. These settings override other settings, and cannot be controlled by // the user. class PolicySettings { public: PolicySettings() = delete; PolicySettings(const PolicySettings&) = delete; PolicySettings& operator=(const PolicySettings&) = delete; static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); }; } // namespace printing #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_POLICY_SETTINGS_H_
0.6875
1
libraries/lps/include/mcrl2/lps/tools.h
Noxsense/mCRL2
61
7997475
// Author(s): <NAME> // Copyright: see the accompanying file COPYING or copy at // https://github.com/mCRL2org/mCRL2/blob/master/COPYING // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // /// \file mcrl2/lps/tools.h /// \brief add your file description here. #ifndef MCRL2_LPS_TOOLS_H #define MCRL2_LPS_TOOLS_H #include "mcrl2/core/print.h" #include "mcrl2/data/detail/prover/solver_type.h" #include "mcrl2/lps/lps_rewriter_type.h" #include "mcrl2/data/rewriter.h" namespace mcrl2 { namespace lps { void lpsbinary(const std::string& input_filename, const std::string& output_filename, const std::string& parameter_selection); void lpsconstelm(const std::string& input_filename, const std::string& output_filename, data::rewriter::strategy rewrite_strategy, bool instantiate_free_variables, bool ignore_conditions, bool remove_trivial_summands, bool remove_singleton_sorts ); void lpsinfo(const std::string& input_filename, const std::string& input_file_message ); bool lpsinvelm(const std::string& input_filename, const std::string& output_filename, const std::string& invariant_filename, const std::string& dot_file_name, data::rewriter::strategy rewrite_strategy, data::detail::smt_solver_type solver_type, const bool no_check, const bool no_elimination, const bool simplify_all, const bool all_violations, const bool counter_example, const bool path_eliminator, const bool apply_induction, const int time_limit ); void lpsparelm(const std::string& input_filename, const std::string& output_filename ); void lpspp(const std::string& input_filename, const std::string& output_filename, bool print_summand_numbers, core::print_format_type format ); void lpsrewr(const std::string& input_filename, const std::string& output_filename, const data::rewriter::strategy rewrite_strategy, const lps::lps_rewriter_type rewriter_type ); void lpssumelm(const std::string& input_filename, const std::string& output_filename, const bool decluster); void lpssuminst(const std::string& input_filename, const std::string& output_filename, const data::rewriter::strategy rewrite_strategy, const std::string& sorts_string, const bool finite_sorts_only, const bool tau_summands_only); void lpsuntime(const std::string& input_filename, const std::string& output_filename, const bool add_invariants, const bool apply_fourier_motzkin, const data::rewriter::strategy rewrite_strategy); void txt2lps(const std::string& input_filename, const std::string& output_filename ); } // namespace lps } // namespace mcrl2 #endif // MCRL2_LPS_TOOLS_H
1.242188
1
onlineC/Classes/Model/RobotChat/OCSLinksModel.h
Zydhjx/onlineC
0
7997483
// // OCSLinksModel.h // onlineC // // Created by zyd on 2018/7/13. // #import "OCSRobotModel.h" @interface OCSLinksModel : OCSRobotModel // 信息内容 @property (copy, nonatomic) NSAttributedString *content; @end
0.318359
0
sources/ioExp.c
francknos/SmallProjectForTests
0
7997491
#include "ioExp.h" void Ddi_ioexp_Init(void) { SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG); // Enable PORTG GPIOPinConfigure(GPIO_PG0_I2C1SCL); // Configure Alternate function for pin PG0 GPIOPinConfigure(GPIO_PG1_I2C1SDA); // Configure Alternate function for pin PG1 GPIOPinTypeI2CSCL(GPIO_PORTG_BASE, GPIO_PIN_0); // Affect Pin PG0 at I2C SCL GPIOPinTypeI2C(GPIO_PORTG_BASE, GPIO_PIN_1); // Affect Pin PG1 at I2C SDA SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C1); // Enable I2C1 while(!SysCtlPeripheralReady(SYSCTL_PERIPH_I2C1)); // utile ? I2CMasterInitExpClk(I2C1_BASE, HR_Sys_Clock_Freq, false); //clear I2C FIFOs HWREG(I2C1_BASE + I2C_O_FIFOCTL) = 80008000; Ddi_i2c_SendI2C_IOEXP(IOEXP_ADDR, 0xFF, CONF_PORT0); SysCtlDelay(100); Ddi_i2c_SendI2C_IOEXP(IOEXP_ADDR, 0x00, CONF_PORT1); SysCtlDelay(100); Ddi_i2c_SendI2C_IOEXP(IOEXP_ADDR, 0xFF, PORT1_OUT); SysCtlDelay(100); } void Ddi_ioexpS_Init(IOExpender_t io) { SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG); // Enable PORTG GPIOPinConfigure(GPIO_PG0_I2C1SCL); // Configure Alternate function for pin PG0 GPIOPinConfigure(GPIO_PG1_I2C1SDA); // Configure Alternate function for pin PG1 GPIOPinTypeI2CSCL(GPIO_PORTG_BASE, GPIO_PIN_0); // Affect Pin PG0 at I2C SCL GPIOPinTypeI2C(GPIO_PORTG_BASE, GPIO_PIN_1); // Affect Pin PG1 at I2C SDA SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C1); // Enable I2C1 I2CMasterInitExpClk(I2C1_BASE, HR_Sys_Clock_Freq, false); //clear I2C FIFOs HWREG(I2C1_BASE + I2C_O_FIFOCTL) = 80008000; Ddi_i2c_SendI2C_IOEXP(io.id, 0xFF, CONF_PORT0); SysCtlDelay(100); Ddi_i2c_SendI2C_IOEXP(io.id, 0x00, CONF_PORT1); SysCtlDelay(100); Ddi_i2c_SendI2C_IOEXP(io.id, 0xFF, PORT1_OUT); SysCtlDelay(100); } uint8_t Ddi_i2c_SendI2C_IOEXP(uint8_t slave_addr, uint16_t valToSend, uint8_t reg) { uint8_t success = TRUE; uint8_t erreurTransmission = FALSE; uint16_t timeOutI2C = 0; I2CMasterSlaveAddrSet(I2C1_BASE, slave_addr, false); I2CMasterDataPut(I2C1_BASE, reg); I2CMasterControl(I2C1_BASE, I2C_MASTER_CMD_BURST_SEND_START); timeOutI2C = 0; while(!I2CMasterBusy(I2C1_BASE) && timeOutI2C <2000)timeOutI2C++; if(timeOutI2C>=2000)return FALSE; timeOutI2C = 0; while(I2CMasterBusy(I2C1_BASE) && timeOutI2C <2000)timeOutI2C++; if(timeOutI2C>=2000)return FALSE; // // Check for errors. // if( I2CMasterErr(I2C1_BASE) != I2C_MASTER_ERR_NONE) { //ERREUR I2C erreurTransmission = TRUE; } I2CMasterDataPut(I2C1_BASE,(uint8_t)valToSend); I2CMasterControl(I2C1_BASE, I2C_MASTER_CMD_BURST_SEND_FINISH); timeOutI2C = 0; while(!I2CMasterBusy(I2C1_BASE) && timeOutI2C <2000)timeOutI2C++; if(timeOutI2C>=2000)return FALSE; timeOutI2C = 0; while(I2CMasterBusy(I2C1_BASE) && timeOutI2C <2000)timeOutI2C++; if(timeOutI2C>=2000)return FALSE; // // Check for errors. // if( I2CMasterErr(I2C1_BASE) != I2C_MASTER_ERR_NONE) { //ERREUR I2C erreurTransmission = TRUE; } //NotUsed { if ( erreurTransmission == TRUE ) { /*if ( ERROR_IOEXP_I2C_TRANSMISSION_NB_ERR_OCC >= NB_ERR_OCC ) { check_And_Add_In_Error_List(ID_ICB, ERROR_IOEXP_I2C_TRANSMISSION, PRIORITY_HIGH); } else { ERROR_IOEXP_I2C_TRANSMISSION_NB_ERR_OCC++; }*/ } else { //check_If_Error_Was_Active_And_Unset ( ID_ICB, ERROR_IOEXP_I2C_TRANSMISSION ); //ERROR_IOEXP_I2C_TRANSMISSION_NB_ERR_OCC = 0; } } timeOutI2C = 0; while(I2CMasterBusy(I2C1_BASE) && timeOutI2C <2000)timeOutI2C++; if(timeOutI2C>=2000)return FALSE; return success; }
1.210938
1
Bootstrap/Utils/Debug.h
kozakura51/MelonLoader
558
7997499
#pragma once #include "../Utils/Console.h" class Debug { public: static bool Enabled; static void Msg(const char* txt); static void DirectWrite(const char* txt); static void Internal_Msg(Console::Color meloncolor, Console::Color txtcolor, const char* namesection, const char* txt); };
0.683594
1
cls/include/tencentcloud/cls/v20201016/model/CreateConsumerRequest.h
TencentCloud/tencentcloud-sdk-cpp-intl-en
1
7997507
/* * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef TENCENTCLOUD_CLS_V20201016_MODEL_CREATECONSUMERREQUEST_H_ #define TENCENTCLOUD_CLS_V20201016_MODEL_CREATECONSUMERREQUEST_H_ #include <string> #include <vector> #include <map> #include <tencentcloud/core/AbstractModel.h> #include <tencentcloud/cls/v20201016/model/ConsumerContent.h> #include <tencentcloud/cls/v20201016/model/Ckafka.h> namespace TencentCloud { namespace Cls { namespace V20201016 { namespace Model { /** * CreateConsumer request structure. */ class CreateConsumerRequest : public AbstractModel { public: CreateConsumerRequest(); ~CreateConsumerRequest() = default; std::string ToJsonString() const; /** * 获取Log topic ID to bind * @return TopicId Log topic ID to bind */ std::string GetTopicId() const; /** * 设置Log topic ID to bind * @param TopicId Log topic ID to bind */ void SetTopicId(const std::string& _topicId); /** * 判断参数 TopicId 是否已赋值 * @return TopicId 是否已赋值 */ bool TopicIdHasBeenSet() const; /** * 获取Whether to ship log metadata. Default value: `true` * @return NeedContent Whether to ship log metadata. Default value: `true` */ bool GetNeedContent() const; /** * 设置Whether to ship log metadata. Default value: `true` * @param NeedContent Whether to ship log metadata. Default value: `true` */ void SetNeedContent(const bool& _needContent); /** * 判断参数 NeedContent 是否已赋值 * @return NeedContent 是否已赋值 */ bool NeedContentHasBeenSet() const; /** * 获取Metadata to ship if `NeedContent` is `true` * @return Content Metadata to ship if `NeedContent` is `true` */ ConsumerContent GetContent() const; /** * 设置Metadata to ship if `NeedContent` is `true` * @param Content Metadata to ship if `NeedContent` is `true` */ void SetContent(const ConsumerContent& _content); /** * 判断参数 Content 是否已赋值 * @return Content 是否已赋值 */ bool ContentHasBeenSet() const; /** * 获取CKafka information * @return Ckafka CKafka information */ Ckafka GetCkafka() const; /** * 设置CKafka information * @param Ckafka CKafka information */ void SetCkafka(const Ckafka& _ckafka); /** * 判断参数 Ckafka 是否已赋值 * @return Ckafka 是否已赋值 */ bool CkafkaHasBeenSet() const; private: /** * Log topic ID to bind */ std::string m_topicId; bool m_topicIdHasBeenSet; /** * Whether to ship log metadata. Default value: `true` */ bool m_needContent; bool m_needContentHasBeenSet; /** * Metadata to ship if `NeedContent` is `true` */ ConsumerContent m_content; bool m_contentHasBeenSet; /** * CKafka information */ Ckafka m_ckafka; bool m_ckafkaHasBeenSet; }; } } } } #endif // !TENCENTCLOUD_CLS_V20201016_MODEL_CREATECONSUMERREQUEST_H_
1.15625
1
include/lwpp/customobject_access.h
slacer/lwpp
0
7997515
#ifndef CUSTOMOBJECT_ACCESS_H #define CUSTOMOBJECT_ACCESS_H #include <lwcustobj.h> #include <lwpp/vector3d.h> namespace lwpp { class CustomObjAccess { protected: const LWCustomObjAccess *access; public: CustomObjAccess(const LWCustomObjAccess *acc) : access(acc) {;} int View() {return access->view;} int Flags() {return access->flags;} bool isSelected() {return (Flags() & LWCOFL_SELECTED) != 0;} bool isPicking() {return (Flags() & LWCOFL_PICKING) != 0;} void SetColor (float rgba[4]) {access->setColor(access->dispData, rgba);} void SetColor (float r, float g, float b, float a) { float rgba[4] = {r, g, b, a}; SetColor(rgba); } void SetColor(double col[4]) { float rgba[4] = { static_cast<float>(col[0]), static_cast<float>(col[1]), static_cast<float>(col[2]), static_cast<float>(col[3]) }; SetColor(rgba); } void SetColorCC(const float rgba[4]) { access->setColorCC(access->dispData, (float *)(rgba)); } void SetColorCC(const float r, float g, float b, float a) { float rgba[4] = { r, g, b, a }; SetColorCC(rgba); } void SetPattern (int lpat) {access->setPattern(access->dispData, lpat);} void SetTexture (int size, unsigned char *image) {access->setTexture(access->dispData, size, image);} void SetUVs (double uv0[2], double uv1[2], double uv2[2], double uv3[2]) {access->setUVs(access->dispData, uv0, uv1, uv2, uv3);} void SetUVs (double uv[4][2]) {SetUVs(uv[0], uv[1], uv[2], uv[3]);} void DrawPoint (double pos[3], int csys) {access->point(access->dispData, pos, csys);} void DrawLine (double from[3], double to[3], int csys) {access->line(access->dispData, from, to, csys);} void DrawTriangle (double v1[3], double v2[3], double v3[3], int csys) {access->triangle(access->dispData, v1, v2, v3, csys);} void DrawQuad (double v1[3], double v2[3], double v3[3], double v4[3], int csys) {access->quad(access->dispData, v1, v2, v3, v4, csys);} void DrawQuad(lwpp::Vector3d v1, lwpp::Vector3d v2, lwpp::Vector3d v3, lwpp::Vector3d v4, int csys) { DrawQuad(v1.asLWVector(), v2.asLWVector(), v3.asLWVector(), v4.asLWVector(), csys); } void DrawQuad (double v[4][3], int csys) {DrawQuad(v[0], v[1], v[2], v[3], csys);} void DrawCircle (double center[3], double radius, int csys) {access->circle(access->dispData, center, radius, csys);} void DrawCircle(double center[3], int csys, double radius, int rsys) { access->circle2(access->dispData, center, csys, radius, rsys); } void DrawDisk(double center[3], double radius, int csys) { access->disk(access->dispData, center, radius, csys); } void DrawDisk(double center[3], int csys, double radius, int rsys) { access->disk2(access->dispData, center, csys, radius, rsys); } void DrawPickCircle(double center[3], int csys, double radius, int rsys) { isPicking() ? access->disk2(access->dispData, center, csys, radius, rsys) : access->circle2(access->dispData, center, csys, radius, rsys); } void DrawText (double center[3], const char *text, int just, int csys) {access->text(access->dispData, center, text, just, csys);} void DrawText(double center[3], const std::string text, int just, int csys) { DrawText(center, text.c_str(), just, csys); } Point3d GetViewPos() {return Point3d(access->viewPos);} Vector3d GetViewDir() {return Vector3d(access->viewDir);} void SetCoordinateSystem(LWItemID item) {access->setCSysItem(access->dispData, item);} void DrawPolygon(unsigned int numv, double v[][3], int csys) { access->polygon(access->dispData, numv, v, csys); } void DrawPolygon(unsigned int numv, unsigned int verts[], double v[][3], int csys) { access->polyIndexed(access->dispData, numv, verts, v, csys); } void SetDrawMode(unsigned int mode = 0) {access->setDrawMode(access->dispData, mode);} int MeasureText (const char *text /* language encoded */, int *width, int *height, int *offset_y) { return access->measureText(access->dispData, text, width, height, offset_y); } int MeasureText(const std::string &text /* language encoded */, int *width, int *height, int *offset_y) { return MeasureText(text.c_str(), width, height, offset_y); } void SetPart(unsigned int part) { access->setPart(access->dispData, part); } void SetThickness (float point_size, float line_width) { access->setThickness(access->dispData, point_size, line_width); } void GetColour(unsigned int idx, float rgba[4]) { access->getColor(access->dispData, idx, rgba); } void Push(LWDMatrix4 mat) { access->pushMatrix(access->dispData, mat); } void Pop() { access->popMatrix(access->dispData); } void LineStrip(unsigned int numv, double p[][3], int csys) { access->lineStrip(access->dispData, numv, p, csys); } void LineStrip(unsigned int numv, double *p, int csys) { access->lineStrip(access->dispData, numv, (double (*)[3])p, csys); } void LineLoop(unsigned int numv, double p[][3], int csys) { access->lineLoop(access->dispData, numv, p, csys); } }; } // end namespace #endif // CUSTOMOBJECT_ACCESS_H
1.054688
1
layout/TableViewCellLayout/TableViewCellLayout/Cell.h
professordeng/iOS-objc
0
7997523
// // Cell.h // TableViewCellLayout // // Created by deng on 2020/7/3. // Copyright © 2020 professordeng. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface Cell : UITableViewCell @property (weak, nonatomic) IBOutlet UILabel *contentLabel; @end NS_ASSUME_NONNULL_END
0.34375
0
overlapDetection/src/VideoHandler.h
ilyalinov/CV1
1
7997531
#pragma once #include <opencv2/videoio.hpp> #include "EdgesDetectorCreator.h" #include "Configuration.h" #include "SmoothingCreator.h" #include "EdgesDetector.h" #include "Smoothing.h" #include "OpticalFlow.h" class VideoHandler { public: VideoHandler(Configuration* c); void processVideo(); ~VideoHandler(); private: void initializeVideoWriter(); cv::Size getOutputSize(); void calculateMean(cv::Mat& mean, cv::Mat& meanCV8U, const cv::Mat& inputFrame, int frameCounter); void calculateMeanStandardDeviationMedian(const cv::Mat& mean, const cv::Mat& outputImage); void saveResults(const cv::Mat& inputFrame, const cv::Mat& mean, const cv::Mat& outputImage, int frameCounter); void showResults(const cv::Mat& inputFrame , const cv::Mat& mean , const cv::Mat& outputImage , const cv::Mat& clusters , const cv::Mat& overlap , const cv::Mat& result); void draw_components(cv::Mat& src, cv::Mat& dst, cv::Mat& labelImage, std::vector<cv::Vec3b>& colors); cv::Point2f getPoint(int row, int col, const cv::Mat& labelImage, int label, int ksize); Configuration* configuration; EdgesDetector* detector; Smoothing* smoothing; OpticalFlow* optFlow; cv::VideoWriter v; cv::VideoCapture newFrameCap; };
1.65625
2
examples/bpacketsync_example.c
vankxr/liquid-dsp
1,382
7997539
// // bpacketsync_example.c // #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <getopt.h> #include "liquid.h" int callback(unsigned char * _payload, int _payload_valid, unsigned int _payload_len, framesyncstats_s _stats, void * _userdata) { printf("callback invoked, payload (%u bytes) : %s\n", _payload_len, _payload_valid ? "valid" : "INVALID!"); // copy data if valid if (_payload_valid) { unsigned char * msg_dec = (unsigned char*) _userdata; memmove(msg_dec, _payload, _payload_len*sizeof(unsigned char)); } return 0; } // print usage/help message void usage() { printf("bpacketsync_example [options]\n"); printf(" u/h : print usage\n"); printf(" n : input data size (number of uncoded bytes): 8 default\n"); printf(" e : bit error rate of channel, default: 0\n"); printf(" v : data integrity check: crc32 default\n"); liquid_print_crc_schemes(); printf(" c : coding scheme (inner): h74 default\n"); printf(" k : coding scheme (outer): none default\n"); liquid_print_fec_schemes(); } int main(int argc, char*argv[]) { srand(time(NULL)); // options unsigned int n=8; // original data message length crc_scheme check = LIQUID_CRC_32; // data integrity check fec_scheme fec0 = LIQUID_FEC_HAMMING74; // inner code fec_scheme fec1 = LIQUID_FEC_NONE; // outer code float bit_error_rate = 0.0f; // bit error rate // read command-line options int dopt; while((dopt = getopt(argc,argv,"uhn:e:v:c:k:")) != EOF){ switch (dopt) { case 'h': case 'u': usage(); return 0; case 'n': n = atoi(optarg); break; case 'e': bit_error_rate = atof(optarg); break; case 'v': // data integrity check check = liquid_getopt_str2crc(optarg); if (check == LIQUID_CRC_UNKNOWN) { fprintf(stderr,"error: unknown/unsupported CRC scheme \"%s\"\n\n",optarg); exit(1); } break; case 'c': // inner FEC scheme fec0 = liquid_getopt_str2fec(optarg); if (fec0 == LIQUID_FEC_UNKNOWN) { fprintf(stderr,"error: unknown/unsupported inner FEC scheme \"%s\"\n\n",optarg); exit(1); } break; case 'k': // outer FEC scheme fec1 = liquid_getopt_str2fec(optarg); if (fec1 == LIQUID_FEC_UNKNOWN) { fprintf(stderr,"error: unknown/unsupported outer FEC scheme \"%s\"\n\n",optarg); exit(1); } break; default: exit(1); } } // validate input if (n == 0) { fprintf(stderr,"error: %s, packet length must be greater than zero\n", argv[0]); exit(1); } else if (bit_error_rate < 0.0f || bit_error_rate > 1.0f) { fprintf(stderr,"error: %s, channel bit error rate must be in [0,1]\n", argv[0]); exit(1); } // create packet generator bpacketgen pg = bpacketgen_create(0, n, check, fec0, fec1); bpacketgen_print(pg); unsigned int i; // compute packet length unsigned int k = bpacketgen_get_packet_len(pg); // initialize arrays unsigned char msg_org[n]; // original message unsigned char msg_enc[k]; // encoded message unsigned char msg_rec[k+1]; // recieved message unsigned char msg_dec[n]; // decoded message // create packet synchronizer bpacketsync ps = bpacketsync_create(0, callback, (void*)msg_dec); // initialize original data message for (i=0; i<n; i++) msg_org[i] = rand() % 256; // // encode packet // bpacketgen_encode(pg,msg_org,msg_enc); // // channel // // add delay msg_rec[0] = rand() & 0xff; // initialize first byte as random memmove(&msg_rec[1], msg_enc, k*sizeof(unsigned char)); liquid_lbshift(msg_rec, (k+1)*sizeof(unsigned char), rand()%8); // random shift // add random errors for (i=0; i<k+1; i++) { unsigned int j; for (j=0; j<8; j++) { if (randf() < bit_error_rate) msg_rec[i] ^= 1 << (8-j-1); } } // // run packet synchronizer // // push random bits through synchronizer for (i=0; i<100; i++) bpacketsync_execute_byte(ps, rand() & 0xff); // push packet through synchronizer for (i=0; i<k+1; i++) bpacketsync_execute_byte(ps, msg_rec[i]); // // count errors // unsigned int num_bit_errors = 0; for (i=0; i<n; i++) num_bit_errors += count_bit_errors(msg_org[i], msg_dec[i]); printf("number of bit errors received: %4u / %4u\n", num_bit_errors, n*8); // clean up allocated objects bpacketgen_destroy(pg); bpacketsync_destroy(ps); return 0; }
1.632813
2
keytechKit/Code/Queries/KTQueryDetail.h
tclaus/keytechkit
1
7997547
// // KTQueryDetails.h // keytechkit // // Created by <NAME> on 03.07.18. // #import <Foundation/Foundation.h> #import "KTElement.h" #import "KTQueryParameter.h" /** Represents a details object under /user/<username>/queries/<queryID> */ @interface KTQueryDetail : NSObject /** Provides the object Mapping for this class and given objectManager @param manager A shared RKObjectmanager that contains the connection data to the API */ +(RKObjectMapping*)mappingWithManager:(RKObjectManager*) manager; /** Returns a single query detail for currentUser @param success A block to execute after query is loaded @para, failure A block to execute after loading failed */ +(void)loadQueryDetailsUserKey:(NSString*) userKey queryID:(int) queryID success:(void (^)(KTQueryDetail* ktQueryDetails)) success failure:(void (^)(NSError *error)) failure; @property (nonatomic) int queryID; @property (nonatomic, copy) NSString *key; @property (nonatomic, copy) NSString *displayName; @property (nonatomic, copy) NSString *queryParamTypes; @property (nonatomic) NSArray <KTQueryParameter*> *parameterList; @end
0.78125
1
Pods/Target Support Files/LayoutKit/LayoutKit-umbrella.h
FabianTerhorst/DialogKit
1
7997555
FOUNDATION_EXPORT double LayoutKitVersionNumber; FOUNDATION_EXPORT const unsigned char LayoutKitVersionString[];
-0.345703
0
src/utils/system_memory.h
BookProjects/stm32f0_timer_lib
0
7997563
#ifndef SYSTEM_MEMORY_H #define SYSTEM_MEMORY_H #include "utils/system_memory_internals.h" // Initialization of memory locations #define SYSTEM_INIT(type, base_address) ((type *) system_init((void *)base_address, sizeof(type))) #define SYSTEM_DELETE(base_address) (system_delete((void *)base_address)) void system_delete(void *base_address); #define SYSTEM_WRITE(object, field, value) (system_write(&(object->field), value)) #define SYSTEM_READ(object, field) (system_read(&(object->field))) #define SYSTEM_AND_EQUAL(object, field, value) (SYSTEM_WRITE(object, field, SYSTEM_READ(object, field) & value)) #define SYSTEM_OR_EQUAL(object, field, value) (SYSTEM_WRITE(object, field, SYSTEM_READ(object, field) | value)) // x &= ~mask, x |= val. Useful when setting one section of a bitfield #define SYSTEM_OVERWRITE(object, field, value, mask) (SYSTEM_WRITE(object, field, (SYSTEM_READ(object, field) & ~mask) | value)) // Set a mask ON or OFF #define SYSTEM_SET_MASK(object, field, mask, on) (on ? SYSTEM_OR_EQUAL(object, field, mask) : SYSTEM_AND_EQUAL(object, field, ~mask)) // Shortcuts #define S_INIT SYSTEM_INIT #define S_DEL SYSTEM_DELETE #define S_WR SYSTEM_WRITE #define S_RD SYSTEM_READ #define S_AE SYSTEM_AND_EQUAL #define S_OE SYSTEM_OR_EQUAL #define S_OW SYSTEM_OVERWRITE #define S_SM SYSTEM_SET_MASK #endif // SYSTEM_MEMORY
1.289063
1
misc.h
fin-alice/BitsClient
1
7997571
#include <windows.h> #ifndef EXTERN #ifdef __cplusplus #define EXTERN extern "C" #else #define EXTERN extern #endif #endif EXTERN void Debug(const TCHAR*, ...); EXTERN void EnableWindows(HWND,int,BOOLEAN); EXTERN void FileTimeToLocalizedString(const FILETIME*,PTSTR,size_t); EXTERN BOOLEAN ValidateOSVersion(BYTE,BYTE); EXTERN void CenteringWindow(HWND,const POINT*); EXTERN void CenteringWindowToCursor(HWND); EXTERN void CenteringWindowToParent(HWND,HWND); EXTERN UINT64 QueryCounter();
0.519531
1
libc/newlib/libm/mathfp/s_numtest.c
The0x539/wasp
28
7997579
/* @(#)z_numtest.c 1.0 98/08/13 */ /****************************************************************** * Numtest * * Input: * x - pointer to a floating point value * * Output: * An integer that indicates what kind of number was passed in: * NUM = 3 - a finite value * NAN = 2 - not a number * INF = 1 - an infinite value * 0 - zero * * Description: * This routine returns an integer that indicates the character- * istics of the number that was passed in. * *****************************************************************/ #include "fdlibm.h" #include "zmath.h" #ifndef _DOUBLE_IS_32BITS int numtest (double x) { __uint32_t hx, lx; int exp; EXTRACT_WORDS (hx, lx, x); exp = (hx & 0x7ff00000) >> 20; /* Check for a zero input. */ if (x == 0.0) { return (0); } /* Check for not a number or infinity. */ if (exp == 0x7ff) { if(hx & 0xf0000 || lx) return (NAN); else return (INF); } /* Otherwise it's a finite value. */ else return (NUM); } #endif /* _DOUBLE_IS_32BITS */
2.390625
2
ThirdParty/Havok/include/Physics2012/Collide/Util/Welding/hkpMeshWeldingUtility.h
wobbier/source3-engine
11
7997587
/* * * Confidential Information of Telekinesys Research Limited (t/a Havok). Not for disclosure or distribution without Havok's * prior written consent. This software contains code, techniques and know-how which is confidential and proprietary to Havok. * Product and Trade Secret source code contains trade secrets of Havok. Havok Software (C) Copyright 1999-2014 Telekinesys Research Limited t/a Havok. All Rights Reserved. Use of this software is subject to the terms of an end user license agreement. * */ #ifndef HK_MESHWELDINGUTILITY_H #define HK_MESHWELDINGUTILITY_H #include <Physics2012/Collide/Util/Welding/hkpWeldingUtility.h> class hkpBvTreeShape; class hkpTriangleShape; class hkpShapeCollection; /// Utility functions for building runtime welding information for triangular meshes class hkpMeshWeldingUtility { public: HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR(HK_MEMORY_CLASS_BASE,hkpMeshWeldingUtility); /// specify consistency tests enum WindingConsistency { WINDING_IGNORE_CONSISTENCY, ///< ignore consistency WINDING_TEST_CONSISTENCY, ///< test consistency and warn if inconsistent triangle winding }; /// The single shape version of computeWeldingInfoMultiShape. See comments for that function for details. This function /// will not take multiple meshes into account and will not weld across edges between meshes. static void HK_CALL computeWeldingInfo( hkpShapeCollection* collection, const hkpBvTreeShape* bvTree, hkpWeldingUtility::WeldingType weldingType, bool weldOpenEdges = true, bool disableEdges = false ); struct ShapeInfo { HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR(HK_MEMORY_CLASS_BASE,hkpMeshWeldingUtility::ShapeInfo); hkTransform m_transform; const hkpBvTreeShape* m_shape; }; /// Computes welding information for the mesh while taking into account other mesh shapes. This will compute welding /// information so that welding works across the mesh shapes provided in 'allShapes'. 'allShapes' should include an /// entry for the mesh being passed in. Only triangles can be welded. Therefore only triangle collections /// (hkpSimpleMeshShape, hkpExtendedMeshShape, hkpTriSampledHeightFieldBvTreeShape and hkpCompressedMeshShape) /// are handled. This method must be called after all child shapes (subparts or triangles) have /// been added to the collection. The hkpMoppBvTreeShape you pass in must be built referencing this collection. /// Welding information adds an additional 2 bytes per triangle storage overhead. This is an expensive call, /// and should be done off line, and the resultant collection serialized, to save the runtime overhead of /// computing the welding info. static void HK_CALL computeWeldingInfoMultiShape( const hkTransform& meshTransform, hkpShapeCollection* mesh, hkpWeldingUtility::WeldingType weldingType, hkArray< ShapeInfo >& allShapes, bool weldOpenEdges = true, bool disableEdges = false ); public: // Helper to extract a single bitcode for a specific edge static int HK_CALL calcSingleEdgeBitcode(hkUint16 triangleEdgesBitcode, int edgeIndex ); // Helper for calcWeldingInfoForTriangle static hkUint16 HK_CALL modifyCombinedEdgesBitcode(hkUint16 combinedBitcode, int edgeIndex, int bitcode); // Helper for calcWeldingInfoForTriangle static void HK_CALL calcAntiClockwiseTriangleNormal(const hkVector4& vertex0, const hkVector4& vertex1, const hkVector4& vertex2, hkVector4& normal); // Helper for computeWeldingInfo static hkReal HK_CALL calcAngleForEdge(hkVector4Parameter edgeNormal, hkVector4Parameter edgeOrtho, hkVector4Parameter triangleNormal); // Helper for computeWeldingInfoMultiShape static hkResult HK_CALL testWindingConsistency( hkVector4Parameter localVertex0, hkVector4Parameter localEdgeOrtho, hkVector4Parameter localNormal, const hkpTriangleShape* adjacentTriangle, hkVector4Parameter adjacentNormal ); // Returns the welding info for a triangle given its vertex coordinates and those of its neighboring triangles static hkUint16 HK_CALL computeTriangleWeldingInfo(const hkVector4* triangle, const hkVector4* neighbors, int numNeighbors, hkBool weldOpenEdges = true, hkReal tolerance = 0.05f); // Calculates the intersection between a line and a triangle and returns it expressed as line fractions static hkBool HK_CALL clipLineAgainstTriangle(hkVector4Parameter v0, hkVector4Parameter v1, const hkVector4* vertices, const hkVector4& normal, hkReal padding, hkReal& lo, hkReal& hi); public: // // DEPRECATED FUNCTIONS // /// This function is deprecated, use computeWeldingInfo instead. /// A function to generate welding information for a shape in a mesh. This welding should be /// stored by the mesh and set as the welding information in the triangle returned by getChildShape() with that shape key. static hkResult HK_CALL calcWeldingInfoForTriangle( hkpShapeKey shapeKey, const hkpBvTreeShape* bvTreeShape, WindingConsistency testConsistency, hkUint16& info ); /// This function is deprecated, use computeWeldingInfo instead. /// A function to check if winding is consistent between a triangle and its neighbors. static hkBool HK_CALL isTriangleWindingValid( hkpShapeKey shapeKey, const hkpBvTreeShape* bvTreeShape ); // Helper for calcWeldingInfoForTriangle static hkResult HK_CALL calcBitcodeForTriangleEdge(const hkpBvTreeShape* bvTreeShape, const hkpTriangleShape* triangleShape, hkpShapeKey triangleShapeKey, int edgeIndex, WindingConsistency testConsistency, hkInt16& combinedBitcodesOut ); // Helper for calcWeldingInfoForTriangle static int HK_CALL createSingularVertexArray(const hkVector4 *vertices0, const hkVector4 *vertices1, int edgeIndex, hkVector4* vertexArrayOut, int orderedEdgeVerticesOnTriangle1[2]); // Helper for calcWeldingInfoForTriangle static int HK_CALL calcEdgeAngleBitcode(const hkVector4* vertices); // Helper for calcWeldingInfoForTriangle static hkReal HK_CALL calcAngleFromVertices(const hkVector4* vertices, hkReal& sinAngleOut, hkReal& cosAngleOut); }; #endif // HK_MESHWELDINGUTILITY_H /* * Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20140907) * * Confidential Information of Havok. (C) Copyright 1999-2014 * Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok * Logo, and the Havok buzzsaw logo are trademarks of Havok. Title, ownership * rights, and intellectual property rights in the Havok software remain in * Havok and/or its suppliers. * * Use of this software for evaluation purposes is subject to and indicates * acceptance of the End User licence Agreement for this product. A copy of * the license is included with this software and is also available at www.havok.com/tryhavok. * */
1.507813
2
RockBuster/SFML-headers.h
Mateusz1223/RockBuster
1
7997595
#pragma once #include <SFML/Graphics.hpp> #include <SFML/System.hpp> #include <SFML/Window.hpp> #include <SFML/Audio.hpp>
0.045898
0
cyber/examples/component/distance/distance.h
xucongTHU/Apollo
0
7997603
#include "cyber/component/component.h" #include "cyber/component/timer_component.h" #include "cyber/class_loader/class_loader.h" #include "cyber/examples/component/proto/examples.pb.h" using apollo::cyber::Component; using apollo::cyber::ComponentBase; using apollo::cyber::TimerComponent; using apollo::cyber::examples::component::proto::Driver; using apollo::cyber::Writer; class distance: public TimerComponent { public: bool Init() override; bool Proc() override; private: std::shared_ptr<apollo::cyber::Writer<Driver>> distance_writer_; }; CYBER_REGISTER_COMPONENT(distance)
0.980469
1
minuteConverter.c
AbubakarAtiq/C-Programs
51
7997611
int main(void) { printf("Please enter a time in min. and I will convert it into hours and minutes: "); int timeInMinutes; scanf("%d", &timeInMinutes); int hours = timeInMinutes/60; int minutes = timeInMinutes%60; printf("%d hours and %d minutes\n",hours, minutes); system("pause"); }
1.976563
2
AliPayForDebug/AliPayForDebug/AlipayWallet_Headers/AlipayLifeCardImageView.h
ceekay1991/AliPayForDebug
5
7997619
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by <NAME>. // #import "CCWidgetView.h" @class APLCBImageView, CAShapeLayer, UIImageView, UILabel; @interface AlipayLifeCardImageView : CCWidgetView { APLCBImageView *_bigImageView; CAShapeLayer *_shapeLayer; UIImageView *_videoImageView; UILabel *_durationLabel; } + (id)subType; + (id)tagType; + (struct CGSize)sizeOfWidgetWithData:(id)arg1 cssItem:(id)arg2 superFrame:(struct CGRect)arg3 extendInfo:(id)arg4; @property(retain, nonatomic) UILabel *durationLabel; // @synthesize durationLabel=_durationLabel; @property(retain, nonatomic) UIImageView *videoImageView; // @synthesize videoImageView=_videoImageView; @property(retain, nonatomic) CAShapeLayer *shapeLayer; // @synthesize shapeLayer=_shapeLayer; @property(retain, nonatomic) APLCBImageView *bigImageView; // @synthesize bigImageView=_bigImageView; - (void).cxx_destruct; - (void)bindAndLayoutWithData:(id)arg1 cssItem:(id)arg2 extendInfo:(id)arg3; @end
1.03125
1
NHYMADManger/UnionSDK/BUAdSDK.framework/Headers/BUAdSlot.h
NH135/NHYMADManger
2
7997627
// // BUAdSlot.h // BUAdSDK // // Copyright © 2017 bytedance. All rights reserved. // #import <Foundation/Foundation.h> #import "BUSize.h" typedef NS_ENUM(NSInteger, BUAdSlotAdType) { BUAdSlotAdTypeUnknown = 0, BUAdSlotAdTypeBanner = 1, // banner ads BUAdSlotAdTypeInterstitial = 2, // interstitial ads BUAdSlotAdTypeSplash = 3, // splash ads BUAdSlotAdTypeSplash_Cache = 4, // cache splash ads BUAdSlotAdTypeFeed = 5, // feed ads BUAdSlotAdTypePaster = 6, // paster ads BUAdSlotAdTypeRewardVideo = 7, // rewarded video ads BUAdSlotAdTypeFullscreenVideo = 8, // full-screen video ads BUAdSlotAdTypeDrawVideo = 9, // vertical (immersive) video ads }; typedef NS_ENUM(NSInteger, BUAdSlotPosition) { BUAdSlotPositionTop = 1, BUAdSlotPositionBottom = 2, BUAdSlotPositionFeed = 3, BUAdSlotPositionMiddle = 4, // for interstitial ad only BUAdSlotPositionFullscreen = 5, }; @interface BUAdSlot : NSObject /// required. The unique identifier of a native ad. @property (nonatomic, copy) NSString *ID; /// required. Ad type. @property (nonatomic, assign) BUAdSlotAdType AdType; /// required. Ad display location. @property (nonatomic, assign) BUAdSlotPosition position; /// Accept a set of image sizes, please pass in the BUSize object. @property (nonatomic, strong) NSMutableArray<BUSize *> *imgSizeArray; /// required. Image size. @property (nonatomic, strong) BUSize *imgSize; /// Icon size. @property (nonatomic, strong) BUSize *iconSize; /// Maximum length of the title. @property (nonatomic, assign) NSInteger titleLengthLimit; /// Maximum length of description. @property (nonatomic, assign) NSInteger descLengthLimit; /// Whether to support deeplink. @property (nonatomic, assign) BOOL isSupportDeepLink; /// Native banner ads and native interstitial ads are set to 1, other ad types are 0, the default is 0. @property (nonatomic, assign) BOOL isOriginAd; //adload_seq:(针对聚合广告位)传递本次请求是为“自然日内某设备某广告位置第N次展示机会”发出的广告请求,同物理位置在自然日从1开始计数,不同物理位置独立计数;example:某原生广告位置,当天第5次产生展示机会,这次展示机向穿山甲发送了4次广告请求,则这4次广告请求的"adload_seq"的值应为5。第二天重新开始计数。 @property (nonatomic, assign) NSInteger adloadSeq; //prime_rit:(针对聚合广告位)广告物理位置对应的固定穿山甲广告位id,可以使用第一层的广告位id也可以为某一层的广告位id,但要求同一物理位置在该字段固定上报同一广告位id,不频繁更换;example:某原生广告位,当天共发出了1000个请求,这1000个请求中使用了5个不同target的穿山甲rit,用某X rit来作为该位置的标记rit,则这1000次请求的prime_rit都需要上报X rit的rit id。 @property (nonatomic, copy) NSString *primeRit; - (NSDictionary *)dictionaryValue; @end
1.078125
1
day4/big_m.c
SourangshuGhosh/OR_Lab
1
7997635
#include <math.h> int next_iteration_index(double *ptr, int m, int n) { int i,index=0; for(i=1;i<n-1;i++) { if(*(ptr+(m-1)*n+i) < *(ptr+(m-1)*n+index)) { index = i; } } if(*(ptr+(m-1)*n+index) > 0) { return -1; } else { if(*(ptr+(m-1)*n+index) == 0) { return -2; } } return index; } int pivot_index(double *ptr, int m, int n) { int i,j=next_iteration_index(ptr,m,n),index=j; double vi = -1.0,vn = -1.0,min = 10000.0; for(i=0;i<m-1;i++) { vi = *(ptr+i*n+j); vn = *(ptr+i*n+n-1); if(vi>0 && (vn/vi)<min) { min = vn/vi; index = i*n+j; } } return index; } double * convert_pivot(double *ptr, int m, int n, int p_index) { double p = *(ptr+p_index); p = 1/p; *(ptr+p_index) = p; return ptr; } double * convert_row(double *ptr, int m, int n, int p_index) { double p = *(ptr+p_index),r; int p_row = p_index/n,p_col=p_index%n,i; for(i=0;i<n;i++) { if(i!=p_col) { r = *(ptr+p_row*n+i); r = r*p; *(ptr+p_row*n+i) = r; } } return ptr; } double * convert_column(double *ptr, int m, int n, int p_index) { double p = *(ptr+p_index),c; int p_row = p_index/n,p_col = p_index%n,i; for(i=0;i<m;i++) { if(i!=p_row) { c = *(ptr+i*n+p_col); c = (-1)*c*p; *(ptr+i*n+p_col) = c; } } return ptr; } double * convert_others(double *ptr, int m, int n, int p_index) { double p = *(ptr+p_index),c,r,s; int p_row = p_index/n,p_col = p_index%n,i,j; for(i=0;i<m;i++) { for(j=0;j<n;j++) { if(i!=p_row && j!=p_col) { r = *(ptr+p_row*n+j); c = *(ptr+i*n+p_col); s = *(ptr+i*n+j); s += (c*r/p); *(ptr+i*n+j) = s; } } } return ptr; } void print_array(double *ptr, int m, int n) { int i,j; for(i=0;i<m;i++) { printf("\n"); for(j=0;j<n;j++) { printf(" %lf ",*(ptr+i*n+j)); } } } void print_solution(double *ptr, int *ptr2, int m, int n) { int i; for(i=0;i<m-1;i++) { if(*(ptr2+i) != -1) { printf(" x%d = %lf ",*(ptr2+i)+1,*(ptr+i*n+n-1)); } } printf("\n Other variables are non-basic, i.e, 0."); printf("\n Optimal solution z = %lf ",*(ptr+m*n-1)); if (next_iteration_index(ptr,m,n)==-2) { printf("\n Alternate solution exists."); } else { printf("\n Unique optimal solution - no alternate solution."); } } int * swap_variables(int *ptr2, int m, int n, int p) { int p_row = p/n, p_col = p%n; if(p_row==m-2) { *(ptr2+p_col) = 0; } else { *(ptr2+p_col) = p_row+1; } return ptr2; } double * bigm_solve(double *ptr, int *ptr2, int m, int n, int obj_type) { int p,i=0; printf("\n\n Tableu from iteration %d \n",i++); print_array(ptr,m,n); printf("\n\n"); while(next_iteration_index(ptr,m,n)!=-1 && i<5) { printf(" Tableu from iteration %d \n",i++); p = pivot_index(ptr,m,n); ptr2 = swap_variables(ptr2,m,n,p); ptr = convert_pivot(ptr,m,n,p); ptr = convert_row(ptr,m,n,p); ptr = convert_column(ptr,m,n,p); ptr = convert_others(ptr,m,n,p); print_array(ptr,m,n); printf("\n\n"); } if(obj_type == 1) { *(ptr + m*n -1) *= (-1); } print_solution(ptr,ptr2,m,n); return ptr; } void main() { int m,n,n_old,i,j,surplus=0,obj_type; double M = 1000.0; printf("\n Enter number of unknowns (n) : "); scanf("%d",&n); printf(" Enter number of equations (m) : "); scanf("%d",&m); m++; n++; n_old = n; int option[m]; double arr[m*n]; printf("\n"); for(i=0;i<m-1;i++) { for(j=0;j<n-1;j++) { printf(" Input for marix A's equation %d coeffiecient of x%d : ",(i+1),(j+1)); scanf("%lf",&arr[n*i+j]); } } printf("\n"); for(i=0;i<m-1;i++) { printf(" Input for matrix B's - constant for equation %d : ",(i+1)); scanf("%lf",&arr[n*(i+1)-1]); } printf("\n"); for(i=0;i<n-1;i++) { printf(" Input for objective function's coefficient of x%d : ",(i+1)); scanf("%lf",&arr[(m-1)*n+i]); } printf("\n"); for(i=0;i<m-1;i++) { printf(" Type of equation / inequation %d \n 1. Ax >= B \n 2. Ax = B \n 3. Ax <= B \n Enter your option : ",(i+1)); scanf("%d",&option[i]); if(option[i]==1) { n++; } } printf("\n"); printf(" Type of optimization \n 1. Minimize \n 2. Maximize \n Enter your option : "); scanf("%d",&obj_type); double bigm_arr[m*n]; for(i=0;i<m-1;i++) { for(j=0;j<n_old-1;j++) { bigm_arr[i*n+j] = arr[i*n_old+j]; } } for(i=0;i<m-1;i++) { if(option[i]==1) { for(j=n_old-1;j<n-1;j++) { bigm_arr[i*n+j]= 0.0; } bigm_arr[i*n+n_old-1+surplus]= -1.0; surplus++; } } for(i=0;i<m-1;i++) { bigm_arr[i*n+n-1] = arr[i*n_old+n_old-1]; } for(j=0;j<n-1;j++) { bigm_arr[(m-1)*n+j] = arr[(m-1)*n_old+j]; } double sum; bigm_arr[m*n-1] = 0.0; for(j=0;j<n;j++) { bigm_arr[(m-1)*n+j] *= -1; sum = 0.0; for(i=0;i<m-1;i++) { if(option[i]<3) { sum += (bigm_arr[i*n+j]*M); } } bigm_arr[(m-1)*n+j] -= sum; } double *ptr; int arr2[100], *ptr2; ptr = bigm_arr; ptr2 = arr2; ptr = bigm_solve(ptr,ptr2,m,n,obj_type); }
2.15625
2
TonicEngine/Source Code/MeshImporter.h
AlexLA99/Cookie-Engine
0
7997643
#ifndef __MESH_IMPORTER_H__ #define __MESH_IMPORTER_H__ #include "Application.h" #include "Module.h" #include "ResourceMesh.h" class aiNode; class aiScene; class Importer; class GameObject; class MeshImporter : public Module { public: MeshImporter(Application* app, bool start_enabled = true); ~MeshImporter(); bool Init(); update_status Update(float dt); bool CleanUp(); bool LoadFile(std::string path, std::string texture_path = "Assets/Others/Lenna.png"); void LoadNode(const aiScene* scene, aiNode* node, const char* node_path, std::string output_file, GameObject* GO_root, std::string text_path); bool Export(const char* name, std::string& output_file, ResourceMesh* mesh); bool Load(ResourceMesh* mesh); public: bool active = false; }; #endif
1.046875
1
tests/app/amg2006/krylov/gmres.h
HPCToolkit/hpctest
1
7997651
/*BHEADER********************************************************************** * Copyright (c) 2006 The Regents of the University of California. * Produced at the Lawrence Livermore National Laboratory. * Written by the HYPRE team. UCRL-CODE-222953. * All rights reserved. * * This file is part of HYPRE (see http://www.llnl.gov/CASC/hypre/). * Please see the COPYRIGHT_and_LICENSE file for the copyright notice, * disclaimer, contact information and the GNU Lesser General Public License. * * HYPRE 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) version 2.1 dated February 1999. * * HYPRE 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 terms and conditions of the GNU General * Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * $Revision: 2.6 $ ***********************************************************************EHEADER*/ /****************************************************************************** * * GMRES gmres * *****************************************************************************/ #ifndef HYPRE_KRYLOV_GMRES_HEADER #define HYPRE_KRYLOV_GMRES_HEADER /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ /** * @name Generic GMRES Interface * * A general description of the interface goes here... * * @memo A generic GMRES linear solver interface * @version 0.1 * @author <NAME> **/ /*@{*/ /*-------------------------------------------------------------------------- *--------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------- * hypre_GMRESData and hypre_GMRESFunctions *--------------------------------------------------------------------------*/ /** * @name GMRES structs * * Description... **/ /*@{*/ /** * The {\tt hypre\_GMRESFunctions} object ... **/ typedef struct { char * (*CAlloc) ( int count, int elt_size ); int (*Free) ( char *ptr ); int (*CommInfo) ( void *A, int *my_id, int *num_procs ); void * (*CreateVector) ( void *vector ); void * (*CreateVectorArray) ( int size, void *vectors ); int (*DestroyVector) ( void *vector ); void * (*MatvecCreate) ( void *A, void *x ); int (*Matvec) ( void *matvec_data, double alpha, void *A, void *x, double beta, void *y ); int (*MatvecDestroy) ( void *matvec_data ); double (*InnerProd) ( void *x, void *y ); int (*CopyVector) ( void *x, void *y ); int (*ClearVector) ( void *x ); int (*ScaleVector) ( double alpha, void *x ); int (*Axpy) ( double alpha, void *x, void *y ); int (*precond)(); int (*precond_setup)(); } hypre_GMRESFunctions; /** * The {\tt hypre\_GMRESData} object ... **/ /* rel_change!=0 means: if pass the other stopping criteria, also check the relative change in the solution x. stop_crit!=0 means: absolute error tolerance rather than the usual relative error tolerance on the residual. Never applies if rel_change!=0. */ typedef struct { int k_dim; int min_iter; int max_iter; int rel_change; int stop_crit; int converged; double tol; int cf_tol; double rel_residual_norm; void *A; void *r; void *w; void **p; void *matvec_data; void *precond_data; hypre_GMRESFunctions * functions; /* log info (always logged) */ int num_iterations; int print_level; /* printing when print_level>0 */ int logging; /* extra computations for logging when logging>0 */ double *norms; char *log_file_name; } hypre_GMRESData; #ifdef __cplusplus extern "C" { #endif /** * @name generic GMRES Solver * * Description... **/ /*@{*/ /** * Description... * * @param param [IN] ... **/ hypre_GMRESFunctions * hypre_GMRESFunctionsCreate( char * (*CAlloc) ( int count, int elt_size ), int (*Free) ( char *ptr ), int (*CommInfo) ( void *A, int *my_id, int *num_procs ), void * (*CreateVector) ( void *vector ), void * (*CreateVectorArray) ( int size, void *vectors ), int (*DestroyVector) ( void *vector ), void * (*MatvecCreate) ( void *A, void *x ), int (*Matvec) ( void *matvec_data, double alpha, void *A, void *x, double beta, void *y ), int (*MatvecDestroy) ( void *matvec_data ), double (*InnerProd) ( void *x, void *y ), int (*CopyVector) ( void *x, void *y ), int (*ClearVector) ( void *x ), int (*ScaleVector) ( double alpha, void *x ), int (*Axpy) ( double alpha, void *x, void *y ), int (*PrecondSetup) ( void *vdata, void *A, void *b, void *x ), int (*Precond) ( void *vdata, void *A, void *b, void *x ) ); /** * Description... * * @param param [IN] ... **/ void * hypre_GMRESCreate( hypre_GMRESFunctions *gmres_functions ); #ifdef __cplusplus } #endif #endif
1.09375
1
clang-tools-extra/clangd/index/dex/PostingList.h
medismailben/llvm-project
2,338
7997659
//===--- PostingList.h - Symbol identifiers storage interface --*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// /// /// \file /// This defines posting list interface: a storage for identifiers of symbols /// which can be characterized by a specific feature (such as fuzzy-find /// trigram, scope, type or any other Search Token). Posting lists can be /// traversed in order using an iterator and are values for inverted index, /// which maps search tokens to corresponding posting lists. /// /// In order to decrease size of Index in-memory representation, Variable Byte /// Encoding (VByte) is used for PostingLists compression. An overview of VByte /// algorithm can be found in "Introduction to Information Retrieval" book: /// https://nlp.stanford.edu/IR-book/html/htmledition/variable-byte-codes-1.html /// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_DEX_POSTINGLIST_H #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_DEX_POSTINGLIST_H #include "Iterator.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" #include <cstdint> #include <vector> namespace clang { namespace clangd { namespace dex { class Token; /// NOTE: This is an implementation detail. /// /// Chunk is a fixed-width piece of PostingList which contains the first DocID /// in uncompressed format (Head) and delta-encoded Payload. It can be /// decompressed upon request. struct Chunk { /// Keep sizeof(Chunk) == 32. static constexpr size_t PayloadSize = 32 - sizeof(DocID); llvm::SmallVector<DocID, PayloadSize + 1> decompress() const; /// The first element of decompressed Chunk. DocID Head; /// VByte-encoded deltas. std::array<uint8_t, PayloadSize> Payload; }; static_assert(sizeof(Chunk) == 32, "Chunk should take 32 bytes of memory."); /// PostingList is the storage of DocIDs which can be inserted to the Query /// Tree as a leaf by constructing Iterator over the PostingList object. DocIDs /// are stored in underlying chunks. Compression saves memory at a small cost /// in access time, which is still fast enough in practice. class PostingList { public: explicit PostingList(llvm::ArrayRef<DocID> Documents); /// Constructs DocumentIterator over given posting list. DocumentIterator will /// go through the chunks and decompress them on-the-fly when necessary. /// If given, Tok is only used for the string representation. std::unique_ptr<Iterator> iterator(const Token *Tok = nullptr) const; /// Returns in-memory size of external storage. size_t bytes() const { return Chunks.capacity() * sizeof(Chunk); } private: const std::vector<Chunk> Chunks; }; } // namespace dex } // namespace clangd } // namespace clang #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_DEX_POSTINGLIST_H
1.59375
2
src/graphics/examples/vkcube/third_party/vkcube/cube.h
opensource-assist/fuschia
14
7997667
/* * Copyright (c) 2015-2016 The Khronos Group Inc. * Copyright (c) 2015-2016 Valve Corporation * Copyright (c) 2015-2016 LunarG, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Author: <NAME> <<EMAIL>> * Author: <NAME> <<EMAIL>> * Author: <NAME> <<EMAIL>> * Author: <NAME> <<EMAIL>> * Author: <NAME> <<EMAIL>> * Author: <NAME> <<EMAIL>> */ #if defined(VK_USE_PLATFORM_XLIB_KHR) || defined(VK_USE_PLATFORM_XCB_KHR) #include <X11/Xutil.h> #endif #if defined(MAGMA_USE_SHIM) #include "vulkan_shim.h" #else #include <vulkan/vulkan.h> #endif #if defined(CUBE_USE_IMAGE_PIPE) #include <lib/async-loop/cpp/loop.h> #include <lib/async-loop/default.h> #include <src/lib/vulkan/imagepipe_view/imagepipe_view.h> // nogncheck #endif // defined(CUBE_USE_IMAGE_PIPE) #include "linmath.h" #define DEMO_TEXTURE_COUNT 1 #define APP_SHORT_NAME "cube" #define APP_LONG_NAME "The Vulkan Cube Demo Program" // Allow a maximum of two outstanding presentation operations. #define FRAME_LAG 2 /* * structure to track all objects related to a texture. */ struct texture_object { VkSampler sampler; VkImage image; VkImageLayout imageLayout; VkMemoryAllocateInfo mem_alloc; VkDeviceMemory mem; VkImageView view; uint32_t tex_width, tex_height; }; typedef struct { VkImage image; VkCommandBuffer cmd; VkCommandBuffer graphics_to_present_cmd; VkImageView view; } SwapchainBuffers; #if defined(VK_USE_PLATFORM_FUCHSIA) && defined(CUBE_USE_IMAGE_PIPE) struct FuchsiaState { async::Loop loop; std::unique_ptr<sys::ComponentContext> context; std::unique_ptr<ImagePipeViewProviderService> view_provider_service; std::unique_ptr<ImagePipeView> view; uint32_t image_pipe_handle = 0; uint32_t num_frames = 60; uint32_t elapsed_frames = 0; std::chrono::time_point<std::chrono::high_resolution_clock> t0{}; FuchsiaState() : loop(&kAsyncLoopConfigAttachToCurrentThread) {} }; #endif struct demo { #if defined(VK_USE_PLATFORM_XLIB_KHR) | defined(VK_USE_PLATFORM_XCB_KHR) Display* display; Window xlib_window; Atom xlib_wm_delete_window; xcb_connection_t* connection; xcb_screen_t* screen; xcb_window_t xcb_window; xcb_intern_atom_reply_t* atom_wm_delete_window; #elif defined(VK_USE_PLATFORM_FUCHSIA) && defined(CUBE_USE_IMAGE_PIPE) std::unique_ptr<FuchsiaState> fuchsia_state; #endif VkSurfaceKHR surface; bool prepared; bool use_staging_buffer; bool use_xlib; bool separate_present_queue; VkInstance inst; VkPhysicalDevice gpu; VkDevice device; VkQueue graphics_queue; VkQueue present_queue; uint32_t graphics_queue_family_index; uint32_t present_queue_family_index; VkSemaphore image_acquired_semaphores[FRAME_LAG]; VkSemaphore draw_complete_semaphores[FRAME_LAG]; VkSemaphore image_ownership_semaphores[FRAME_LAG]; VkPhysicalDeviceProperties gpu_props; VkQueueFamilyProperties* queue_props; VkPhysicalDeviceMemoryProperties memory_properties; uint32_t enabled_extension_count; uint32_t enabled_layer_count; const char* extension_names[64]; const char* enabled_layers[64]; uint32_t width, height; VkFormat format; VkColorSpaceKHR color_space; PFN_vkGetPhysicalDeviceSurfaceSupportKHR fpGetPhysicalDeviceSurfaceSupportKHR; PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR fpGetPhysicalDeviceSurfaceCapabilitiesKHR; PFN_vkGetPhysicalDeviceSurfaceFormatsKHR fpGetPhysicalDeviceSurfaceFormatsKHR; PFN_vkGetPhysicalDeviceSurfacePresentModesKHR fpGetPhysicalDeviceSurfacePresentModesKHR; PFN_vkGetPhysicalDeviceFeatures2KHR fpGetPhysicalDeviceFeatures2KHR; PFN_vkCreateSwapchainKHR fpCreateSwapchainKHR; PFN_vkDestroySwapchainKHR fpDestroySwapchainKHR; PFN_vkGetSwapchainImagesKHR fpGetSwapchainImagesKHR; PFN_vkAcquireNextImageKHR fpAcquireNextImageKHR; PFN_vkQueuePresentKHR fpQueuePresentKHR; PFN_vkGetDeviceQueue2 fpGetDeviceQueue2; PFN_vkCreateSamplerYcbcrConversionKHR fpCreateSamplerYcbcrConversionKHR; uint32_t swapchainImageCount; VkSwapchainKHR swapchain; SwapchainBuffers* buffers; VkPresentModeKHR presentMode; VkFence fences[FRAME_LAG]; int frame_index; VkCommandPool cmd_pool; VkCommandPool present_cmd_pool; struct { VkFormat format; VkImage image; VkMemoryAllocateInfo mem_alloc; VkDeviceMemory mem; VkImageView view; } depth; struct texture_object textures[DEMO_TEXTURE_COUNT]; struct texture_object staging_texture; struct { VkBuffer buf; VkMemoryAllocateInfo mem_alloc; VkDeviceMemory mem; VkDescriptorBufferInfo buffer_info; } uniform_data; VkCommandBuffer cmd; // Buffer for initialization commands VkPipelineLayout pipeline_layout; VkDescriptorSetLayout desc_layout; VkPipelineCache pipelineCache; VkRenderPass render_pass; VkPipeline pipeline; mat4x4 projection_matrix; mat4x4 view_matrix; mat4x4 model_matrix; float spin_angle; float spin_increment; bool pause; VkShaderModule vert_shader_module; VkShaderModule frag_shader_module; VkDescriptorPool desc_pool; VkDescriptorSet desc_set; VkFramebuffer* framebuffers; bool quit; int32_t curFrame; int32_t frameCount; bool validate; bool use_break; bool suppress_popups; bool protected_output = false; PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallback; PFN_vkDestroyDebugReportCallbackEXT DestroyDebugReportCallback; VkDebugReportCallbackEXT msg_callback; PFN_vkDebugReportMessageEXT DebugReportMessage; uint32_t current_buffer; uint32_t queue_family_count; }; int test_vk_cube(int argc, char** argv); void demo_init_vk_swapchain(struct demo* demo); void demo_prepare(struct demo* demo); void demo_update_data_buffer(struct demo* demo); void demo_draw(struct demo* demo); void demo_init(struct demo* demo, int argc, char** argv); void demo_cleanup(struct demo* demo);
1.570313
2
lib/got_lib_diff.h
ThomasAdam/gameoftrees
1
7997675
/* * Copyright (c) 2020 <NAME> <<EMAIL>> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "arraylist.h" #include "diff_main.h" #include "diff_output.h" enum got_diff_algorithm { GOT_DIFF_ALGORITHM_MYERS, GOT_DIFF_ALGORITHM_PATIENCE, }; enum got_diff_output_format { GOT_DIFF_OUTPUT_UNIDIFF, GOT_DIFF_OUTPUT_EDSCRIPT, }; struct got_diffreg_result { struct diff_result *result; FILE *f1; char *map1; size_t size1; FILE *f2; char *map2; size_t size2; struct diff_data left; struct diff_data right; }; #define GOT_DIFF_CONFLICT_MARKER_BEGIN "<<<<<<<" #define GOT_DIFF_CONFLICT_MARKER_ORIG "|||||||" #define GOT_DIFF_CONFLICT_MARKER_SEP "=======" #define GOT_DIFF_CONFLICT_MARKER_END ">>>>>>>" const struct got_error *got_diff_get_config(struct diff_config **, enum got_diff_algorithm, diff_atomize_func_t, void *); const struct got_error *got_diff_prepare_file(FILE *, char **, size_t *, struct diff_data *, const struct diff_config *, int, int); const struct got_error *got_diffreg(struct got_diffreg_result **, FILE *, FILE *, enum got_diff_algorithm, int, int); const struct got_error *got_diffreg_output(off_t **, size_t *, struct got_diffreg_result *, int, int, const char *, const char *, enum got_diff_output_format, int, FILE *); const struct got_error *got_diffreg_result_free(struct got_diffreg_result *); const struct got_error *got_diffreg_result_free_left( struct got_diffreg_result *); const struct got_error *got_diffreg_result_free_right( struct got_diffreg_result *); const struct got_error *got_diffreg_close(FILE *, char *, size_t, FILE *, char *, size_t); const struct got_error *got_merge_diff3(int *, int, const char *, const char *, const char *, const char *, const char *, const char *); const struct got_error *got_diff_files(struct got_diffreg_result **, FILE *, const char *, FILE *, const char *, int, int, int, FILE *);
1.515625
2
Engine/Source/ThirdParty/PhysX/APEX_1.4/include/clothing/ClothingPhysicalMesh.h
windystrife/UnrealEngine_NVIDIAGameWork
1
7997683
/* * Copyright (c) 2008-2017, NVIDIA CORPORATION. All rights reserved. * * NVIDIA CORPORATION and its licensors retain all intellectual property * and proprietary rights in and to this software, related documentation * and any modifications thereto. Any use, reproduction, disclosure or * distribution of this software and related documentation without an express * license agreement from NVIDIA CORPORATION is strictly prohibited. */ #ifndef CLOTHING_PHYSICAL_MESH_H #define CLOTHING_PHYSICAL_MESH_H #include "ApexInterface.h" #include "IProgressListener.h" namespace nvidia { namespace apex { /** \brief Constrain coefficients of the physical mesh vertices */ struct ClothingConstrainCoefficients { float maxDistance; ///< \brief Maximum distance a vertex is allowed to move float collisionSphereRadius; ///< \brief Backstop sphere radius float collisionSphereDistance; ///< \brief Backstop sphere distance }; PX_PUSH_PACK_DEFAULT /** \brief Contains the data for handing out statistics about a ClothingPhysicalMesh */ struct ClothingPhysicalMeshStats { /// the number of bytes allocated for the physical mesh uint32_t totalBytes; /// the number of vertices uint32_t numVertices; /// the number of indices uint32_t numIndices; }; /** \brief Holder for a physical mesh, this can be generated through various ways (see single- and multi-layered clothing) or hand crafted */ class ClothingPhysicalMesh : public ApexInterface { public: /** \brief returns the number of vertices */ virtual uint32_t getNumVertices() const = 0; /** \brief returns the number of simulated vertices */ virtual uint32_t getNumSimulatedVertices() const = 0; /** \brief returns the number of vertices with zero max distance */ virtual uint32_t getNumMaxDistance0Vertices() const = 0; /** \brief returns the number of indices */ virtual uint32_t getNumIndices() const = 0; /** \brief returns the number of simulated indices */ virtual uint32_t getNumSimulatedIndices() const = 0; /** \brief writes the indices to a destination buffer \param [out] indexDestination destination buffer where to write the indices \param [in] byteStride stride of the destination buffer \param [in] numIndices number of indices the buffer can hold. This can be smaller than getNumIndices() */ virtual void getIndices(void* indexDestination, uint32_t byteStride, uint32_t numIndices) const = 0; /** \brief returns whether the mesh is built out of tetrahedra or triangles */ virtual bool isTetrahedralMesh() const = 0; /** \brief This will simplify the current mesh. \param [in] subdivisions used to derive the maximal length a new edge can get.<br> Divide the bounding box diagonal by this value to get the maximal edge length for newly created edges<br> Use 0 to not restrict the maximal edge length \param [in] maxSteps The maximum number of edges to be considered for simplification.<br> Use 0 to turn off \param [in] maxError The maximal quadric error an edge can cause to be considered simplifyable.<br> Use any value < 0 to turn off \param [in] progress Callback class that will be fired every now and then to update a progress bar in the gui. \return The number of edges collapsed */ virtual void simplify(uint32_t subdivisions, int32_t maxSteps, float maxError, IProgressListener* progress) = 0; /** \brief Create a physical mesh from scratch Overwrites all vertices/indices, and invalidates all misc vertex buffers. vertices must be PxVec3 and indices uint32_t. If driveChannels is NULL, all vertices are assigned to all drive channels (initialized to 0xffffffff) */ virtual void setGeometry(bool tetraMesh, uint32_t numVertices, uint32_t vertexByteStride, const void* vertices, const uint32_t* driveChannels, uint32_t numIndices, uint32_t indexByteStride, const void* indices) = 0; // direct access to specific buffers /** \brief writes the indices into a user specified buffer. Returns false if the buffer doesn't exist. The buffer must be bigger than sizeof(uint32_t) * getNumIndices() */ virtual bool getIndices(uint32_t* indices, uint32_t byteStride) const = 0; /** \brief Writes the vertex positions into a user specified buffer. Returns false if the buffer doesn't exist. The buffer must be bigger than sizeof(PxVec3) * getNumVertices() */ virtual bool getVertices(PxVec3* vertices, uint32_t byteStride) const = 0; /** \brief Writes the normals into a user specified buffer. Returns false if the buffer doesn't exist. The buffer must be bigger than sizeof(PxVec3) * getNumVertices() */ virtual bool getNormals(PxVec3* normals, uint32_t byteStride) const = 0; /** \brief Returns the number of bones per vertex. */ virtual uint32_t getNumBonesPerVertex() const = 0; /** \brief Writes the bone indices into a user specified buffer. Returns false if the buffer doesn't exist. The buffer must be bigger than sizeof(uint16_t) * getNumVertices() * getNumBonesPerVertex(). (numBonesPerVertex is the same as in the graphical mesh for LOD 0) The bytestride is applied only after writing numBonesPerVertex and thus must be >= sizoef(uint16_t) * numBonesPerVertex */ virtual bool getBoneIndices(uint16_t* boneIndices, uint32_t byteStride) const = 0; /** \brief Writes the bone weights into a user specified buffer. Returns false if the buffer doesn't exist. The buffer must be bigger than sizeof(float) * getNumVertices() * getNumBonesPerVertex(). (numBonesPerVertex is the same as in the graphical mesh for LOD 0) The bytestride is applied only after writing numBonesPerVertex and thus must be >= sizoef(float) * numBonesPerVertex */ virtual bool getBoneWeights(float* boneWeights, uint32_t byteStride) const = 0; /** \brief Allocates and initializes the drive channels (master flags) of the physics mesh. This allows to set the drive channels directly on the physics mesh. */ virtual void allocateMasterFlagsBuffer() = 0; /** \brief Returns the masterFlag buffer pointer in order to edit the values. This allows to set values directly on the physics mesh. */ virtual uint32_t* getMasterFlagsBuffer() = 0; /** \brief Allocates and initializes the constrain coefficients of the physics mesh. This allows to set the constrain coefficients like maxDistance directly on the physics mesh. If this is not called by the authoring tool, the constrain coefficients are read from the graphical mesh. */ virtual void allocateConstrainCoefficientBuffer() = 0; /** \brief Returns the constrain coefficient buffer pointer in order to edit the values. This allows to set the constrain coefficients like maxDistance directly on the physics mesh. */ virtual ClothingConstrainCoefficients* getConstrainCoefficientBuffer() const = 0; /** \brief Writes the cloth constrain coefficients into a user specified buffer. Returns false if the buffer doesn't exist. The buffer must be bigger than sizeof(ClothingConstrainCoefficients) * getNumVertices(). */ virtual bool getConstrainCoefficients(ClothingConstrainCoefficients* coeffs, uint32_t byteStride) const = 0; /** \brief Returns stats (sizes, counts) for the asset. See ClothingPhysicalMeshStats. */ virtual void getStats(ClothingPhysicalMeshStats& stats) const = 0; }; PX_POP_PACK } } // namespace nvidia #endif // CLOTHING_PHYSICAL_MESH_H
1.484375
1
tests/nonsmoke/functional/CompileTests/OpenMP_tests/matrixmultiply-ompacc2.c
ouankou/rose
488
7997691
/* Naive matrix-matrix multiplication(mmm) multiple GPUs, standard OpenMP 4.0 directives By <NAME> */ #include <stdio.h> #include <assert.h> #include <omp.h> #define N 1024 #define M 1024 #define K 1024 #define REAL float int i,j,k; REAL a[N][M],b[M][K],c[N][K], c2[N][K]; int init(); int mmm(); int mmm2(); int verify(); //#define MAX_GPU_COUNT 4 int main(void) { init(); mmm(); mmm2(); return verify(); } int init() { for (i=0;i<N;i++) for(j=0;j<M;j++) a[i][j]=3.0*i*j/N/M; for (i=0;i<M;i++) for(j=0;j<K;j++) b[i][j]=5.0*j*i/N/M; for (i=0;i<N;i++) for(j=0;j<K;j++) { c[i][j]=0.0; c2[i][j]=0.0; } return 0; } /* TODO: try different i,j,k orders a b e f a*e+ b*g , a*f+ b*h c d x g h = c*e+ d*g, c*f+ d*h */ int mmm() { int GPU_N , idev; int n = N; // GPU_N = xomp_get_num_devices(); GPU_N = 1; printf("CUDA-capable device count: %i\n", GPU_N); #if 0 if (GPU_N > MAX_GPU_COUNT) { GPU_N = MAX_GPU_COUNT; } assert (GPU_N>0 && GPU_N<=MAX_GPU_COUNT); #endif omp_set_num_threads(GPU_N); #pragma omp parallel shared (GPU_N, a, b, c, n) private(idev) // for (idev = 0; idev < GPU_N; idev++) { int tid = omp_get_thread_num(); // cudaSetDevice(tid); xomp_set_default_device (tid); long size ; long offset; #if 0 int size = n / GPU_N; int offset = size * tid; if(tid < n%GPU_N) { size++; } if(tid >= n%GPU_N) offset += n%GPU_N; else offset += tid; #endif XOMP_static_even_divide (0, n, GPU_N, tid, &offset, &size); printf("thread %d working on GPU devices %d with size %ld copying data from y_ompacc with offset %ld\n",tid, tid, size,offset); int i, j, k; #pragma omp target device (tid) map(tofrom:c[offset:size][0:n]), map(to:a[offset:size][0:n],b[0:n][0:n], offset,size,n) #pragma omp parallel for private(i,j,k) shared (a,b,c, n, offset, size) for (i = offset; i < offset + size; i++) for (j = 0; j < M; j++) for (k = 0; k < K; k++) c[i][j]= c[i][j]+a[i][k]*b[k][j]; } return 0; } int mmm2() { for (i = 0; i < N; i++) for (j = 0; j < M; j++) for (k = 0; k < K; k++) c2[i][j]= c2[i][j]+a[i][k]*b[k][j]; return 0; } int verify() { REAL sum=0.0, sum2=0.0; for (i=0;i<N;i++) for(j=0;j<K;j++) { sum+=c[i][j]; sum2+=c2[i][j]; } printf("sum of c[i][j] is %f\n",sum); printf("sum of c2[i][j] is %f\n",sum2); assert (sum == sum2); return 0; }
2.171875
2
WRK-V1.2/tests/palsuite/exception_handling/pal_except_filter_ex/test1/pal_except_filter_ex.c
intj-t/openvmsft
0
7997699
/*===================================================================== ** ** Source: PAL_EXCEPT_FILTER_EX.c (test 1) ** ** Purpose: Tests the PAL implementation of the PAL_EXCEPT_FILTER_EX. ** There are two try blocks in this test. The first forces an ** exception error to force hitting the first filter. The second ** doesn't to make sure we don't hit the filter. A value is also ** passed into the filter program and it is validated to make sure ** it was passed correctly. ** ** ** Copyright (c) 2006 Microsoft Corporation. All rights reserved. ** ** The use and distribution terms for this software are contained in the file ** named license.txt, which can be found in the root of this distribution. ** By using this software in any fashion, you are agreeing to be bound by the ** terms of this license. ** ** You must not remove this notice, or any other, from this software. ** ** **===================================================================*/ #include <palsuite.h> BOOL bFilter = FALSE; BOOL bTry = FALSE; const int nValidator = 12321; /** ** ** Filter function for the first try block ** **/ LONG Filter_01(EXCEPTION_POINTERS* ep, VOID *pnTestInt) { int nTestInt = *(int *)pnTestInt; /* let the main know we've hit the filter function */ bFilter = TRUE; if (!bTry) { Fail("PAL_EXCEPT_FILTER_EX: ERROR -> Something weird is going on." " The filter was hit without PAL_TRY being hit.\n"); } /* was the correct value passed? */ if (nValidator != nTestInt) { Fail("PAL_EXCEPT_FILTER_EX: ERROR -> Parameter passed to filter" " function should have been \"%d\" but was \"%d\".\n", nValidator, nTestInt); } return EXCEPTION_EXECUTE_HANDLER; } /** ** ** Filter function for the second try block. We shouldn't ** hit this function. ** **/ LONG Filter_02(EXCEPTION_POINTERS* ep, VOID *pnTestInt) { /* let the main know we've hit the filter function */ bFilter = TRUE; return EXCEPTION_EXECUTE_HANDLER; } int __cdecl main(int argc, char *argv[]) { int* p = 0x00000000; BOOL bExcept = FALSE; if (0 != PAL_Initialize(argc, argv)) { return FAIL; } /* ** test to make sure we get into the exception block */ PAL_TRY { if (bExcept) { Fail("PAL_EXCEPT_FILTER_EX: ERROR -> Something weird is going on." " The first PAL_EXCEPT_FILTER_EX was hit before PAL_TRY.\n"); } bTry = TRUE; /* indicate we hit the PAL_TRY block */ *p = 13; /* causes an access violation exception */ Fail("PAL_EXCEPT_FILTER_EX: ERROR -> code was executed after the " "access violation.\n"); } PAL_EXCEPT_FILTER(Filter_01, (LPVOID)&nValidator) { if (!bTry) { Fail("PAL_EXCEPT_FILTER_EX: ERROR -> Something weird is going on." " PAL_EXCEPT_FILTER_EX was hit without PAL_TRY being hit.\n"); } bExcept = TRUE; /* indicate we hit the PAL_EXCEPT_FILTER_EX block */ } PAL_ENDTRY; if (!bTry) { Trace("PAL_EXCEPT_FILTER_EX: ERROR -> It appears the code in the " "first PAL_TRY block was not executed.\n"); } if (!bExcept) { Trace("PAL_EXCEPT_FILTER_EX: ERROR -> It appears the code in the " "first PAL_EXCEPT_FILTER_EX block was not executed.\n"); } if (!bFilter) { Trace("PAL_EXCEPT_FILTER_EX: ERROR -> It appears the code in the first" " filter function was not executed.\n"); } /* did we hit all the code blocks? */ if(!bTry || !bExcept || !bFilter) { Fail(""); } bTry = bExcept = bFilter = FALSE; /* ** test to make sure we skip the exception block */ PAL_TRY { if (bExcept) { Fail("PAL_EXCEPT_FILTER_EX: ERROR -> Something weird is going on." " Second PAL_EXCEPT_FILTER_EX was hit before PAL_TRY.\n"); } bTry = TRUE; /* indicate we hit the PAL_TRY block */ } PAL_EXCEPT_FILTER(Filter_02, (LPVOID)&nValidator) { if (!bTry) { Fail("PAL_EXCEPT_FILTER_EX: ERROR -> Something weird is going on." " PAL_EXCEPT_FILTER_EX was hit without PAL_TRY being hit.\n"); } bExcept = TRUE; /* indicate we hit the PAL_EXCEPT_FILTER_EX block */ } PAL_ENDTRY; if (!bTry) { Trace("PAL_EXCEPT_FILTER_EX: ERROR -> It appears the code in the " "second PAL_TRY block was not executed.\n"); } if (bExcept) { Trace("PAL_EXCEPT_FILTER_EX: ERROR -> It appears the code in the " "second PAL_EXCEPT_FILTER_EX block was executed even though an" " exception was not triggered.\n"); } if (bFilter) { Trace("PAL_EXCEPT_FILTER_EX: ERROR -> It appears the code in the second" " filter function was executed even though an exception was" " not triggered.\n"); } /* did we hit all the correct code blocks? */ if(!bTry || bExcept || bFilter) { Fail(""); } PAL_Terminate(); return PASS; }
1.8125
2
modules/scene_manager/include/map_msgs/srv/dds_connext/GetPointMapROI_Response_.h
Omnirobotic/godot
0
7997707
/* WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. This file was generated from GetPointMapROI_Response_.idl using "rtiddsgen". The rtiddsgen tool is part of the RTI Connext distribution. For more information, type 'rtiddsgen -help' at a command shell or consult the RTI Connext manual. */ #ifndef GetPointMapROI_Response__769878379_h #define GetPointMapROI_Response__769878379_h #ifndef NDDS_STANDALONE_TYPE #ifndef ndds_cpp_h #include "ndds/ndds_cpp.h" #endif #else #include "ndds_standalone_type.h" #endif #include "sensor_msgs/msg/dds_connext/PointCloud2_.h" namespace map_msgs { namespace srv { namespace dds_ { extern const char *GetPointMapROI_Response_TYPENAME; struct GetPointMapROI_Response_Seq; #ifndef NDDS_STANDALONE_TYPE class GetPointMapROI_Response_TypeSupport; class GetPointMapROI_Response_DataWriter; class GetPointMapROI_Response_DataReader; #endif class GetPointMapROI_Response_ { public: typedef struct GetPointMapROI_Response_Seq Seq; #ifndef NDDS_STANDALONE_TYPE typedef GetPointMapROI_Response_TypeSupport TypeSupport; typedef GetPointMapROI_Response_DataWriter DataWriter; typedef GetPointMapROI_Response_DataReader DataReader; #endif sensor_msgs::msg::dds_::PointCloud2_ sub_map_ ; }; #if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT_map_msgs) /* If the code is building on Windows, start exporting symbols. */ #undef NDDSUSERDllExport #define NDDSUSERDllExport __declspec(dllexport) #endif NDDSUSERDllExport DDS_TypeCode* GetPointMapROI_Response__get_typecode(void); /* Type code */ DDS_SEQUENCE(GetPointMapROI_Response_Seq, GetPointMapROI_Response_); NDDSUSERDllExport RTIBool GetPointMapROI_Response__initialize( GetPointMapROI_Response_* self); NDDSUSERDllExport RTIBool GetPointMapROI_Response__initialize_ex( GetPointMapROI_Response_* self,RTIBool allocatePointers,RTIBool allocateMemory); NDDSUSERDllExport RTIBool GetPointMapROI_Response__initialize_w_params( GetPointMapROI_Response_* self, const struct DDS_TypeAllocationParams_t * allocParams); NDDSUSERDllExport void GetPointMapROI_Response__finalize( GetPointMapROI_Response_* self); NDDSUSERDllExport void GetPointMapROI_Response__finalize_ex( GetPointMapROI_Response_* self,RTIBool deletePointers); NDDSUSERDllExport void GetPointMapROI_Response__finalize_w_params( GetPointMapROI_Response_* self, const struct DDS_TypeDeallocationParams_t * deallocParams); NDDSUSERDllExport void GetPointMapROI_Response__finalize_optional_members( GetPointMapROI_Response_* self, RTIBool deletePointers); NDDSUSERDllExport RTIBool GetPointMapROI_Response__copy( GetPointMapROI_Response_* dst, const GetPointMapROI_Response_* src); #if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT_map_msgs) /* If the code is building on Windows, stop exporting symbols. */ #undef NDDSUSERDllExport #define NDDSUSERDllExport #endif } /* namespace dds_ */ } /* namespace srv */ } /* namespace map_msgs */ #endif /* GetPointMapROI_Response_ */
0.726563
1
MoltenVK/MoltenVK/Layers/MVKExtensions.h
playbar/MoltenVK
0
7997715
/* * MVKExtensions.h * * Copyright (c) 2014-2019 The Brenwill Workshop Ltd. (http://www.brenwill.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include "MVKBaseObject.h" #include <string> #pragma mark - #pragma mark MVKExtension /** Describes a Vulkan extension and whether or not it is enabled or supported. */ struct MVKExtension { bool enabled = false; VkExtensionProperties* pProperties; MVKExtension(VkExtensionProperties* pProperties, bool enableForPlatform = false); }; #pragma mark - #pragma mark MVKExtensionList /** * A fixed list of the Vulkan extensions known to MoltenVK, with * an indication of whether each extension is supported/enabled. * * To add support for a Vulkan extension, add a variable to this list. */ class MVKExtensionList : public MVKBaseObject { public: /** Returns the Vulkan API opaque object controlling this object. */ MVKVulkanAPIObject* getVulkanAPIObject() override { return _apiObject->getVulkanAPIObject(); }; union { struct { #define MVK_EXTENSION(var, EXT) MVKExtension vk_ ##var; #include "MVKExtensions.def" }; MVKExtension extensionArray; }; /** Returns the total number of extensions that are tracked by this object. */ uint32_t getCount() const { return _count; } /** Returns the number of extensions that are enabled. */ uint32_t getEnabledCount() const; /** Returns whether the named extension is enabled. */ bool isEnabled(const char* extnName) const; /** Enables the named extension. */ void enable(const char* extnName); /** * Enables the named extensions. * * If parent is non null, the extension must also be enabled in the parent in order * for it to be enabled here. If it is not enabled in the parent, an error is logged * and returned. Returns VK_SUCCESS if all requested extensions were able to be enabled. */ VkResult enable(uint32_t count, const char* const* names, MVKExtensionList* parent = nullptr); /** * Returns a string containing the names of the enabled extensions, separated by the separator string. * If prefixFirstWithSeparator is true the separator will also appear before the first extension name. */ std::string enabledNamesString(const char* separator = " ", bool prefixFirstWithSeparator = false) const; MVKExtensionList(MVKVulkanAPIObject* apiObject, bool enableForPlatform = false); protected: void initCount(); MVKVulkanAPIObject* _apiObject; uint32_t _count; };
1.03125
1
src/add-ons/media/media-add-ons/opensound/OpenSoundDeviceEngine.h
Kirishikesan/haiku
1,338
7997723
/* * OpenSound media addon for BeOS and Haiku * * Copyright (c) 2007, <NAME> (<EMAIL>) * Distributed under the terms of the MIT License. */ #ifndef _OPENSOUNDDEVICEENGINE_H #define _OPENSOUNDDEVICEENGINE_H #include "OpenSoundDevice.h" class OpenSoundDeviceEngine { public: OpenSoundDeviceEngine(oss_audioinfo *info); virtual ~OpenSoundDeviceEngine(void); virtual status_t InitCheck(void) const; int FD() const { return fFD; }; const oss_audioinfo *Info() const { return &fAudioInfo; }; status_t Open(int mode/* OPEN_* */); status_t Close(); //BDadaIO... virtual ssize_t Read(void *buffer, size_t size); virtual ssize_t Write(const void *buffer, size_t size); /* chain of engines for the same physical in/out */ OpenSoundDeviceEngine *NextPlay() const { return fNextPlay; }; OpenSoundDeviceEngine *NextRec() const { return fNextRec; }; int OpenMode() const { return fOpenMode; }; bool InUse() const { return (fOpenMode != 0); }; status_t UpdateInfo(); // shortcuts int Caps() const { return fAudioInfo.caps; }; bigtime_t CardLatency(void) const { return (fAudioInfo.latency < 0) ? 0 : fAudioInfo.latency; }; bigtime_t PlaybackLatency(void); bigtime_t RecordingLatency(void); int GetChannels(void); status_t SetChannels(int chans); int GetFormat(void); status_t SetFormat(int fmt); int GetSpeed(void); status_t SetSpeed(int speed); void GetMediaFormat(media_format &format); size_t GetISpace(audio_buf_info *info=NULL); size_t GetOSpace(audio_buf_info *info=NULL); int64 GetCurrentIPtr(int32* fifoed = NULL, oss_count_t* info = NULL); int64 GetCurrentOPtr(int32* fifoed = NULL, size_t* fragmentPos = NULL); int32 GetIOverruns(); int32 GetOUnderruns(); size_t DriverBufferSize() const; status_t StartRecording(void); // suggest possibles status_t WildcardFormatFor(int fmt, media_format &format, bool rec=false); // suggest best status_t PreferredFormatFor(int fmt, media_format &format, bool rec=false); // try this format status_t AcceptFormatFor(int fmt, media_format &format, bool rec=false); // apply this format status_t SpecializeFormatFor(int fmt, media_format &format, bool rec=true); private: status_t fInitCheckStatus; oss_audioinfo fAudioInfo; friend class OpenSoundAddOn; OpenSoundDeviceEngine *fNextPlay; OpenSoundDeviceEngine *fNextRec; int fOpenMode; // OPEN_* int fFD; media_format fMediaFormat; int64 fPlayedFramesCount; bigtime_t fPlayedRealTime; size_t fDriverBufferSize; }; #endif
1.273438
1
mod_mshield_redis.c
MarkovShield/mod_mshield
0
7997731
/** * @file mod_mshield_redis.c * @author <NAME> * @date 2. May 2017 * @brief File containing mod_mshield Redis related code. */ #include "mod_mshield.h" /** * @brief Helper function which calculates the time diff between two timespec structs in nanoseconds. * * @param timeA_p The first and bigger (newer) timespec. * @param timeB_p The second and smaller (older) timespec. * * @return nanoseconds difference between \p timeA_p and \p timeB_p */ int64_t timespecDiff(struct timespec *timeA_p, struct timespec *timeB_p) { return ((timeA_p->tv_sec * 1000000000) + timeA_p->tv_nsec) - ((timeB_p->tv_sec * 1000000000) + timeB_p->tv_nsec); } /** * @brief Function to handle redis replies. * * @param reply The Redis reply which was created from redisCommand(). * @param request The apache request which we possibly need to redirect. * @param session Current session of the request. * * @return STATUS_ERROR If reply was NULL or Redis didn't provide 3 elements inside the reply. * @return STATUS_REDIRERR If the request redirection failed. * @return STATUS_OK If MOD_MSHIELD_RESULT_OK was received from Redis and the request redirection was successful. * @return HTTP_MOVED_TEMPORARILY If MOD_MSHIELD_RESULT_FRAUD or MOD_MSHIELD_RESULT_SUSPICIOUS was received from redis * and the redirection was successful. */ apr_status_t handle_mshield_result(void *reply, void *request, session_t *session) { redisReply *redis_reply = reply; request_rec *r = (request_rec *) request; apr_status_t status; mod_mshield_server_t *config; config = ap_get_module_config(r->server->module_config, &mshield_module); if (reply == NULL) { return STATUS_ERROR; } if (redis_reply->type == REDIS_REPLY_ARRAY && redis_reply->elements == 3) { ap_log_error(PC_LOG_DEBUG, NULL, "FRAUD-ENGINE: Waiting for redis result for request [%s]...", apr_table_get(r->subprocess_env, "UNIQUE_ID")); for (int j = 0; j < redis_reply->elements; j++) { if (redis_reply->element[j]->str) { ap_log_error(PC_LOG_DEBUG, NULL, "FRAUD-ENGINE: Redis psubscribe [%u] %s", j, redis_reply->element[j]->str); /* MOD_MSHIELD_RESULT_OK will be the case in most of the time. Therefore check this first. */ if (strcmp(redis_reply->element[j]->str, MOD_MSHIELD_RESULT_OK) == 0) { ap_log_error(PC_LOG_INFO, NULL, "FRAUD-ENGINE: Engine result for request [%s] is [%s]", apr_table_get(r->subprocess_env, "UNIQUE_ID"), MOD_MSHIELD_RESULT_OK); return STATUS_OK; } if (strcmp(redis_reply->element[j]->str, MOD_MSHIELD_RESULT_SUSPICIOUS) == 0) { ap_log_error(PC_LOG_INFO, NULL, "FRAUD-ENGINE: Engine result for request [%s] is [%s]", apr_table_get(r->subprocess_env, "UNIQUE_ID"), MOD_MSHIELD_RESULT_SUSPICIOUS); ap_log_error(PC_LOG_INFO, NULL, "Current auth_strength of session is [%d]", session->data->auth_strength); if (session->data->auth_strength < 2) { status = mod_mshield_redirect_to_relurl(r, config->global_logon_server_url_2); if (status == HTTP_MOVED_TEMPORARILY) { ap_log_error(PC_LOG_DEBUG, NULL, "FRAUD-ENGINE: Redirection to global_logon_server_url_2 was successful"); return status; } else { ap_log_error(PC_LOG_CRIT, NULL, "FRAUD-ENGINE: Redirection to global_logon_server_url_2 failed"); return STATUS_REDIRERR; } } return STATUS_OK; } if (strcmp(redis_reply->element[j]->str, MOD_MSHIELD_RESULT_FRAUD) == 0) { ap_log_error(PC_LOG_INFO, NULL, "FRAUD-ENGINE: Engine result for request [%s] is [%s]", apr_table_get(r->subprocess_env, "UNIQUE_ID"), MOD_MSHIELD_RESULT_FRAUD); status = mod_mshield_redirect_to_relurl(r, config->fraud_detected_url); /* Drop the fraudly session! */ mshield_session_unlink(session); if (status == HTTP_MOVED_TEMPORARILY) { ap_log_error(PC_LOG_DEBUG, NULL, "FRAUD-ENGINE: Redirection to fraud_detected_url was successful"); return status; } else { ap_log_error(PC_LOG_CRIT, NULL, "FRAUD-ENGINE: Redirection to fraud_detected_url failed"); return STATUS_REDIRERR; } } } } } return STATUS_ERROR; }
1.515625
2
source/PPICLF_SOLN.h
dpzwick/ppiclF
20
7997739
#include "PPICLF_USER.h" #include "PPICLF_STD.h" c Computational particles REAL*8 PPICLF_Y (PPICLF_LRS ,PPICLF_LPART) ! Solution > ,PPICLF_YDOT (PPICLF_LRS ,PPICLF_LPART) ! Total solution RHS > ,PPICLF_YDOTC (PPICLF_LRS ,PPICLF_LPART) ! Coupled solution RHS > ,PPICLF_RPROP (PPICLF_LRP ,PPICLF_LPART) ! Real particle properties > ,PPICLF_RPROP2(PPICLF_LRP2,PPICLF_LPART) ! Secondary real particle properties COMMON /PPICLF_SLN_CURRENT_R/ PPICLF_Y > ,PPICLF_YDOT > ,PPICLF_YDOTC > ,PPICLF_RPROP > ,PPICLF_RPROP2 INTEGER*4 PPICLF_IPROP(PPICLF_LIP,PPICLF_LPART) ! Integer particle properties COMMON /PPICLF_SLN_CURRENT_I/ PPICLF_IPROP COMMON /PPICLF_SLN_CURRENT_N/ PPICLF_NPART INTEGER*4 PPICLF_NPART c Previous time step solutions, may grow later REAL*8 PPICLF_Y1(PPICLF_LRS*PPICLF_LPART) COMMON /PPICLF_SLN_PREVIOUS_R/ PPICLF_Y1
1.148438
1
include/bsdk_math.h
DarthUdp/BareSDK
1
7997747
/** * This file is part of BareSDK and licensed under the: * BSD 3-Clause License * Copyright (c) 2021, <NAME> * All rights reserved. */ #ifndef BSDK_MATH_H_ #define BSDK_MATH_H_ #include <stddef.h> #include <stdint.h> #include <stdbool.h> #define bsdk_min(A, B) ((A) < (B) ? (A):(B)) #define bsdk_max(A, B) ((A) > (B) ? (A):(B)) extern uint64_t bsdk_exp(uint32_t base, uint16_t exp); #endif//BSDK_MATH_H_
0.953125
1
Example/BLEKitTestApp/UPCustomAction.h
abathingchris/blekit-ios
0
7997755
// // UPCustomAction.h // BLEKitTestApp // // Created by <NAME> on 22/01/14. // Copyright (c) 2014 Upnext. All rights reserved. // #import "BLEAction.h" static NSString * const UPCustomActionType = @"custom-alert"; @interface UPCustomAction : BLEAction <BLEAction> @end
0.445313
0
DirectXGame/DirectXCore/DxBase.h
nguyenlamlll/DirectX-11-Game
2
7997763
#pragma once #include "DeviceResources.h" #include "StepTimer.h" #include "Sound.h" #include <Audio.h> #include "Sprite.h" #include "Animation.h" #include "TileMap.h" #include "Scene.h" #include "Text.h" #include "Input.h" namespace DirectXCore { class DxBase : public IDeviceNotify { public: DxBase() noexcept(false); ~DxBase(); // Initialization and management void Initialize(HWND window, int width, int height); DeviceResources* GetDeviceResource() { return m_deviceResources.get(); } void CreateSoundAndMusic(const wchar_t* soundFileName, Sound** returnSound); void CreateCamera(Camera** returnCamera); void CreateTilemap(const wchar_t * tilemapSpriteName, TileMap** returnTilemap); void CreateSprite(const wchar_t* spriteName, Sprite** returnSprite); void CreateText(const wchar_t* fontPath, const wchar_t* content, Text** returnText); void InitializeWithScene(int index); void SwitchToScene(wchar_t* name); void SwitchToScene(int index); void AddScene(Scene* scene); // Basic game loop void Tick(); // IDeviceNotify virtual void OnDeviceLost() override; virtual void OnDeviceRestored() override; // Messages void OnActivated(); void OnDeactivated(); void OnSuspending(); void OnResuming(); void OnWindowMoved(); void OnWindowSizeChanged(int width, int height); void OnKeyUp(KeyCode); void OnKeyDown(KeyCode); // Recommended way to handle input (comparing with OnKeyUp and OnKeyDown). // Each scene should get the input manager and ask for key states during UpdateScene method. Input* GetInputManager() { return m_input.get(); } // Properties void GetDefaultSize(int& width, int& height) const; private: void Update(StepTimer const& timer); void Render(); void Clear(); void CreateDeviceDependentResources(); void CreateWindowSizeDependentResources(); // Device resources. std::unique_ptr<DeviceResources> m_deviceResources; std::shared_ptr<DirectX::AudioEngine> m_audioEngine; std::vector<DirectXCore::Sound> m_sounds; //Sprite *sprite; //Animation *animation; TileMap *tilemap; Camera* mainCamera; // Rendering loop timer. StepTimer m_timer; // Scenes void InitializeScenes(); std::vector<Scene*> m_scenes; Scene* m_activeScene; std::unique_ptr<Input> m_input; }; }
1.53125
2
src_VU/graphics/X_f/VUX_vxyplot_f.c
connorimes/tasp-vsipl-core-plus
9
7997771
/* SPAWARSYSCEN D881 */ /********************************************************************** // For TASP VSIPL Documentation and Code neither the United States / // Government, the United States Navy, nor any of their employees, / // makes any warranty, express or implied, including the warranties / // of merchantability and fitness for a particular purpose, or / // assumes any legal liability or responsibility for the accuracy, / // completeness, or usefulness of any information, apparatus, / // product, or process disclosed, or represents that its use would / // not infringe privately owned rights / **********************************************************************/ /* $Id: VUX_vxyplot_f.c,v 2.0 2003/02/22 15:20:00 judd Exp $ */ #include<stdio.h> #include<string.h> #include<vsip.h> #include<VUX.h> void VUX_vxyplot_f( VUX_graph_f* graph, vsip_vview_f* x, vsip_vview_f* y, vsip_scalar_bl bool) { vsip_length N = vsip_vgetlength_f(x), i; vsip_scalar_f xval,yval,xdelta,ydelta; int xpix,ypix; vsip_index index; if(bool || (graph->xmax == graph->xmin)){ graph->xmin = vsip_vminval_f(x,&index); graph->xmax = vsip_vmaxval_f(x,&index); graph->ymin = vsip_vminval_f(y,&index); graph->ymax = vsip_vmaxval_f(y,&index); } graph->xoff = (graph->xpixels - graph->xsize)/2 + (graph->xpixels - graph->xsize)%2; graph->yoff = (graph->ypixels - graph->ysize)/2 + (graph->ypixels - graph->ysize)%2; xdelta =graph->xmax - graph->xmin; ydelta =graph->ymax - graph->ymin; if(graph->axis_yn){ { /* draw x axis */ char str[20]; XDrawLine(graph->disp,graph->win,graph->gc, graph->xoff , graph->yoff + graph->ysize, graph->xoff + graph->xsize, graph->yoff + graph->ysize); for(i=0; i<=graph->num_xticks; i++) XDrawLine(graph->disp,graph->win,graph->gc, graph->xoff + i * graph->xsize/graph->num_xticks, graph->yoff + graph->ysize, graph->xoff + i * graph->xsize/graph->num_xticks, graph->yoff + graph->ysize -5); sprintf(str,graph->xformat,graph->xmin); XDrawString(graph->disp,graph->win,graph->gc, graph->xoff,graph->yoff + graph->ysize + graph->yoff/2,str,(int)strlen(str)); sprintf(str,graph->xformat,graph->xmax); XDrawString(graph->disp,graph->win, graph->gc, graph->xoff + graph->xsize - 20, graph->yoff + graph->ysize + graph->yoff/2,str,(int)strlen(str)); } { /* draw y axis */ char str[20]; XDrawLine(graph->disp,graph->win,graph->gc, graph->xoff, graph->yoff, graph->xoff, graph->yoff + graph->ysize); for(i=0; i<=graph->num_yticks; i++) XDrawLine(graph->disp,graph->win,graph->gc, graph->xoff, graph->yoff + i * graph->ysize/graph->num_yticks, graph->xoff +5, graph->yoff + i * graph->ysize/graph->num_yticks); sprintf(str,graph->yformat,graph->ymin); XDrawString(graph->disp,graph->win,graph->gc,0, graph->yoff + graph->ysize,str,(int)strlen(str)); sprintf(str,graph->yformat,graph->ymax); XDrawString(graph->disp,graph->win,graph->gc,0, graph->yoff,str,(int)strlen(str)); } } if(graph->title_yn ){ XDrawString(graph->disp,graph->win,graph->gc, graph->title_xloc,graph->title_yloc,graph->title,(int)strlen(graph->title)); } if(graph->xtitle_yn ){ XDrawString(graph->disp,graph->win,graph->gc, graph->xtitle_xloc,graph->xtitle_yloc,graph->xtitle,(int)strlen(graph->xtitle)); } if(graph->ytitle_yn ){ XDrawString(graph->disp,graph->win,graph->gc, graph->ytitle_xloc,graph->ytitle_yloc,graph->ytitle,(int)strlen(graph->ytitle)); } for(i=0; i<N; i++){ xval = vsip_vget_f(x,i); yval = vsip_vget_f(y,i); if((xval < graph->xmin) || (xval > graph->xmax))break; if((yval < graph->ymin) || (yval > graph->ymax))break; xpix = graph->xoff + (int)((vsip_scalar_f)graph->xsize * (xval - graph->xmin)/xdelta); ypix = graph->yoff + graph->ysize - (int)((vsip_scalar_f)graph->ysize * (yval - graph->ymin)/ydelta); XDrawPoint(graph->disp,graph->win,graph->gc,xpix,ypix); } XFlush(graph->disp); return; }
1.375
1
src/C/nss/nss-3.16.1/nss/cmd/multinit/multinit.c
GaloisInc/hacrypto
34
7997779
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include "nss.h" #include "secutil.h" #include "pk11pub.h" #include "cert.h" typedef struct commandDescriptStr { int required; char *arg; char *des; } commandDescript; enum optionNames { opt_liborder = 0, opt_mainDB, opt_lib1DB, opt_lib2DB, opt_mainRO, opt_lib1RO, opt_lib2RO, opt_mainCMD, opt_lib1CMD, opt_lib2CMD, opt_mainTokNam, opt_lib1TokNam, opt_lib2TokNam, opt_oldStyle, opt_verbose, opt_summary, opt_help, opt_last }; static const secuCommandFlag options_init[] = { { /* opt_liborder */ 'o', PR_TRUE, "1M2zmi", PR_TRUE, "order" }, { /* opt_mainDB */ 'd', PR_TRUE, 0, PR_FALSE, "main_db" }, { /* opt_lib1DB */ '1', PR_TRUE, 0, PR_FALSE, "lib1_db" }, { /* opt_lib2DB */ '2', PR_TRUE, 0, PR_FALSE, "lib2_db" }, { /* opt_mainRO */ 'r', PR_FALSE, 0, PR_FALSE, "main_readonly" }, { /* opt_lib1RO */ 0, PR_FALSE, 0, PR_FALSE, "lib1_readonly" }, { /* opt_lib2RO */ 0, PR_FALSE, 0, PR_FALSE, "lib2_readonly" }, { /* opt_mainCMD */ 'c', PR_TRUE, 0, PR_FALSE, "main_command" }, { /* opt_lib1CMD */ 0, PR_TRUE, 0, PR_FALSE, "lib1_command" }, { /* opt_lib2CMD */ 0, PR_TRUE, 0, PR_FALSE, "lib2_command" }, { /* opt_mainTokNam */'t', PR_TRUE, 0, PR_FALSE, "main_token_name" }, { /* opt_lib1TokNam */ 0, PR_TRUE, 0, PR_FALSE, "lib1_token_name" }, { /* opt_lib2TokNam */ 0, PR_TRUE, 0, PR_FALSE, "lib2_token_name" }, { /* opt_oldStype */ 's', PR_FALSE, 0, PR_FALSE, "oldStype" }, { /* opt_verbose */ 'v', PR_FALSE, 0, PR_FALSE, "verbose" }, { /* opt_summary */ 'z', PR_FALSE, 0, PR_FALSE, "summary" }, { /* opt_help */ 'h', PR_FALSE, 0, PR_FALSE, "help" } }; static const commandDescript options_des[] = { { /* opt_liborder */ PR_FALSE, "initOrder", " Specifies the order of NSS initialization and shutdown. Order is\n" " given as a string where each character represents either an init or\n" " a shutdown of the main program or one of the 2 test libraries\n" " (library 1 and library 2). The valid characters are as follows:\n" " M Init the main program\n 1 Init library 1\n" " 2 Init library 2\n" " m Shutdown the main program\n i Shutdown library 1\n" " z Shutdown library 2\n" }, { /* opt_mainDB */ PR_TRUE, "nss_db", " Specified the directory to open the nss database for the main\n" " program. Must be specified if \"M\" is given in the order string\n"}, { /* opt_lib1DB */ PR_FALSE, "nss_db", " Specified the directory to open the nss database for library 1.\n" " Must be specified if \"1\" is given in the order string\n"}, { /* opt_lib2DB */ PR_FALSE, "nss_db", " Specified the directory to open the nss database for library 2.\n" " Must be specified if \"2\" is given in the order string\n"}, { /* opt_mainRO */ PR_FALSE, NULL, " Open the main program's database read only.\n" }, { /* opt_lib1RO */ PR_FALSE, NULL, " Open library 1's database read only.\n" }, { /* opt_lib2RO */ PR_FALSE, NULL, " Open library 2's database read only.\n" }, { /* opt_mainCMD */ PR_FALSE, "nss_command", " Specifies the NSS command to execute in the main program.\n" " Valid commands are: \n" " key_slot, list_slots, list_certs, add_cert, none.\n" " Default is \"none\".\n" }, { /* opt_lib1CMD */ PR_FALSE, "nss_command", " Specifies the NSS command to execute in library 1.\n" }, { /* opt_lib2CMD */ PR_FALSE, "nss_command", " Specifies the NSS command to execute in library 2.\n" }, { /* opt_mainTokNam */PR_FALSE, "token_name", " Specifies the name of PKCS11 token for the main program's " "database.\n" }, { /* opt_lib1TokNam */PR_FALSE, "token_name", " Specifies the name of PKCS11 token for library 1's database.\n" }, { /* opt_lib2TokNam */PR_FALSE, "token_name", " Specifies the name of PKCS11 token for library 2's database.\n" }, { /* opt_oldStype */ PR_FALSE, NULL, " Use NSS_Shutdown rather than NSS_ShutdownContext in the main\n" " program.\n" }, { /* opt_verbose */ PR_FALSE, NULL, " Noisily output status to standard error\n" }, { /* opt_summarize */ PR_FALSE, NULL, "report a summary of the test results\n" }, { /* opt_help */ PR_FALSE, NULL, " give this message\n" } }; /* * output our short help (table driven). (does not exit). */ static void short_help(const char *prog) { int count = opt_last; int i,words_found; /* make sure all the tables are up to date before we allow compiles to * succeed */ PR_STATIC_ASSERT(sizeof(options_init)/sizeof(secuCommandFlag) == opt_last); PR_STATIC_ASSERT(sizeof(options_init)/sizeof(secuCommandFlag) == sizeof(options_des)/sizeof(commandDescript)); /* print the base usage */ fprintf(stderr,"usage: %s ",prog); for (i=0, words_found=0; i < count; i++) { if (!options_des[i].required) { fprintf(stderr,"["); } if (options_init[i].longform) { fprintf(stderr, "--%s", options_init[i].longform); words_found++; } else { fprintf(stderr, "-%c", options_init[i].flag); } if (options_init[i].needsArg) { if (options_des[i].arg) { fprintf(stderr," %s",options_des[i].arg); } else { fprintf(stderr," arg"); } words_found++; } if (!options_des[i].required) { fprintf(stderr,"]"); } if (i < count-1 ) { if (words_found >= 5) { fprintf(stderr,"\n "); words_found=0; } else { fprintf(stderr," "); } } } fprintf(stderr,"\n"); } /* * print out long help. like short_help, this does not exit */ static void long_help(const char *prog) { int i; int count = opt_last; short_help(prog); /* print the option descriptions */ fprintf(stderr,"\n"); for (i=0; i < count; i++) { fprintf(stderr," "); if (options_init[i].flag) { fprintf(stderr, "-%c", options_init[i].flag); if (options_init[i].longform) { fprintf(stderr,","); } } if (options_init[i].longform) { fprintf(stderr,"--%s", options_init[i].longform); } if (options_init[i].needsArg) { if (options_des[i].arg) { fprintf(stderr," %s",options_des[i].arg); } else { fprintf(stderr," arg"); } if (options_init[i].arg) { fprintf(stderr," (default = \"%s\")",options_init[i].arg); } } fprintf(stderr,"\n%s",options_des[i].des); } } /* * record summary data */ struct bufferData { char * data; /* lowest address of the buffer */ char * next; /* pointer to the next element on the buffer */ int len; /* length of the buffer */ }; /* our actual buffer. If data is NULL, then all append ops * except are noops */ static struct bufferData buffer= { NULL, NULL, 0 }; #define CHUNK_SIZE 1000 /* * get our initial data. and set the buffer variables up. on failure, * just don't initialize the buffer. */ static void initBuffer(void) { buffer.data = PORT_Alloc(CHUNK_SIZE); if (!buffer.data) { return; } buffer.next = buffer.data; buffer.len = CHUNK_SIZE; } /* * grow the buffer. If we can't get more data, record a 'D' in the second * to last record and allow the rest of the data to overwrite the last * element. */ static void growBuffer(void) { char *new = PORT_Realloc(buffer.data, buffer.len + CHUNK_SIZE); if (!new) { buffer.data[buffer.len-2] = 'D'; /* signal malloc failure in summary */ /* buffer must always point to good memory if it exists */ buffer.next = buffer.data + (buffer.len -1); return; } buffer.next = new + (buffer.next-buffer.data); buffer.data = new; buffer.len += CHUNK_SIZE; } /* * append a label, doubles as appending a single character. */ static void appendLabel(char label) { if (!buffer.data) { return; } *buffer.next++ = label; if (buffer.data+buffer.len >= buffer.next) { growBuffer(); } } /* * append a string onto the buffer. The result will be <string> */ static void appendString(char *string) { if (!buffer.data) { return; } appendLabel('<'); while (*string) { appendLabel(*string++); } appendLabel('>'); } /* * append a bool, T= true, F=false */ static void appendBool(PRBool bool) { if (!buffer.data) { return; } if (bool) { appendLabel('t'); } else { appendLabel('f'); } } /* * append a single hex nibble. */ static void appendHex(unsigned char nibble) { if (nibble <= 9) { appendLabel('0'+nibble); } else { appendLabel('a'+nibble-10); } } /* * append a secitem as colon separated hex bytes. */ static void appendItem(SECItem *item) { int i; if (!buffer.data) { return; } appendLabel(':'); for (i=0; i < item->len; i++) { unsigned char byte=item->data[i]; appendHex(byte >> 4); appendHex(byte & 0xf); appendLabel(':'); } } /* * append a 32 bit integer (even on a 64 bit platform). * for simplicity append it as a hex value, full extension with 0x prefix. */ static void appendInt(unsigned int value) { int i; if (!buffer.data) { return; } appendLabel('0'); appendLabel('x'); value = value & 0xffffffff; /* only look at the buttom 8 bytes */ for (i=0; i < 8; i++) { appendHex(value >> 28 ); value = value << 4; } } /* append a trust flag */ static void appendFlags(unsigned int flag) { char trust[10]; char *cp=trust; trust[0] = 0; printflags(trust, flag); while (*cp) { appendLabel(*cp++); } } /* * dump our buffer out with a result= flag so we can find it easily. * free the buffer as a side effect. */ static void dumpBuffer(void) { if (!buffer.data) { return; } appendLabel(0); /* terminate */ printf("\nresult=%s\n",buffer.data); PORT_Free(buffer.data); buffer.data = buffer.next = NULL; buffer.len = 0; } /* * usage, like traditional usage, automatically exit */ static void usage(const char *prog) { short_help(prog); dumpBuffer(); exit(1); } /* * like usage, except prints the long version of help */ static void usage_long(const char *prog) { long_help(prog); dumpBuffer(); exit(1); } static const char * bool2String(PRBool bool) { return bool ? "true" : "false"; } /* * print out interesting info about the given slot */ void print_slot(PK11SlotInfo *slot, int log) { if (log) { fprintf(stderr, "* Name=%s Token_Name=%s present=%s, ro=%s *\n", PK11_GetSlotName(slot), PK11_GetTokenName(slot), bool2String(PK11_IsPresent(slot)), bool2String(PK11_IsReadOnly(slot))); } appendLabel('S'); appendString(PK11_GetTokenName(slot)); appendBool(PK11_IsPresent(slot)); appendBool(PK11_IsReadOnly(slot)); } /* * list all our slots */ void do_list_slots(const char *progName, int log) { PK11SlotList *list; PK11SlotListElement *le; list= PK11_GetAllTokens(CKM_INVALID_MECHANISM, PR_FALSE, PR_FALSE, NULL); if (list == NULL) { fprintf(stderr,"ERROR: no tokens found %s\n", SECU_Strerror(PORT_GetError())); appendLabel('S'); appendString("none"); return; } for (le= PK11_GetFirstSafe(list); le; le = PK11_GetNextSafe(list,le,PR_TRUE)) { print_slot(le->slot, log); } PK11_FreeSlotList(list); } static PRBool sort_CN(CERTCertificate *certa, CERTCertificate *certb, void *arg) { char *commonNameA, *commonNameB; int ret; commonNameA = CERT_GetCommonName(&certa->subject); commonNameB = CERT_GetCommonName(&certb->subject); if (commonNameA == NULL) { PORT_Free(commonNameB); return PR_TRUE; } if (commonNameB == NULL) { PORT_Free(commonNameA); return PR_FALSE; } ret = PORT_Strcmp(commonNameA,commonNameB); PORT_Free(commonNameA); PORT_Free(commonNameB); return (ret < 0) ? PR_TRUE: PR_FALSE; } /* * list all the certs */ void do_list_certs(const char *progName, int log) { CERTCertList *list; CERTCertList *sorted; CERTCertListNode *node; CERTCertTrust trust; int i; list = PK11_ListCerts(PK11CertListUnique, NULL); if (list == NULL) { fprintf(stderr,"ERROR: no certs found %s\n", SECU_Strerror(PORT_GetError())); appendLabel('C'); appendString("none"); return; } sorted = CERT_NewCertList(); if (sorted == NULL) { fprintf(stderr,"ERROR: no certs found %s\n", SECU_Strerror(PORT_GetError())); appendLabel('C'); appendLabel('E'); appendInt(PORT_GetError()); return; } /* sort the list */ for (node = CERT_LIST_HEAD(list); !CERT_LIST_END(node,list); node = CERT_LIST_NEXT(node)) { CERT_AddCertToListSorted(sorted, node->cert, sort_CN, NULL); } for (node = CERT_LIST_HEAD(sorted); !CERT_LIST_END(node,sorted); node = CERT_LIST_NEXT(node)) { CERTCertificate *cert = node->cert; char *commonName; SECU_PrintCertNickname(node, stderr); if (log) { fprintf(stderr, "* Slot=%s*\n", cert->slot ? PK11_GetTokenName(cert->slot) : "none"); fprintf(stderr, "* Nickname=%s*\n", cert->nickname); fprintf(stderr, "* Subject=<%s>*\n", cert->subjectName); fprintf(stderr, "* Issuer=<%s>*\n", cert->issuerName); fprintf(stderr, "* SN="); for (i=0; i < cert->serialNumber.len; i++) { if (i!=0) fprintf(stderr,":"); fprintf(stderr, "%02x",cert->serialNumber.data[0]); } fprintf(stderr," *\n"); } appendLabel('C'); commonName = CERT_GetCommonName(&cert->subject); appendString(commonName?commonName:"*NoName*"); PORT_Free(commonName); if (CERT_GetCertTrust(cert, &trust) == SECSuccess) { appendFlags(trust.sslFlags); appendFlags(trust.emailFlags); appendFlags(trust.objectSigningFlags); } } CERT_DestroyCertList(list); } /* * need to implement yet... try to add a new certificate */ void do_add_cert(const char *progName, int log) { PORT_Assert(/* do_add_cert not implemented */ 0); } /* * display the current key slot */ void do_key_slot(const char *progName, int log) { PK11SlotInfo *slot = PK11_GetInternalKeySlot(); if (!slot) { fprintf(stderr,"ERROR: no internal key slot found %s\n", SECU_Strerror(PORT_GetError())); appendLabel('K'); appendLabel('S'); appendString("none"); } print_slot(slot, log); PK11_FreeSlot(slot); } /* * execute some NSS command. */ void do_command(const char *label, int initialized, secuCommandFlag *command, const char *progName, int log) { char * command_string; if (!initialized) { return; } if (command->activated) { command_string = command->arg; } else { command_string = "none"; } if (log) { fprintf(stderr, "*Executing nss command \"%s\" for %s*\n", command_string,label); } /* do something */ if (PORT_Strcasecmp(command_string, "list_slots") == 0) { do_list_slots(progName, log); } else if (PORT_Strcasecmp(command_string, "list_certs") == 0) { do_list_certs(progName, log); } else if (PORT_Strcasecmp(command_string, "add_cert") == 0) { do_add_cert(progName, log); } else if (PORT_Strcasecmp(command_string, "key_slot") == 0) { do_key_slot(progName, log); } else if (PORT_Strcasecmp(command_string, "none") != 0) { fprintf(stderr, ">> Unknown command (%s)\n", command_string); appendLabel('E'); appendString("bc"); usage_long(progName); } } /* * functions do handle * different library initializations. */ static int main_initialized; static int lib1_initialized; static int lib2_initialized; void main_Init(secuCommandFlag *db, secuCommandFlag *tokNam, int readOnly, const char *progName, int log) { SECStatus rv; if (log) { fprintf(stderr,"*NSS_Init for the main program*\n"); } appendLabel('M'); if (!db->activated) { fprintf(stderr, ">> No main_db has been specified\n"); usage(progName); } if (main_initialized) { fprintf(stderr,"Warning: Second initialization of Main\n"); appendLabel('E'); appendString("2M"); } if (tokNam->activated) { PK11_ConfigurePKCS11(NULL, NULL, NULL, tokNam->arg, NULL, NULL, NULL, NULL, 0, 0); } rv = NSS_Initialize(db->arg, "", "", "", NSS_INIT_NOROOTINIT|(readOnly?NSS_INIT_READONLY:0)); if (rv != SECSuccess) { appendLabel('E'); appendInt(PORT_GetError()); fprintf(stderr,">> %s\n", SECU_Strerror(PORT_GetError())); dumpBuffer(); exit(1); } main_initialized = 1; } void main_Do(secuCommandFlag *command, const char *progName, int log) { do_command("main", main_initialized, command, progName, log); } void main_Shutdown(int old_style, const char *progName, int log) { SECStatus rv; appendLabel('N'); if (log) { fprintf(stderr,"*NSS_Shutdown for the main program*\n"); } if (!main_initialized) { fprintf(stderr,"Warning: Main shutdown without corresponding init\n"); } if (old_style) { rv = NSS_Shutdown(); } else { rv = NSS_ShutdownContext(NULL); } fprintf(stderr, "Shutdown main state = %d\n", rv); if (rv != SECSuccess) { appendLabel('E'); appendInt(PORT_GetError()); fprintf(stderr,"ERROR: %s\n", SECU_Strerror(PORT_GetError())); } main_initialized = 0; } /* common library init */ NSSInitContext * lib_Init(const char *lableString, char label, int initialized, secuCommandFlag *db, secuCommandFlag *tokNam, int readonly, const char *progName, int log) { NSSInitContext *ctxt; NSSInitParameters initStrings; NSSInitParameters *initStringPtr = NULL; appendLabel(label); if (log) { fprintf(stderr,"*NSS_Init for %s*\n", lableString); } if (!db->activated) { fprintf(stderr, ">> No %s_db has been specified\n", lableString); usage(progName); } if (initialized) { fprintf(stderr,"Warning: Second initialization of %s\n", lableString); } if (tokNam->activated) { PORT_Memset(&initStrings, 0, sizeof(initStrings)); initStrings.length = sizeof(initStrings); initStrings.dbTokenDescription = tokNam->arg; initStringPtr = &initStrings; } ctxt = NSS_InitContext(db->arg, "", "", "", initStringPtr, NSS_INIT_NOROOTINIT|(readonly?NSS_INIT_READONLY:0)); if (ctxt == NULL) { appendLabel('E'); appendInt(PORT_GetError()); fprintf(stderr,">> %s\n",SECU_Strerror(PORT_GetError())); dumpBuffer(); exit(1); } return ctxt; } /* common library shutdown */ void lib_Shutdown(const char *labelString, char label, NSSInitContext *ctx, int initialize, const char *progName, int log) { SECStatus rv; appendLabel(label); if (log) { fprintf(stderr,"*NSS_Shutdown for %s\n*", labelString); } if (!initialize) { fprintf(stderr,"Warning: %s shutdown without corresponding init\n", labelString); } rv = NSS_ShutdownContext(ctx); fprintf(stderr, "Shutdown %s state = %d\n", labelString, rv); if (rv != SECSuccess) { appendLabel('E'); appendInt(PORT_GetError()); fprintf(stderr,"ERROR: %s\n", SECU_Strerror(PORT_GetError())); } } static NSSInitContext *lib1_context; static NSSInitContext *lib2_context; void lib1_Init(secuCommandFlag *db, secuCommandFlag *tokNam, int readOnly, const char *progName, int log) { lib1_context = lib_Init("lib1", '1', lib1_initialized, db, tokNam, readOnly, progName, log); lib1_initialized = 1; } void lib2_Init(secuCommandFlag *db, secuCommandFlag *tokNam, int readOnly, const char *progName, int log) { lib2_context = lib_Init("lib2", '2', lib2_initialized, db, tokNam, readOnly, progName, log); lib2_initialized = 1; } void lib1_Do(secuCommandFlag *command, const char *progName, int log) { do_command("lib1", lib1_initialized, command, progName, log); } void lib2_Do(secuCommandFlag *command, const char *progName, int log) { do_command("lib2", lib2_initialized, command, progName, log); } void lib1_Shutdown(const char *progName, int log) { lib_Shutdown("lib1", 'I', lib1_context, lib1_initialized, progName, log); lib1_initialized = 0; /* don't clear lib1_Context, so we can test multiple attempts to close * the same context produces correct errors*/ } void lib2_Shutdown(const char *progName, int log) { lib_Shutdown("lib2", 'Z', lib2_context, lib2_initialized, progName, log); lib2_initialized = 0; /* don't clear lib2_Context, so we can test multiple attempts to close * the same context produces correct errors*/ } int main(int argc, char **argv) { SECStatus rv; secuCommand libinit; char *progName; char *order; secuCommandFlag *options; int log = 0; progName = strrchr(argv[0], '/'); progName = progName ? progName+1 : argv[0]; libinit.numCommands = 0; libinit.commands = 0; libinit.numOptions = opt_last; options = (secuCommandFlag *)PORT_Alloc(sizeof(options_init)); if (options == NULL) { fprintf(stderr, ">> %s:Not enough free memory to run command\n", progName); exit(1); } PORT_Memcpy(options, options_init, sizeof(options_init)); libinit.options = options; rv = SECU_ParseCommandLine(argc, argv, progName, & libinit); if (rv != SECSuccess) { usage(progName); } if (libinit.options[opt_help].activated) { long_help(progName); exit (0); } log = libinit.options[opt_verbose].activated; if (libinit.options[opt_summary].activated) { initBuffer(); } order = libinit.options[opt_liborder].arg; if (!order) { usage(progName); } if (log) { fprintf(stderr,"* initializing with order \"%s\"*\n", order); } for (;*order; order++) { switch (*order) { case 'M': main_Init(&libinit.options[opt_mainDB], &libinit.options[opt_mainTokNam], libinit.options[opt_mainRO].activated, progName, log); break; case '1': lib1_Init(&libinit.options[opt_lib1DB], &libinit.options[opt_lib1TokNam], libinit.options[opt_lib1RO].activated, progName,log); break; case '2': lib2_Init(&libinit.options[opt_lib2DB], &libinit.options[opt_lib2TokNam], libinit.options[opt_lib2RO].activated, progName,log); break; case 'm': main_Shutdown(libinit.options[opt_oldStyle].activated, progName, log); break; case 'i': lib1_Shutdown(progName, log); break; case 'z': lib2_Shutdown(progName, log); break; default: fprintf(stderr,">> Unknown init/shutdown command \"%c\"", *order); usage_long(progName); } main_Do(&libinit.options[opt_mainCMD], progName, log); lib1_Do(&libinit.options[opt_lib1CMD], progName, log); lib2_Do(&libinit.options[opt_lib2CMD], progName, log); } if (NSS_IsInitialized()) { appendLabel('X'); fprintf(stderr, "Warning: NSS is initialized\n"); } dumpBuffer(); exit(0); }
1.109375
1
ADXL345_Project/Configs/Config.h
MatthewPatyk/ADXL345-Arduino-I2C-library
0
7997787
/* * config.h * * Created: 03.06.2018 13:35:49 * Author: <NAME> * Email: <EMAIL> */ #ifndef CONFIG_H_ #define CONFIG_H_ // PINS: #define ADXL345_VCC_PIN 52 #endif /* CONFIG_H_ */
-0.308594
0
fbuig/View Controllers/ComposeViewController.h
jordanF0ster/Finstagram
0
7997795
// // ComposeViewController.h // fbuig // // Created by jordan487 on 7/9/19. // Copyright © 2019 jordan487. All rights reserved. // #import <UIKit/UIKit.h> #import "Post.h" NS_ASSUME_NONNULL_BEGIN @protocol ComposeViewControllerDelegate <NSObject> -(void)didPost; @end @interface ComposeViewController : UIViewController @property (nonatomic, weak) id<ComposeViewControllerDelegate> delegate; @end NS_ASSUME_NONNULL_END
0.667969
1
src/api/cubrid_api.c
eido5/cubrid
253
7997803
/* * Copyright 2008 Search Solution Corporation * Copyright 2016 CUBRID Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ /* * cubrid_api.c - */ #include "config.h" #include <stdlib.h> #include <assert.h> #include "api_handle.h" #include "api_common.h" #define API_BH_INTERFACE ifs__ #define API_RID rid__ #define API_DECLARE \ int retval__; \ BH_INTERFACE *API_BH_INTERFACE;\ int API_RID #define API_HOUSEKEEP_BEGIN(h__, TYPE__, p__) \ do { \ BH_BIND *bind__; \ retval__ = bh_get_rid ((h__), &rid__); \ if (retval__ != NO_ERROR) \ API_IMPL_TBL->err_set(retval__); \ retval__ = bh_root_lock (rid__, &ifs__); \ if (retval__ != NO_ERROR) \ API_IMPL_TBL->err_set(retval__); \ retval__ = ifs__->lookup (ifs__, (h__), &bind__); \ if (retval__ != NO_ERROR) \ { \ bh_root_unlock(rid__); \ API_IMPL_TBL->err_set(retval__); \ } \ (p__) = (TYPE__)bind__; \ } while (0) #define API_HOUSEKEEP_END() \ (void) bh_root_unlock(rid__) #define API_CHECK_HANDLE(s__,ht__) \ do { \ if((s__)->handle_type != (ht__)) \ { \ API_IMPL_TBL->err_set(ER_INTERFACE_INVALID_HANDLE); \ API_RETURN(ER_INTERFACE_INVALID_HANDLE); \ } \ } while (0) #define API_RETURN(c) \ do { \ API_HOUSEKEEP_END(); \ return (c); \ } while (0) #define API_IMPL_TBL (&Cubrid_api_function_table) /* ------------------------------------------------------------------------- */ /* EXPORTED FUNCTION */ /* ------------------------------------------------------------------------- */ /* * ci_create_connection - * return: * conn(): */ int ci_create_connection (CI_CONNECTION * conn) { return API_IMPL_TBL->create_connection (conn); } /* * ci_conn_connect - * return: * conn(): * host(): * port(): * databasename(): * user_name(): * password(): */ int ci_conn_connect (CI_CONNECTION conn, const char *host, unsigned short port, const char *databasename, const char *user_name, const char *password) { API_DECLARE; COMMON_API_STRUCTURE *pst; int retval; if (databasename == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); retval = API_IMPL_TBL->conn_connect (pst, host, port, databasename, user_name, password); API_RETURN (retval); } /* * ci_conn_close - * return: * conn(): */ int ci_conn_close (CI_CONNECTION conn) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; API_HOUSEKEEP_BEGIN (conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); retval = API_IMPL_TBL->conn_close (pst); if (retval != NO_ERROR) { API_RETURN (retval); } API_BH_INTERFACE->destroy_handle (API_BH_INTERFACE, conn); API_HOUSEKEEP_END (); bh_root_release (API_RID); return NO_ERROR; } /* * ci_conn_create_statement - * return: * conn(): * stmt(): */ int ci_conn_create_statement (CI_CONNECTION conn, CI_STATEMENT * stmt) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; API_HOUSEKEEP_BEGIN (conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); retval = API_IMPL_TBL->conn_create_statement (pst, stmt); API_RETURN (retval); } /* * ci_conn_set_option - * return: * conn(): * option(): * arg(): * size(): */ int ci_conn_set_option (CI_CONNECTION conn, CI_CONNECTION_OPTION option, void *arg, size_t size) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (arg == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); retval = API_IMPL_TBL->conn_set_option (pst, option, arg, size); API_RETURN (retval); } /* * ci_conn_get_option - * return: * conn(): * option(): * arg(): * size(): */ int ci_conn_get_option (CI_CONNECTION conn, CI_CONNECTION_OPTION option, void *arg, size_t size) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (arg == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); retval = API_IMPL_TBL->conn_get_option (pst, option, arg, size); API_RETURN (retval); } /* * ci_conn_commit - * return: * conn(): */ int ci_conn_commit (CI_CONNECTION conn) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; API_HOUSEKEEP_BEGIN (conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); retval = API_IMPL_TBL->conn_commit (pst); API_RETURN (retval); } /* * ci_conn_rollback - * return: * conn(): */ int ci_conn_rollback (CI_CONNECTION conn) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; API_HOUSEKEEP_BEGIN (conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); retval = API_IMPL_TBL->conn_rollback (pst); API_RETURN (retval); } /* * ci_conn_get_error - * return: * conn(): * err(): * msg(): * size(): */ int ci_conn_get_error (CI_CONNECTION conn, int *err, char *msg, size_t size) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (err == NULL || msg == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); retval = API_IMPL_TBL->conn_get_error (pst, err, msg, size); API_RETURN (retval); } /* * ci_stmt_close - * return: * stmt(): */ int ci_stmt_close (CI_STATEMENT stmt) { int retval, rid; BH_INTERFACE *hd_ctx; retval = bh_get_rid (stmt, &rid); if (retval != NO_ERROR) { API_IMPL_TBL->err_set (retval); return retval; } retval = bh_root_lock (rid, &hd_ctx); if (retval != NO_ERROR) { API_IMPL_TBL->err_set (retval); return retval; } retval = hd_ctx->destroy_handle (hd_ctx, stmt); bh_root_unlock (rid); if (retval != NO_ERROR) { API_IMPL_TBL->err_set (retval); return retval; } return NO_ERROR; } /* * ci_stmt_add_batch_query - * return: * stmt(): * sql(): * len(): */ int ci_stmt_add_batch_query (CI_STATEMENT stmt, const char *sql, size_t len) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (sql == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_add_batch_query (pst, sql, len); API_RETURN (retval); } /* * ci_stmt_add_batch - * return: * stmt(): */ int ci_stmt_add_batch (CI_STATEMENT stmt) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_add_batch (pst); API_RETURN (retval); } /* * ci_stmt_clear_batch - * return: * stmt(): */ int ci_stmt_clear_batch (CI_STATEMENT stmt) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_clear_batch (pst); API_RETURN (retval); } /* * ci_stmt_execute_immediate - * return: * stmt(): * sql(): * len(): * rs(): * r(): */ int ci_stmt_execute_immediate (CI_STATEMENT stmt, char *sql, size_t len, CI_RESULTSET * rs, int *r) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (sql == NULL || rs == NULL || r == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_execute_immediate (pst, sql, len, rs, r); API_RETURN (retval); } /* * ci_stmt_execute - * return: * stmt(): * rs(): * r(): */ int ci_stmt_execute (CI_STATEMENT stmt, CI_RESULTSET * rs, int *r) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (rs == NULL || r == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_execute (pst, rs, r); API_RETURN (retval); } /* * ci_stmt_execute_batch - * return: * stmt(): * br(): */ int ci_stmt_execute_batch (CI_STATEMENT stmt, CI_BATCH_RESULT * br) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (br == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_execute_batch (pst, br); API_RETURN (retval); } /* * ci_stmt_get_option - * return: * stmt(): * option(): * arg(): * size(): */ int ci_stmt_get_option (CI_STATEMENT stmt, CI_STATEMENT_OPTION option, void *arg, size_t size) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (arg == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_get_option (pst, option, arg, size); API_RETURN (retval); } /* * ci_stmt_set_option - * return: * stmt(): * option(): * arg(): * size(): */ int ci_stmt_set_option (CI_STATEMENT stmt, CI_STATEMENT_OPTION option, void *arg, size_t size) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (arg == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_set_option (pst, option, arg, size); API_RETURN (retval); } /* * ci_stmt_prepare - * return: * stmt(): * sql(): * len(): */ int ci_stmt_prepare (CI_STATEMENT stmt, const char *sql, size_t len) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (sql == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_prepare (pst, sql, len); API_RETURN (retval); } /* * ci_stmt_register_out_parameter - * return: * stmt(): * index(): */ int ci_stmt_register_out_parameter (CI_STATEMENT stmt, int index) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (index <= 0) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_register_out_parameter (pst, index); API_RETURN (retval); } /* * ci_stmt_get_resultset_metadata - * return: * stmt(): * r(): */ int ci_stmt_get_resultset_metadata (CI_STATEMENT stmt, CI_RESULTSET_METADATA * r) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (r == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_get_resultset_metadata (pst, r); API_RETURN (retval); } /* * ci_stmt_get_parameter_metadata - * return: * stmt(): * r(): */ int ci_stmt_get_parameter_metadata (CI_STATEMENT stmt, CI_PARAMETER_METADATA * r) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (r == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_get_parameter_metadata (pst, r); API_RETURN (retval); } /* * ci_stmt_get_parameter - * return: * stmt(): * index(): * type(): * addr(): * len(): * outlen(): * isnull(): */ int ci_stmt_get_parameter (CI_STATEMENT stmt, int index, CI_TYPE type, void *addr, size_t len, size_t * outlen, bool * isnull) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (index <= 0 || addr == NULL || outlen == NULL || isnull == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_get_parameter (pst, index, type, addr, len, outlen, isnull); API_RETURN (retval); } /* * ci_stmt_set_parameter - * return: * stmt(): * index(): * type(): * val(): * size(): */ int ci_stmt_set_parameter (CI_STATEMENT stmt, int index, CI_TYPE type, void *val, size_t size) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (index <= 0 || val == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_set_parameter (pst, index, type, val, size); API_RETURN (retval); } /* * ci_stmt_get_resultset - * return: * stmt(): * res(): */ int ci_stmt_get_resultset (CI_STATEMENT stmt, CI_RESULTSET * res) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (res == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_get_resultset (pst, res); API_RETURN (retval); } /* * ci_stmt_affected_rows - * return: * stmt(): * out(): */ int ci_stmt_affected_rows (CI_STATEMENT stmt, int *out) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (out == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_affected_rows (pst, out); API_RETURN (retval); } /* * ci_stmt_get_query_type - * return: * stmt(): * type(): */ int ci_stmt_get_query_type (CI_STATEMENT stmt, CUBRID_STMT_TYPE * type) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (type == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_get_query_type (pst, type); API_RETURN (retval); } /* * ci_stmt_get_start_line - * return: * stmt(): * line(): */ int ci_stmt_get_start_line (CI_STATEMENT stmt, int *line) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (line == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_get_start_line (pst, line); API_RETURN (retval); } /* * ci_stmt_next_result - * return: * stmt(): * exist_result(): */ int ci_stmt_next_result (CI_STATEMENT stmt, bool * exist_result) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (exist_result == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_next_result (pst, exist_result); API_RETURN (retval); } /* * ci_stmt_get_first_error - * return: * stmt(): * line(): * col(): * errcode(): * err_msg(): * size(): */ int ci_stmt_get_first_error (CI_STATEMENT stmt, int *line, int *col, int *errcode, char *err_msg, size_t size) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (line == NULL || col == NULL || errcode == NULL || err_msg == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_get_first_error (pst, line, col, errcode, err_msg, size); API_RETURN (retval); } /* * ci_stmt_get_next_error - * return: * stmt(): * line(): * col(): * errcode(): * err_msg(): * size(): */ int ci_stmt_get_next_error (CI_STATEMENT stmt, int *line, int *col, int *errcode, char *err_msg, size_t size) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (line == NULL || col == NULL || errcode == NULL || err_msg == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (stmt, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_STATEMENT); retval = API_IMPL_TBL->stmt_get_next_error (pst, line, col, errcode, err_msg, size); API_RETURN (retval); } /* * ci_res_get_resultset_metadata - * return: * res(): * r(): */ int ci_res_get_resultset_metadata (CI_RESULTSET res, CI_RESULTSET_METADATA * r) { API_DECLARE; int retval; API_RESULTSET *pres; API_RESULTSET_META *prmeta; if (r == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (res, API_RESULTSET *, pres); API_CHECK_HANDLE (pres, HANDLE_TYPE_RESULTSET); retval = pres->ifs->get_resultset_metadata (pres, &prmeta); if (retval == NO_ERROR) { retval = API_BH_INTERFACE->bind_to_handle (API_BH_INTERFACE, (BH_BIND *) prmeta, (BIND_HANDLE *) r); } API_RETURN (retval); } /* * ci_res_fetch - * return: * res(): * offset(): * pos(): */ int ci_res_fetch (CI_RESULTSET res, int offset, CI_FETCH_POSITION pos) { API_DECLARE; int retval; API_RESULTSET *pres; API_HOUSEKEEP_BEGIN (res, API_RESULTSET *, pres); API_CHECK_HANDLE (pres, HANDLE_TYPE_RESULTSET); retval = pres->ifs->fetch (pres, offset, pos); API_RETURN (retval); } /* * ci_res_fetch_tell - * return: * res(): * offset(): */ int ci_res_fetch_tell (CI_RESULTSET res, int *offset) { API_DECLARE; int retval; API_RESULTSET *pres; if (offset == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (res, API_RESULTSET *, pres); API_CHECK_HANDLE (pres, HANDLE_TYPE_RESULTSET); retval = pres->ifs->tell (pres, offset); API_RETURN (retval); } /* * ci_res_clear_updates - * return: * res(): */ int ci_res_clear_updates (CI_RESULTSET res) { API_DECLARE; int retval; API_RESULTSET *pres; API_HOUSEKEEP_BEGIN (res, API_RESULTSET *, pres); API_CHECK_HANDLE (pres, HANDLE_TYPE_RESULTSET); retval = pres->ifs->clear_updates (pres); API_RETURN (retval); } /* * ci_res_delete_row - * return: * res(): */ int ci_res_delete_row (CI_RESULTSET res) { API_DECLARE; int retval; API_RESULTSET *pres; API_HOUSEKEEP_BEGIN (res, API_RESULTSET *, pres); API_CHECK_HANDLE (pres, HANDLE_TYPE_RESULTSET); retval = pres->ifs->delete_row (pres); API_RETURN (retval); } /* * ci_res_get_value - * return: * res(): * index(): * type(): * addr(): * len(): * outlen(): * isnull(): */ int ci_res_get_value (CI_RESULTSET res, int index, CI_TYPE type, void *addr, size_t len, size_t * outlen, bool * isnull) { API_DECLARE; int retval; API_RESULTSET *pres; if (index <= 0 || addr == NULL || outlen == NULL || isnull == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (res, API_RESULTSET *, pres); API_CHECK_HANDLE (pres, HANDLE_TYPE_RESULTSET); retval = pres->ifs->get_value (pres, index, type, addr, len, outlen, isnull); API_RETURN (retval); } /* * ci_res_get_value_by_name - * return: * res(): * name(): * type(): * addr(): * len(): * outlen(): * isnull(): */ int ci_res_get_value_by_name (CI_RESULTSET res, const char *name, CI_TYPE type, void *addr, size_t len, size_t * outlen, bool * isnull) { API_DECLARE; int retval; API_RESULTSET *pres; if (name == NULL || addr == NULL || outlen == NULL || isnull == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (res, API_RESULTSET *, pres); API_CHECK_HANDLE (pres, HANDLE_TYPE_RESULTSET); retval = pres->ifs->get_value_by_name (pres, name, type, addr, len, outlen, isnull); API_RETURN (retval); } /* * ci_res_update_value - * return: * res(): * index(): * type(): * addr(): * len(): */ int ci_res_update_value (CI_RESULTSET res, int index, CI_TYPE type, void *addr, size_t len) { API_DECLARE; int retval; API_RESULTSET *pres; if (index <= 0 || addr == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (res, API_RESULTSET *, pres); API_CHECK_HANDLE (pres, HANDLE_TYPE_RESULTSET); retval = pres->ifs->update_value (pres, index, type, addr, len); API_RETURN (retval); } /* * ci_res_apply_row - * return: * res(): */ int ci_res_apply_row (CI_RESULTSET res) { API_DECLARE; int retval; API_RESULTSET *pres; API_HOUSEKEEP_BEGIN (res, API_RESULTSET *, pres); API_CHECK_HANDLE (pres, HANDLE_TYPE_RESULTSET); retval = pres->ifs->apply_update (pres); API_RETURN (retval); } /* * ci_res_close - * return: * res(): */ int ci_res_close (CI_RESULTSET res) { API_DECLARE; int retval; API_RESULTSET *pres; API_HOUSEKEEP_BEGIN (res, API_RESULTSET *, pres); API_CHECK_HANDLE (pres, HANDLE_TYPE_RESULTSET); retval = API_BH_INTERFACE->destroy_handle (API_BH_INTERFACE, (BIND_HANDLE) res); API_RETURN (retval); } /* * ci_batch_res_query_count - * return: * br(): * count(): */ int ci_batch_res_query_count (CI_BATCH_RESULT br, int *count) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (count == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (br, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_BATCH_RESULT); retval = API_IMPL_TBL->batch_res_query_count (pst, count); API_RETURN (retval); } /* * ci_batch_res_get_result - * return: * br(): * index(): * ret(): * nr(): */ int ci_batch_res_get_result (CI_BATCH_RESULT br, int index, int *ret, int *nr) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (ret == NULL || nr == NULL || index <= 0) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (br, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_BATCH_RESULT); retval = API_IMPL_TBL->batch_res_get_result (pst, index - 1, ret, nr); API_RETURN (retval); } /* * ci_batch_res_get_error - * return: * br(): * index(): * err_code(): * err_msg(): * size(): */ int ci_batch_res_get_error (CI_BATCH_RESULT br, int index, int *err_code, char *err_msg, size_t size) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (err_code == NULL || err_msg == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (br, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_BATCH_RESULT); retval = API_IMPL_TBL->batch_res_get_error (pst, index - 1, err_code, err_msg, size); API_RETURN (retval); } /* * ci_pmeta_get_count - * return: * pmeta(): * count(): */ int ci_pmeta_get_count (CI_PARAMETER_METADATA pmeta, int *count) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (count == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (pmeta, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_PMETA); retval = API_IMPL_TBL->pmeta_get_count (pst, count); API_RETURN (retval); } /* * ci_pmeta_get_info - * return: * pmeta(): * index(): * type(): * arg(): * size(): */ int ci_pmeta_get_info (CI_PARAMETER_METADATA pmeta, int index, CI_PMETA_INFO_TYPE type, void *arg, size_t size) { API_DECLARE; int retval; COMMON_API_STRUCTURE *pst; if (index <= 0 || arg == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (pmeta, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_PMETA); retval = API_IMPL_TBL->pmeta_get_info (pst, index, type, arg, size); API_RETURN (retval); } /* * ci_rmeta_get_count - * return: * rmeta(): * count(): */ int ci_rmeta_get_count (CI_RESULTSET_METADATA rmeta, int *count) { API_DECLARE; int retval; API_RESULTSET_META *prmeta; if (count == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (rmeta, API_RESULTSET_META *, prmeta); API_CHECK_HANDLE (prmeta, HANDLE_TYPE_RMETA); retval = prmeta->ifs->get_count (prmeta, count); API_RETURN (retval); } /* * ci_rmeta_get_info - * return: * rmeta(): * index(): * type(): * arg(): * size(): */ int ci_rmeta_get_info (CI_RESULTSET_METADATA rmeta, int index, CI_RMETA_INFO_TYPE type, void *arg, size_t size) { API_DECLARE; int retval; API_RESULTSET_META *prmeta; if (index <= 0 || arg == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (rmeta, API_RESULTSET_META *, prmeta); API_CHECK_HANDLE (prmeta, HANDLE_TYPE_RMETA); retval = prmeta->ifs->get_info (prmeta, index, type, arg, size); API_RETURN (retval); } /* * ci_oid_delete - * return: * oid(): */ int ci_oid_delete (CI_OID * oid) { API_DECLARE; int res; COMMON_API_STRUCTURE *pst; API_OBJECT_RESULTSET_POOL *opool = NULL; if (oid == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (oid->conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); res = API_IMPL_TBL->get_connection_opool (pst, &opool); if (res != NO_ERROR) API_RETURN (res); res = opool->oid_delete (opool, oid); API_RETURN (res); } /* * ci_oid_get_classname - * return: * oid(): * name(): * size(): */ int ci_oid_get_classname (CI_OID * oid, char *name, size_t size) { API_DECLARE; int res; COMMON_API_STRUCTURE *pst; API_OBJECT_RESULTSET_POOL *opool = NULL; if (oid == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (oid->conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); res = API_IMPL_TBL->get_connection_opool (pst, &opool); if (res != NO_ERROR) API_RETURN (res); res = opool->oid_get_classname (opool, oid, name, size); API_RETURN (res); } /* * ci_oid_get_resultset - * return: * oid(): * rs(): */ int ci_oid_get_resultset (CI_OID * oid, CI_RESULTSET * rs) { API_DECLARE; int res; COMMON_API_STRUCTURE *pst; API_OBJECT_RESULTSET_POOL *opool = NULL; API_RESULTSET *ares; if (oid == NULL || rs == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (oid->conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); res = API_IMPL_TBL->get_connection_opool (pst, &opool); if (res != NO_ERROR) API_RETURN (res); res = opool->get_object_resultset (opool, oid, &ares); if (res != NO_ERROR) API_RETURN (res); res = API_BH_INTERFACE->bind_to_handle (API_BH_INTERFACE, &ares->bind, rs); API_RETURN (res); } /* * ci_collection_new - * return: * conn(): * coll(): */ int ci_collection_new (CI_CONNECTION conn, CI_COLLECTION * coll) { API_DECLARE; int res; COMMON_API_STRUCTURE *pst; if (coll == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } API_HOUSEKEEP_BEGIN (conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); res = API_IMPL_TBL->collection_new (conn, coll); API_RETURN (res); } /* * ci_collection_free - * return: * coll(): */ int ci_collection_free (CI_COLLECTION coll) { API_DECLARE; COMMON_API_STRUCTURE *pst; API_COLLECTION *co; if (coll == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } co = (API_COLLECTION *) coll; API_HOUSEKEEP_BEGIN (co->conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); co->ifs->destroy (co); API_RETURN (NO_ERROR); } /* * ci_collection_length - * return: * coll(): * length(): */ int ci_collection_length (CI_COLLECTION coll, long *length) { API_DECLARE; COMMON_API_STRUCTURE *pst; API_COLLECTION *co; int len, res; if (coll == NULL || length == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } co = (API_COLLECTION *) coll; API_HOUSEKEEP_BEGIN (co->conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); res = co->ifs->length (co, &len); if (res == NO_ERROR) *length = len; API_RETURN (res); } /* * ci_collection_insert - * return: * coll(): * pos(): * type(): * ptr(): * size(): */ int ci_collection_insert (CI_COLLECTION coll, long pos, CI_TYPE type, void *ptr, size_t size) { API_DECLARE; int res; COMMON_API_STRUCTURE *pst; API_COLLECTION *co; if (coll == NULL || pos < 0) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } co = (API_COLLECTION *) coll; API_HOUSEKEEP_BEGIN (co->conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); /* convert to zero based index */ res = co->ifs->insert (co, pos - 1, type, ptr, size); API_RETURN (res); } /* * ci_collection_update - * return: * coll(): * pos(): * type(): * ptr(): * size(): */ int ci_collection_update (CI_COLLECTION coll, long pos, CI_TYPE type, void *ptr, size_t size) { API_DECLARE; int res; COMMON_API_STRUCTURE *pst; API_COLLECTION *co; if (coll == NULL || pos <= 0) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } co = (API_COLLECTION *) coll; API_HOUSEKEEP_BEGIN (co->conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); /* convert to zero based index */ res = co->ifs->update (co, pos - 1, type, ptr, size); API_RETURN (res); } /* * ci_collection_delete - * return: * coll(): * pos(): */ int ci_collection_delete (CI_COLLECTION coll, long pos) { API_DECLARE; int res; COMMON_API_STRUCTURE *pst; API_COLLECTION *co; if (coll == NULL || pos <= 0) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } co = (API_COLLECTION *) coll; API_HOUSEKEEP_BEGIN (co->conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); /* convert to zero based index */ res = co->ifs->delete (coll, pos - 1); API_RETURN (res); } /* * ci_collection_get_elem_domain_info - * return: * coll(): * pos(): * type(): * precision(): * scale(): */ int ci_collection_get_elem_domain_info (CI_COLLECTION coll, long pos, CI_TYPE * type, int *precision, int *scale) { API_DECLARE; int res; COMMON_API_STRUCTURE *pst; API_COLLECTION *co; if (coll == NULL || pos <= 0 || type == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } co = (API_COLLECTION *) coll; API_HOUSEKEEP_BEGIN (co->conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); /* convert to zero based index */ res = co->ifs->get_elem_domain_info (coll, pos - 1, type, precision, scale); API_RETURN (res); } /* * ci_collection_get - * return: * coll(): * pos(): * type(): * addr(): * len(): * outlen(): * isnull(): */ int ci_collection_get (CI_COLLECTION coll, long pos, CI_TYPE type, void *addr, size_t len, size_t * outlen, bool * isnull) { API_DECLARE; int res; COMMON_API_STRUCTURE *pst; API_COLLECTION *co; if (coll == NULL || pos <= 0 || outlen == NULL || isnull == NULL) { API_IMPL_TBL->err_set (ER_INTERFACE_INVALID_ARGUMENT); return ER_INTERFACE_INVALID_ARGUMENT; } co = (API_COLLECTION *) coll; API_HOUSEKEEP_BEGIN (co->conn, COMMON_API_STRUCTURE *, pst); API_CHECK_HANDLE (pst, HANDLE_TYPE_CONNECTION); /* convert to zero based index */ res = co->ifs->get_elem (co, pos - 1, type, addr, len, outlen, isnull); API_RETURN (res); }
1.15625
1
qseries.c
deehzee/integer-partitions
5
7997811
/* * qseries.c - q-Series related programs. * * Author: <NAME> <<EMAIL>> * Created: 2016-07-05 * Modified: 2016-07-13 * License: MIT License (see LICENSE.txt) * * Compilation Suggestions: * CC = gcc #( or clang) * CFLAGS = -std=gnu11 -O3 #(or, -O2) * $(CC) $(CFLAGS) -c qseries.c * * Note: We are only dealing with q-series with integer coefficients * (64-bit). */ #include <stdio.h> #include <inttypes.h> #include <string.h> #include "qseries.h" #include "util.h" #define MIN(x, y) (((x) < (y)) ? (x) : (y)) /*******************************************************************\ * Initializers * *******************************************************************/ void init_qseries(qseries_t s, int64_t initial_val) { for (size_t deg = 0; deg < MAXORD; deg++) s[deg] = initial_val; } void mk_qseries(const int64_t a[], size_t start, size_t num, size_t offset, qseries_t s) { size_t max = MIN(MAXORD, num + offset); for (size_t deg = offset; deg + offset < max; deg++) s[deg] = a[start + deg]; } void cp_qseries(const qseries_t s, qseries_t t) { for (size_t deg = 0; deg < MAXORD; deg++) t[deg] = s[deg]; } /*******************************************************************\ * Input/Output * *******************************************************************/ void print_qseries(const qseries_t s, size_t ord) { size_t max = MIN(MAXORD, ord); size_t deg = 0; int nonzero_terms = 0; int64_t abs_coeff; int neg; char *sgn; for (deg = 0; deg < max; deg++) { if (s[deg] == 0) continue; abs_coeff = (s[deg] > 0) ? s[deg] : -s[deg]; neg = abs_coeff - s[deg]; sgn = (neg)? "-" : "+"; if (nonzero_terms) { printf(" %s ", sgn); sgn = ""; } else { sgn = (neg) ? "-" : ""; } if (deg == 0) { printf("%s%" PRId64, sgn, abs_coeff); } else { if (abs_coeff == 1) printf("%s", sgn); else printf("%s%" PRId64 "*", sgn, abs_coeff); if (deg == 1) printf("q"); else printf("q^%zu", deg); } nonzero_terms++; } if (! nonzero_terms) printf("0"); printf(" + O(%zu)", max); } void println_qseries(const qseries_t s, size_t ord) { print_qseries(s, ord); printf("\n"); } void print_coeffs(const qseries_t s, size_t ord) { print_array_int64(ord, s); } void println_coeffs(const qseries_t s, size_t ord) { print_array_int64(ord, s); printf("\n"); } /* TODO */ void read_qseries(const char *buf, qseries_t s) { char *str1, *str2, *tok, *subtok; char *saveptr1, *saveptr2; int j; for (j = 1, str1 = strdup(buf); ; j++, str1 = NULL) { tok = strtok_r(str1, "+", &saveptr1); if (tok == NULL) break; printf ("Term[%d]: %s\n", j, tok); for (str2 = tok; ; str2 = NULL) { subtok = strtok_r(str2, "*", &saveptr2); if (subtok == NULL) break; printf(" --> %s\n", subtok); } } } /*******************************************************************\ * Basic Operations * *******************************************************************/ void shift_qseries(const qseries_t s, int shift, qseries_t ans) { for (size_t deg = 0; deg < MAXORD; deg++) ans[deg] = ((int) deg < shift) ? 0: s[deg - shift]; } void scale_qseries(int64_t c, const qseries_t s, qseries_t ans) { for (size_t deg = 0; deg < MAXORD; deg++) ans[deg] = c * s[deg]; } void add_qseries(const qseries_t s, const qseries_t t, qseries_t ans) { for (size_t deg = 0; deg < MAXORD; deg++) ans[deg] = s[deg] + t[deg]; } void subtract_qseries(const qseries_t s, const qseries_t t, qseries_t ans) { for (size_t deg = 0; deg < MAXORD; deg++) ans[deg] = s[deg] - t[deg]; } void multiply_qseries(const qseries_t s, const qseries_t t, qseries_t ans) { int64_t sum; size_t i; for (size_t deg = 0; deg < MAXORD; deg++) { for(i = 0, sum = 0; i <= deg; i++) sum += s[i] * t[deg - i]; ans[deg] = sum; } } void invert_qseries(const qseries_t s, qseries_t ans) { int64_t sum; size_t i; ans[0] = 1/s[0]; for (size_t deg = 1; deg < MAXORD; deg++) { for (i = 1, sum = 0; i <= deg; i++) sum += s[i] * ans[deg - i]; ans[deg] = -sum / s[0]; } } void divide_qseries(const qseries_t s, const qseries_t t, qseries_t ans) { qseries_t tmp; invert_qseries(t, tmp); multiply_qseries(s, tmp, ans); } /* Compute q-series `s`, raised to the power `n`, result in `ans`. */ /* Right now, n is assumed to be an integer. */ void pow_qseries(const qseries_t s, int n, qseries_t ans) { qseries_t s0, tmp; int abs_n = 0; if (n > 0) { cp_qseries(s, s0); abs_n = n; } else if (n < 0) { invert_qseries(s, s0); abs_n = -n; } init_qseries(ans, 0); ans[0] = 1; for (int i = 0; i < abs_n; i++) { cp_qseries(ans, tmp); multiply_qseries(tmp, s0, ans); } } /*******************************************************************\ * Miscellaneous * *******************************************************************/ void product_side(int mod, const int cong[mod], qseries_t ans) { qseries_t tmp, nxt; init_qseries(ans, 0); ans[0] = 1; for (int n = 1; n < MAXORD; n++) { init_qseries(tmp, 0); tmp[0] = 1; tmp[n] = -1; pow_qseries(tmp, cong[n % mod], nxt); cp_qseries(ans, tmp); multiply_qseries(tmp, nxt, ans); } }
1.828125
2
backends/bmv2/mtpsa_switch/options.h
mtpsa/p4c
0
7997819
#ifndef BACKENDS_BMV2_MTPSA_SWITCH_OPTIONS_H_ #define BACKENDS_BMV2_MTPSA_SWITCH_OPTIONS_H_ #include "backends/bmv2/common/options.h" #include "backends/bmv2/mtpsa_switch/midend.h" namespace BMV2 { class MtPsaSwitchOptions : public BMV2Options { public: MtPsaSwitchOptions() { registerOption("--listMidendPasses", nullptr, [this](const char*) { listMidendPasses = true; loadIRFromJson = false; MtPsaSwitchMidEnd midEnd(*this, outStream); exit(0); return false; }, "[MtPsaSwitch back-end] Lists exact name of all midend passes.\n"); registerOption("--user", nullptr, [this](const char*) { userProgram = true; return true; }, "[MtPsaSwitch back-end] Compile user program.\n"); } }; using MtPsaSwitchContext = P4CContextWithOptions<MtPsaSwitchOptions>; }; // namespace BMV2 #endif /* BACKENDS_BMV2_MTPSA_SWITCH_OPTIONS_H_ */
0.824219
1
addons/audio/oss.c
SiegeLord/allegro5
1
7997827
/* ______ ___ ___ * /\ _ \ /\_ \ /\_ \ * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ * /\____/ * \_/__/ * * Open Sound System sound driver. * * By <NAME>. * * See readme.txt for copyright information. */ #include "allegro5/allegro.h" #include "allegro5/internal/aintern_audio.h" #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <sys/ioctl.h> #include <string.h> #include <poll.h> ALLEGRO_DEBUG_CHANNEL("oss") #if defined ALLEGRO_HAVE_SOUNDCARD_H #include <soundcard.h> #elif defined ALLEGRO_HAVE_SYS_SOUNDCARD_H #include <sys/soundcard.h> #elif defined ALLEGRO_HAVE_LINUX_SOUNDCARD_H #include <linux/soundcard.h> #elif defined ALLEGRO_HAVE_MACHINE_SOUNDCARD_H #include <machine/soundcard.h> #endif #if OSS_VERSION >= 0x040000 #define OSS_VER_4 #else #define OSS_VER_3 #endif #ifndef AFMT_S16_NE #ifdef ALLEGRO_BIG_ENDIAN #define AFMT_S16_NE AFMT_S16_BE #else #define AFMT_S16_NE AFMT_S16_LE #endif #endif #ifndef AFMT_U16_NE #ifdef ALLEGRO_BIG_ENDIAN #define AFMT_U16_NE AFMT_U16_BE #else #define AFMT_U16_NE AFMT_U16_LE #endif #endif /* Audio device used by OSS3. * Make this configurable. */ static const char* oss_audio_device_ver3 = "/dev/dsp"; /* Audio device is dynamically retrived in OSS4. */ static char oss_audio_device[512]; /* timing policy (between 0 and 10), used by OSS4 * Make this configurable? */ #ifdef OSS_VER_4 static const int oss_timing_policy = 5; #endif /* Fragment size, used by OSS3 * Make this configurable? */ static int oss_fragsize = (8 << 16) | (10); /* Auxiliary buffer used to store silence. */ #define SIL_BUF_SIZE 1024 static bool using_ver_4; typedef struct OSS_VOICE { int fd; int volume; /* Copied from the parent ALLEGRO_VOICE. Used for convenince. */ unsigned int len; /* in frames */ unsigned int frame_size; /* in bytes */ volatile bool stopped; volatile bool stop; ALLEGRO_THREAD *poll_thread; } OSS_VOICE; #ifdef OSS_VER_4 static int oss_open_ver4() { int mixer_fd, i; oss_sysinfo sysinfo; if ((mixer_fd = open("/dev/mixer", O_RDWR, 0)) == -1) { switch (errno) { case ENXIO: case ENODEV: ALLEGRO_ERROR("Open Sound System is not running in your system.\n"); break; case ENOENT: ALLEGRO_ERROR("No /dev/mixer device available in your system.\n"); ALLEGRO_ERROR("Perhaps Open Sound System is not installed or " "running.\n"); break; default: ALLEGRO_ERROR("errno: %i -- %s\n", errno, strerror(errno)); } return 1; } if (ioctl(mixer_fd, SNDCTL_SYSINFO, &sysinfo) == -1) { if (errno == ENXIO) { ALLEGRO_ERROR("OSS has not detected any supported sound hardware in " "your system.\n"); } else if (errno == EINVAL) { ALLEGRO_INFO("The version of OSS installed on the system is not " "compatible with OSS4.\n"); } else ALLEGRO_ERROR("errno: %i -- %s\n", errno, strerror(errno)); close(mixer_fd); return 1; } /* Some OSS implementations (ALSA emulation) don't fail on SNDCTL_SYSINFO even * though they don't support OSS4. They *seem* to set numcards to 0. */ if (sysinfo.numcards < 1) { ALLEGRO_WARN("The version of OSS installed on the system is not " "compatible with OSS4.\n"); return 1; } ALLEGRO_INFO("OSS Version: %s\n", sysinfo.version); ALLEGRO_INFO("Found %i sound cards.\n", sysinfo.numcards); for (i = 0; i < sysinfo.numcards; i++) { oss_audioinfo audioinfo; memset(&audioinfo, 0, sizeof(oss_audioinfo)); audioinfo.dev = i; ALLEGRO_INFO("Trying sound card no. %i ...\n", audioinfo.dev); ioctl(mixer_fd, SNDCTL_AUDIOINFO, &audioinfo); if (audioinfo.enabled) { if (strlen(audioinfo.devnode)) { strncpy(oss_audio_device, audioinfo.devnode, 512); } else if (audioinfo.legacy_device != -1) { sprintf(oss_audio_device, "/dev/dsp%i", audioinfo.legacy_device); } else { ALLEGRO_ERROR("Cannot find device name.\n"); } ALLEGRO_INFO("Using device: %s\n", oss_audio_device); break; } else { ALLEGRO_INFO("Device disabled.\n"); } } if (i == sysinfo.numcards) { ALLEGRO_ERROR("Couldn't find a suitable device.\n"); close(mixer_fd); return 1; } close(mixer_fd); using_ver_4 = true; return 0; } #endif static int oss_open_ver3(void) { ALLEGRO_CONFIG *config = al_get_system_config(); if (config) { const char *config_device; config_device = al_get_config_value(config, "oss", "device"); if (config_device && config_device[0] != '\0') oss_audio_device_ver3 = config_device; } int fd = open(oss_audio_device_ver3, O_WRONLY); if (fd == -1) { switch (errno) { case ENXIO: case ENODEV: ALLEGRO_ERROR("Open Sound System is not running in your " "system.\n"); break; case ENOENT: ALLEGRO_ERROR("No '%s' device available in your system.\n", oss_audio_device_ver3); ALLEGRO_ERROR("Perhaps Open Sound System is not installed " "or running.\n"); break; default: ALLEGRO_ERROR("errno: %i -- %s\n", errno, strerror(errno)); } return 1; } close(fd); strncpy(oss_audio_device, oss_audio_device_ver3, 512); ALLEGRO_INFO("Using device: %s\n", oss_audio_device); using_ver_4 = false; return 0; } static int oss_open(void) { bool force_oss3 = false; ALLEGRO_CONFIG *config = al_get_system_config(); if (config) { const char *force_oss3_cfg; force_oss3_cfg = al_get_config_value(config, "oss", "force_ver3"); if (force_oss3_cfg && force_oss3_cfg[0] != '\0') force_oss3 = strcmp(force_oss3_cfg, "yes") ? false : true; } if (force_oss3) { ALLEGRO_WARN("Skipping OSS4 probe.\n"); } #ifdef OSS_VER_4 bool inited = false; if (!force_oss3) { if (oss_open_ver4()) ALLEGRO_WARN("OSS ver. 4 init failed, trying ver. 3...\n"); else inited = true; } if (!inited && oss_open_ver3()) { ALLEGRO_ERROR("Failed to init OSS.\n"); return 1; } #else ALLEGRO_INFO("OSS4 support not compiled in. Skipping OSS4 probe.\n"); if (oss_open_ver3()) { ALLEGRO_ERROR("Failed to init OSS.\n"); return 1; } #endif return 0; } static void oss_close(void) { } static void oss_deallocate_voice(ALLEGRO_VOICE *voice) { OSS_VOICE *oss_voice = voice->extra; /* We do NOT hold the voice mutex here, so this does NOT result in a * deadlock when oss_update calls _al_voice_update (which tries to * acquire the voice->mutex). */ al_join_thread(oss_voice->poll_thread, NULL); al_destroy_thread(oss_voice->poll_thread); close(oss_voice->fd); al_free(voice->extra); voice->extra = NULL; } static int oss_start_voice(ALLEGRO_VOICE *voice) { OSS_VOICE *ex_data = voice->extra; ex_data->stop = false; return 0; } static int oss_stop_voice(ALLEGRO_VOICE *voice) { OSS_VOICE *ex_data = voice->extra; ex_data->stop = true; if (!voice->is_streaming) { voice->attached_stream->pos = 0; } while (!ex_data->stopped) al_rest(0.001); return 0; } static int oss_load_voice(ALLEGRO_VOICE *voice, const void *data) { OSS_VOICE *ex_data = voice->extra; /* * One way to support backward playing would be to do like alsa driver does: * mmap(2) the FD and write reversed samples into that. To much trouble for * an optional feature IMO. -- milan */ if (voice->attached_stream->loop == ALLEGRO_PLAYMODE_BIDIR) { ALLEGRO_INFO("Backwards playing not supported by the driver.\n"); return -1; } voice->attached_stream->pos = 0; ex_data->len = voice->attached_stream->spl_data.len; return 0; (void)data; } static void oss_unload_voice(ALLEGRO_VOICE *voice) { (void)voice; } static bool oss_voice_is_playing(const ALLEGRO_VOICE *voice) { OSS_VOICE *ex_data = voice->extra; return !ex_data->stopped; } static unsigned int oss_get_voice_position(const ALLEGRO_VOICE *voice) { return voice->attached_stream->pos; } static int oss_set_voice_position(ALLEGRO_VOICE *voice, unsigned int val) { voice->attached_stream->pos = val; return 0; } /* * Updates the supplied non-streaming voice. * buf - Returns a pointer to the buffer containing sample data. * bytes - The requested size of the sample data buffer. Returns the actual * size of returned the buffer. * Updates 'stop', 'pos' and 'reversed' fields of the supplied voice to the * future position. */ static int oss_update_nonstream_voice(ALLEGRO_VOICE *voice, void **buf, int *bytes) { OSS_VOICE *oss_voice = voice->extra; int bpos = voice->attached_stream->pos * oss_voice->frame_size; int blen = oss_voice->len * oss_voice->frame_size; *buf = (char *)voice->attached_stream->spl_data.buffer.ptr + bpos; if (bpos + *bytes > blen) { *bytes = blen - bpos; if (voice->attached_stream->loop == ALLEGRO_PLAYMODE_ONCE) { oss_voice->stop = true; voice->attached_stream->pos = 0; } if (voice->attached_stream->loop == ALLEGRO_PLAYMODE_LOOP) { voice->attached_stream->pos = 0; } /*else if (voice->attached_stream->loop == ALLEGRO_PLAYMODE_BIDIR) { oss_voice->reversed = true; voice->attached_stream->pos = oss_voice->len; }*/ return 1; } else voice->attached_stream->pos += *bytes / oss_voice->frame_size; return 0; } static void oss_update_silence(ALLEGRO_VOICE *voice, OSS_VOICE *oss_voice) { char sil_buf[SIL_BUF_SIZE]; unsigned int silent_samples; silent_samples = SIL_BUF_SIZE / (al_get_audio_depth_size(voice->depth) * al_get_channel_count(voice->chan_conf)); al_fill_silence(sil_buf, silent_samples, voice->depth, voice->chan_conf); if (write(oss_voice->fd, sil_buf, SIL_BUF_SIZE) == -1) { ALLEGRO_ERROR("errno: %i -- %s\n", errno, strerror(errno)); } } static void* oss_update(ALLEGRO_THREAD *self, void *arg) { ALLEGRO_VOICE *voice = arg; OSS_VOICE *oss_voice = voice->extra; (void)self; while (!al_get_thread_should_stop(self)) { /* For possible eventual non-blocking mode: audio_buf_info bi; if (ioctl(oss_voice->fd, SNDCTL_DSP_GETOSPACE, &bi) == -1) { ALLEGRO_ERROR("Error SNDCTL_DSP_GETOSPACE, errno=%i (%s)\n", errno, strerror(errno)); return NULL; } len = bi.bytes; */ /* How many bytes are we supposed to try to write at once? */ unsigned int frames = 1024; if (oss_voice->stop && !oss_voice->stopped) { oss_voice->stopped = true; } if (!oss_voice->stop && oss_voice->stopped) { oss_voice->stopped = false; } if (!voice->is_streaming && !oss_voice->stopped) { void *buf; int bytes = frames * oss_voice->frame_size; oss_update_nonstream_voice(voice, &buf, &bytes); frames = bytes / oss_voice->frame_size; if (write(oss_voice->fd, buf, bytes) == -1) { ALLEGRO_ERROR("errno: %i -- %s\n", errno, strerror(errno)); if (errno != EINTR) return NULL; } } else if (voice->is_streaming && !oss_voice->stopped) { const void *data = _al_voice_update(voice, voice->mutex, &frames); if (data == NULL) { oss_update_silence(voice, oss_voice); continue; } if (write(oss_voice->fd, data, frames * oss_voice->frame_size) == -1) { ALLEGRO_ERROR("errno: %i -- %s\n", errno, strerror(errno)); if (errno != EINTR) return NULL; } } else { /* If stopped just fill with silence. */ oss_update_silence(voice, oss_voice); } } return NULL; } static int oss_allocate_voice(ALLEGRO_VOICE *voice) { int format; int chan_count; OSS_VOICE *ex_data = al_calloc(1, sizeof(OSS_VOICE)); if (!ex_data) return 1; ex_data->fd = open(oss_audio_device, O_WRONLY/*, O_NONBLOCK*/); if (ex_data->fd == -1) { ALLEGRO_ERROR("Failed to open audio device '%s'.\n", oss_audio_device); ALLEGRO_ERROR("errno: %i -- %s\n", errno, strerror(errno)); al_free(ex_data); return 1; } chan_count = al_get_channel_count(voice->chan_conf); ex_data->frame_size = chan_count * al_get_audio_depth_size(voice->depth); if (!ex_data->frame_size) goto Error; ex_data->stop = true; ex_data->stopped = true; if (voice->depth == ALLEGRO_AUDIO_DEPTH_INT8) format = AFMT_S8; else if (voice->depth == ALLEGRO_AUDIO_DEPTH_UINT8) format = AFMT_U8; else if (voice->depth == ALLEGRO_AUDIO_DEPTH_INT16) format = AFMT_S16_NE; else if (voice->depth == ALLEGRO_AUDIO_DEPTH_UINT16) format = AFMT_U16_NE; #ifdef OSS_VER_4 else if (voice->depth == ALLEGRO_AUDIO_DEPTH_INT24) format = AFMT_S24_NE; else if (voice->depth == ALLEGRO_AUDIO_DEPTH_FLOAT32) format = AFMT_FLOAT; #endif else { ALLEGRO_ERROR("Unsupported OSS sound format.\n"); goto Error; } int tmp_format = format; int tmp_chan_count = chan_count; unsigned int tmp_freq = voice->frequency; int tmp_oss_fragsize = oss_fragsize; if (using_ver_4) { #ifdef OSS_VER_4 int tmp_oss_timing_policy = oss_timing_policy; if (ioctl(ex_data->fd, SNDCTL_DSP_POLICY, &tmp_oss_timing_policy) == -1) { ALLEGRO_ERROR("Failed to set_timig policity to '%i'.\n", tmp_oss_timing_policy); ALLEGRO_ERROR("errno: %i -- %s\n", errno, strerror(errno)); goto Error; } ALLEGRO_INFO("Accepted timing policy value: %i\n", tmp_oss_timing_policy); #endif } else { if (ioctl(ex_data->fd, SNDCTL_DSP_SETFRAGMENT, &tmp_oss_fragsize) == -1) { ALLEGRO_ERROR("Failed to set fragment size.\n"); ALLEGRO_ERROR("errno: %i -- %s\n", errno, strerror(errno)); goto Error; } } if (ioctl(ex_data->fd, SNDCTL_DSP_SETFMT, &tmp_format) == -1) { ALLEGRO_ERROR("Failed to set sample format.\n"); ALLEGRO_ERROR("errno: %i -- %s\n", errno, strerror(errno)); goto Error; } if (tmp_format != format) { ALLEGRO_ERROR("Sample format not supported by the driver.\n"); goto Error; } if (ioctl(ex_data->fd, SNDCTL_DSP_CHANNELS, &tmp_chan_count)) { ALLEGRO_ERROR("Failed to set channel count.\n"); ALLEGRO_ERROR("errno: %i -- %s\n", errno, strerror(errno)); goto Error; } if (tmp_chan_count != chan_count) { ALLEGRO_ERROR("Requested sample channe count %i, got %i.\n", tmp_chan_count, chan_count); } if (ioctl(ex_data->fd, SNDCTL_DSP_SPEED, &tmp_freq) == -1) { ALLEGRO_ERROR("Failed to set sample rate.\n"); ALLEGRO_ERROR("errno: %i -- %s\n", errno, strerror(errno)); goto Error; } if (voice->frequency != tmp_freq) { ALLEGRO_ERROR("Requested sample rate %u, got %iu.\n", voice->frequency, tmp_freq); } voice->extra = ex_data; ex_data->poll_thread = al_create_thread(oss_update, (void*)voice); al_start_thread(ex_data->poll_thread); return 0; Error: close(ex_data->fd); al_free(ex_data); return 1; } ALLEGRO_AUDIO_DRIVER _al_kcm_oss_driver = { "OSS", oss_open, oss_close, oss_allocate_voice, oss_deallocate_voice, oss_load_voice, oss_unload_voice, oss_start_voice, oss_stop_voice, oss_voice_is_playing, oss_get_voice_position, oss_set_voice_position, NULL, NULL }; /* vim: set sts=3 sw=3 et: */
1.289063
1
src/mma7660/mma7660_regs.h
moredu/upm
619
7997835
/* * Author: <NAME> <<EMAIL>> * Copyright (c) 2016 Intel Corporation. * * This program and the accompanying materials are made available under the * terms of the The MIT License which is available at * https://opensource.org/licenses/MIT. * * SPDX-License-Identifier: MIT */ #pragma once #define MMA7660_DEFAULT_I2C_BUS 0 #define MMA7660_DEFAULT_I2C_ADDR 0x4c #ifdef __cplusplus extern "C" { #endif // MMA7660 registers typedef enum { MMA7660_REG_XOUT = 0x00, MMA7660_REG_YOUT = 0x01, MMA7660_REG_ZOUT = 0x02, MMA7660_REG_TILT = 0x03, MMA7660_REG_SRST = 0x04, // Sampling Rate Status MMA7660_REG_SPCNT = 0x05, // sleep count MMA7660_REG_INTSU = 0x06, // Interrupt setup MMA7660_REG_MODE = 0x07, // operating mode MMA7660_REG_SR = 0x08, // auto-wake/sleep, SPS, and debounce MMA7660_REG_PDET = 0x09, // tap detection MMA7660_REG_PD = 0x0a // tap debounce count // 0x0b-0x1f reserved } MMA7660_REG_T; // interrupt enable register bits typedef enum { MMA7660_INTR_NONE = 0x00, // disabled MMA7660_INTR_FBINT = 0x01, // front/back MMA7660_INTR_PLINT = 0x02, // up/down/right/left MMA7660_INTR_PDINT = 0x04, // tap detection MMA7660_INTR_ASINT = 0x08, // exit auto-sleep MMA7660_INTR_GINT = 0x10, // measurement intr MMA7660_INTR_SHINTZ = 0x20, // shake on Z MMA7660_INTR_SHINTY = 0x40, // shake on Y MMA7660_INTR_SHINTX = 0x80 // shake on X } MMA7660_INTR_T; // operating mode register bits typedef enum { MMA7660_MODE_MODE = 0x01, // determines mode with MODE_TON // 0x02 reserved MMA7660_MODE_TON = 0x04, // determines mode with MODE_MODE MMA7660_MODE_AWE = 0x08, // auto-wake MMA7660_MODE_ASE = 0x10, // auto-sleep MMA7660_MODE_SCPS = 0x20, // sleep count prescale MMA7660_MODE_IPP = 0x40, // intr out push-pull/open drain MMA7660_MODE_IAH = 0x80 // intr active low/high } MMA7660_MODE_T; // tilt BackFront (BF) bits typedef enum { MMA7660_BF_UNKNOWN = 0x00, MMA7660_BF_LYING_FRONT = 0x01, MMA7660_BF_LYING_BACK = 0x02 } MMA7660_TILT_BF_T; // tilt LandscapePortrait (LP) bits typedef enum { MMA7660_LP_UNKNOWN = 0x00, MMA7660_LP_LANDSCAPE_LEFT = 0x01, MMA7660_LP_LANDSCAPE_RIGHT = 0x02, MMA7660_LP_VERT_DOWN = 0x05, MMA7660_LP_VERT_UP = 0x06 } MMA7660_TILT_LP_T; // sample rate (auto-sleep) values typedef enum { MMA7660_AUTOSLEEP_120 = 0x00, MMA7660_AUTOSLEEP_64 = 0x01, MMA7660_AUTOSLEEP_32 = 0x02, MMA7660_AUTOSLEEP_16 = 0x03, MMA7660_AUTOSLEEP_8 = 0x04, MMA7660_AUTOSLEEP_4 = 0x05, MMA7660_AUTOSLEEP_2 = 0x06, MMA7660_AUTOSLEEP_1 = 0x07 } MMA7660_AUTOSLEEP_T; #ifdef __cplusplus } #endif
1.359375
1
Source/RegionGrowing/Algorithm/tcods/Problem.h
timdecode/InteractiveElementPalettes
33
7997843
//============================================================ // Problem.h // // A Problem reads in a problem description from the command // line and computes the corresponding solution (i.e., a // tangent direction field on the specified mesh with the // specified singularities). Input is given by a regular // ASCII text file containing lines of the following format // in any order: // // in [path to input mesh file] // out [path to output data] // vertex [0-based vertex ID] [target holonomy] // generator [0-based generator ID] [target holonomy] // angle [initial field angle] // // Terms in square brackets [] need to be specified by // the user. An example input file can be found in // test/problem.txt // #ifndef PROBLEM_H #define PROBLEM_H #include <vector> #include <iosfwd> #include <string> namespace tcods { typedef std::pair<int,double> Singularity; typedef std::pair<int,double> Generator; class Problem { public: Problem( void ); // default constructor Problem( std::istream& in ); // construct a problem from a valid istream void read( std::istream& in ); // load a problem from a valid istream void solve( void ) const; // solve the problem protected: std::string inputPath; std::string outputPath; double fieldAngle; std::vector<Singularity> singularities; std::vector<Generator> generators; }; } #endif
2.078125
2
include/swaybar/render.h
udfn/sway
0
7997851
#ifndef _SWAYBAR_RENDER_H #define _SWAYBAR_RENDER_H struct swaybar_output; struct swaybar; void destroy_popup(struct swaybar *bar); void render_popup(struct swaybar_output *output); void render_frame(struct swaybar_output *output); #endif
0.566406
1
SCSDKCoreKit/SCSDKCoreKit.framework/Headers/NSURLRequest+cURL.h
Sweepin/SweepinConnect-iOS
2
7997859
// // NSURLRequest+cURL.h // SCSDKCoreKit // // Created by Alex on 22/02/2017. // Copyright © 2017 Sweepin. All rights reserved. // #import <Foundation/Foundation.h> @interface NSURLRequest (cURL) - (NSString *)cURLCommandString; - (NSString *)cURLCommandStringWithSession:(NSURLSession *)session; @end
0.46875
0
wireshark-2.0.13/epan/wslua/wslua_internals.c
mahrukhfida/mi
0
7997867
/* * wslua_internals.c * * Wireshark's interface to the Lua Programming Language * * This file is for internal WSLUA functions - not ones exposed into Lua. * * (c) 2013, <NAME> <<EMAIL>> * * Wireshark - Network traffic analyzer * By <NAME> <<EMAIL>> * Copyright 1998 <NAME> * * This program 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 2 * of the License, or (at your option) any later version. * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "config.h" #include "wslua.h" WSLUA_API int wslua__concat(lua_State* L) { /* Concatenate two objects to a string */ if (!luaL_callmeta(L,1,"__tostring")) lua_pushvalue(L,1); if (!luaL_callmeta(L,2,"__tostring")) lua_pushvalue(L,2); lua_concat(L,2); return 1; } /* like lua_toboolean, except only coerces int, nil, and bool, and errors on other types. note that normal lua_toboolean returns 1 for any Lua value different from false and nil; otherwise it returns 0. So a string would give a 0, as would a number of 1. This function errors if the arg is a string, and sets the boolean to 1 for any number other than 0. Like toboolean, this returns FALSE if the arg was missing. */ WSLUA_API gboolean wslua_toboolean(lua_State* L, int n) { gboolean val = FALSE; if ( lua_isboolean(L,n) || lua_isnil(L,n) || lua_gettop(L) < n ) { val = lua_toboolean(L,n); } else if ( lua_type(L,n) == LUA_TNUMBER ) { int num = (int)luaL_checkinteger(L,n); val = num != 0 ? TRUE : FALSE; } else { luaL_argerror(L,n,"must be a boolean or number"); } return val; } /* like luaL_checkinteger, except for booleans - this does not coerce other types */ WSLUA_API gboolean wslua_checkboolean(lua_State* L, int n) { if (!lua_isboolean(L,n) ) { luaL_argerror(L,n,"must be a boolean"); } return lua_toboolean(L,n);; } WSLUA_API gboolean wslua_optbool(lua_State* L, int n, gboolean def) { gboolean val = FALSE; if ( lua_isboolean(L,n) ) { val = lua_toboolean(L,n); } else if ( lua_isnil(L,n) || lua_gettop(L) < n ){ val = def; } else { luaL_argerror(L,n,"must be a boolean"); } return val; } /* like lua_tointeger, except only coerces int, nil, and bool, and errors on other types. note that normal lua_tointeger does not coerce nil or bool, but does coerce strings. */ WSLUA_API lua_Integer wslua_tointeger(lua_State* L, int n) { lua_Integer val = 0; if ( lua_type(L,n) == LUA_TNUMBER) { val = lua_tointeger(L,n); } else if ( lua_isboolean(L,n) ) { val = (lua_Integer) (lua_toboolean(L,n)); } else if ( lua_isnil(L,n) ) { val = 0; } else { luaL_argerror(L,n,"must be a integer, boolean or nil"); } return val; } /* like luaL_optint, except converts/handles Lua booleans as well */ WSLUA_API int wslua_optboolint(lua_State* L, int n, int def) { int val = 0; if ( lua_isnumber(L,n) ) { val = (int)lua_tointeger(L,n); } else if ( lua_isboolean(L,n) ) { val = lua_toboolean(L,n) ? 1 : 0; } else if ( lua_isnil(L,n) || lua_gettop(L) < n ){ val = def; } else { luaL_argerror(L,n,"must be a boolean or integer"); } return val; } /* like luaL_checklstring, except no coercion */ WSLUA_API const char* wslua_checklstring_only(lua_State* L, int n, size_t *l) { if (lua_type(L,n) != LUA_TSTRING) { luaL_argerror(L,n,"must be a Lua string"); } return luaL_checklstring(L, n, l); } /* like luaL_checkstring, except no coercion */ WSLUA_API const char* wslua_checkstring_only(lua_State* L, int n) { return wslua_checklstring_only(L, n, NULL); } WSLUA_API const gchar* lua_shiftstring(lua_State* L, int i) { const gchar* p = luaL_checkstring(L, i); if (p) { lua_remove(L,i); return p; } else { return NULL; } } /* following is based on the luaL_setfuncs() from Lua 5.2, so we can use it in pre-5.2 */ WSLUA_API void wslua_setfuncs(lua_State *L, const luaL_Reg *l, int nup) { luaL_checkstack(L, nup, "too many upvalues"); for (; l->name != NULL; l++) { /* fill the table with given functions */ int i; for (i = 0; i < nup; i++) /* copy upvalues to the top */ lua_pushvalue(L, -nup); lua_pushcclosure(L, l->func, nup); /* closure with those upvalues */ lua_setfield(L, -(nup + 2), l->name); } lua_pop(L, nup); /* remove upvalues */ } /* identical to lua_getfield but without triggering metamethods warning: cannot be used directly with negative index (and shouldn't be changed to) decrement your negative index if you want to use this */ static void lua_rawgetfield(lua_State *L, int idx, const char *k) { lua_pushstring(L, k); lua_rawget(L, idx); } /* identical to lua_setfield but without triggering metamethods warning: cannot be used with negative index (and shouldn't be changed to) decrement your negative index if you want to use this */ static void lua_rawsetfield (lua_State *L, int idx, const char *k) { lua_pushstring(L, k); lua_insert(L, -2); lua_rawset(L, idx); } WSLUA_API void wslua_print_stack(char* s, lua_State* L) { int i; for (i=1;i<=lua_gettop(L);i++) { printf("%s-%i: %s\n",s,i,lua_typename (L,lua_type(L, i))); } printf("\n"); } /* C-code function equivalent of the typeof() function we created in Lua. * The Lua one is for Lua scripts to use, this one is for C-code to use. */ const gchar* wslua_typeof_unknown = "UNKNOWN"; const gchar* wslua_typeof(lua_State *L, int idx) { const gchar *classname = wslua_typeof_unknown; /* we'll try getting the class name for error reporting*/ if (luaL_getmetafield(L, idx, WSLUA_TYPEOF_FIELD)) { classname = luaL_optstring(L, -1, wslua_typeof_unknown); lua_pop(L,1); /* pop __typeof result */ } else if (lua_type(L,idx) == LUA_TTABLE) { lua_rawgetfield(L, idx, WSLUA_TYPEOF_FIELD); classname = luaL_optstring(L, -1, wslua_typeof_unknown); lua_pop(L,1); /* pop __typeof result */ } return classname; } /* this gets a Lua table of the given name, from the table at the given * location idx. If it does not get a table, it pops whatever it got * and returns false. * warning: cannot be used with pseudo-indeces like LUA_REGISTRYINDEX */ gboolean wslua_get_table(lua_State *L, int idx, const gchar *name) { gboolean result = TRUE; if (idx < 0) idx--; lua_rawgetfield(L, idx, name); if (!lua_istable(L,-1)) { lua_pop(L,1); result = FALSE; } return result; } /* this gets a table field of the given name, from the table at the given * location idx. If it does not get a field, it pops whatever it got * and returns false. * warning: cannot be used with pseudo-indeces like LUA_REGISTRYINDEX */ gboolean wslua_get_field(lua_State *L, int idx, const gchar *name) { gboolean result = TRUE; if (idx < 0) idx--; lua_rawgetfield(L, idx, name); if (lua_isnil(L,-1)) { lua_pop(L,1); result = FALSE; } return result; } /* This verifies/asserts that field 'name' doesn't already exist in table at location idx. * If it does, this EXITS wireshark, because this is a fundamental programming error. * As such, this function is only useful for special circumstances, notably * those that will happen on application start every time, as opposed to * something that could happen only if a Lua script makes it happen. */ void wslua_assert_table_field_new(lua_State *L, int idx, const gchar *name) { lua_rawgetfield(L, idx, name); if (!lua_isnil (L, -1)) { fprintf(stderr, "ERROR: Field %s already exists!\n", name); exit(1); } lua_pop (L, 1); /* pop the nil */ \ } /* This function is an attribute field __index/__newindex (ie, getter/setter) dispatcher. * What the heck does that mean? Well, when a Lua script tries to retrieve a * table/userdata field by doing this: * local foo = myobj.fieldname * if 'fieldname' does not exist in the 'myobj' table/userdata, then Lua calls * the '__index' metamethod of the table/userdata, and puts onto the Lua * stack the table and fieldname string. So this function here handles that, * by dispatching that request to the appropriate getter function in the * __getters table within the metatable of the userdata. That table and * its functions were populated by the WSLUA_REGISTER_ATTRIBUTES() macro, and * really by wslua_reg_attributes(). */ static int wslua_attribute_dispatcher (lua_State *L) { lua_CFunction cfunc = NULL; const gchar *fieldname = lua_shiftstring(L,2); /* remove the field name */ const gchar *classname = NULL; const gchar *type = NULL; /* the userdata object is at index 1, fieldname was at 2 but no longer, now we get the getter/setter table at upvalue 1 */ if (!lua_istable(L, lua_upvalueindex(1))) return luaL_error(L, "Accessor dispatcher cannot retrieve the getter/setter table"); lua_rawgetfield(L, lua_upvalueindex(1), fieldname); /* field's cfunction is now at -1 */ if (!lua_iscfunction(L, -1)) { lua_pop(L,1); /* pop whatever we got before */ /* check if there's a methods table */ if (lua_istable(L, lua_upvalueindex(2))) { lua_rawgetfield(L, lua_upvalueindex(2), fieldname); if (lua_iscfunction(L,-1)) { /* we found a method for Lua to call, so give it back to Lua */ return 1; } lua_pop(L,1); /* pop whatever we got before */ } classname = wslua_typeof(L, 1); type = wslua_typeof(L, lua_upvalueindex(1)); lua_pop(L, 1); /* pop the nil/invalid getfield result */ return luaL_error(L, "No such '%s' %s attribute/field for object type '%s'", fieldname, type, classname); } cfunc = lua_tocfunction(L, -1); lua_pop(L, 1); /* pop the cfunction */ /* the stack is now as if it had been calling the getter/setter c-function directly, so do it */ return (*cfunc)(L); } /* This function "registers" attribute functions - i.e., getters/setters for Lua objects. * This way we don't have to write the __index/__newindex function dispatcher for every * wslua class. Instead, your class should use WSLUA_REGISTER_ATTRIBUTES(classname), which * ultimately calls this one - it calls it twice: once to register getters, once to register * setters. * * The way this all works is every wslua class has a metatable. One of the fields of that * metatable is a __index field, used for "getter" access, and a __newindex field used for * "setter" access. If the __index field's _value_ is a Lua table, then Lua looks * up that table, as it does for class methods for example; but if the __index field's * value is a function/cfunction, Lua calls it instead to get/set the field. So * we use that behavior to access our getters/setters, by creating a table of getter * cfunctions, saving that as an upvalue of a dispatcher cfunction, and using that * dispatcher cfunction as the value of the __index field of the metatable of the wslua object. * * In some cases, the metatable _index/__newindex will already be a function; for example if * class methods were registered, then __index will already be a function In that case, we * move the __methods table to be an upvalue of the attribute dispatcher function. The attribute * dispatcher will look for it and return the method, if it doesn't find an attribute field. * The code below makes sure the attribute names don't overlap with method names. * * This function assumes there's a class metatable on top of the stack when it's initially called, * and leaves it on top when done. */ int wslua_reg_attributes(lua_State *L, const wslua_attribute_table *t, gboolean is_getter) { int midx = lua_gettop(L); const gchar *metafield = is_getter ? "__index" : "__newindex"; int idx; int nup = 1; /* number of upvalues */ if (!lua_istable(L, midx)) { fprintf(stderr, "No metatable in the Lua stack when registering attributes!\n"); exit(1); } /* check if there's a __index/__newindex table already - could be if this class has methods */ lua_rawgetfield(L, midx, metafield); if (lua_isnil(L, -1)) { /* there isn't one, pop the nil */ lua_pop(L,1); } else if (lua_istable(L, -1)) { /* there is one, so make it be the attribute dispatchers upvalue #2 table */ nup = 2; } else if (lua_iscfunction(L, -1)) { /* there's a methods __index dispatcher, copy the __methods table */ lua_pop(L,1); /* pop the cfunction */ lua_rawgetfield(L, midx, "__methods"); if (!lua_istable(L, -1)) { /* oh oh, something's wrong */ fprintf(stderr, "got a __index cfunction but no __methods table when registering attributes!\n"); exit(1); } nup = 2; } else { fprintf(stderr, "'%s' field is not a table in the Lua stack when registering attributes!\n", metafield); exit(1); } /* make our new getter/setter table - we don't need to pop it later */ lua_newtable(L); idx = lua_gettop(L); /* fill the getter/setter table with given functions */ for (; t->fieldname != NULL; t++) { lua_CFunction cfunc = is_getter ? t->getfunc : t->setfunc; if (cfunc) { /* if there's a previous methods table, make sure this attribute name doesn't collide */ if (nup > 1) { lua_rawgetfield(L, -2, t->fieldname); if (!lua_isnil(L,-1)) { fprintf(stderr, "'%s' attribute name already exists as method name for the class\n", t->fieldname); exit(1); } lua_pop(L,1); /* pop the nil */ } lua_pushcfunction(L, cfunc); lua_rawsetfield(L, idx, t->fieldname); } } /* push the getter/setter table name into its table, for error reporting purposes */ lua_pushstring(L, (is_getter ? "getter" : "setter")); lua_rawsetfield(L, idx, WSLUA_TYPEOF_FIELD); /* copy table into the class's metatable, for introspection */ lua_pushvalue(L, idx); lua_rawsetfield(L, midx, (is_getter ? "__getters" : "__setters")); if (nup > 1) { /* we've got more than one upvalue, so move the new getter/setter to the bottom-most of those */ lua_insert(L,-nup); } /* we should now be back to having gettter/setter table at -1 (or -2 if there was a previous methods table) */ /* create upvalue of getter/setter table for wslua_attribute_dispatcher function */ lua_pushcclosure(L, wslua_attribute_dispatcher, nup); /* pushes cfunc with upvalue, removes getter/setter table */ lua_rawsetfield(L, midx, metafield); /* sets this dispatch function as __index/__newindex field of metatable */ /* we should now be back to real metatable being on top */ return 0; } /* similar to __index metamethod but without triggering more metamethods */ static int wslua__index(lua_State *L) { const gchar *fieldname = lua_shiftstring(L,2); /* remove the field name */ /* the userdata object or table is at index 1, fieldname was at 2 but no longer, now we get the metatable, so we can get the methods table */ if (!lua_getmetatable(L,1)) { /* this should be impossible */ return luaL_error(L, "No such '%s' field", fieldname); } lua_rawgetfield(L, 2, "__methods"); /* method table is now at 3 */ lua_remove(L,2); /* remove metatable, methods table is at 2 */ if (!lua_istable(L, -1)) { const gchar *classname = wslua_typeof(L, 1); lua_pop(L, 1); /* pop the nil getfield result */ return luaL_error(L, "No such '%s' field for object type '%s'", fieldname, classname); } lua_rawgetfield(L, 2, fieldname); /* field's value/function is now at 3 */ lua_remove(L,2); /* remove methods table, field value si at 2 */ if (lua_isnil(L, -1)) { const gchar *classname = wslua_typeof(L, 1); lua_pop(L, 1); /* pop the nil getfield result */ return luaL_error(L, "No such '%s' function/method/field for object type '%s'", fieldname, classname); } /* we found a method for Lua to call, or a value of some type, so give it back to Lua */ return 1; } /* * This function assumes there's a class methods table at index 1, and its metatable at 2, * when it's initially called, and leaves them that way when done. */ int wslua_set__index(lua_State *L) { if (!lua_istable(L, 2) || !lua_istable(L, 1)) { fprintf(stderr, "No metatable or class table in the Lua stack when registering __index!\n"); exit(1); } /* push a copy of the class methods table, and set it to be the metatable's __methods field */ lua_pushvalue (L, 1); lua_rawsetfield(L, 2, "__methods"); /* set the wslua__index to be the __index metamethod */ lua_pushcfunction(L, wslua__index); lua_rawsetfield(L, 2, "__index"); /* we should now be back to real metatable being on top */ return 0; } /* Pushes a hex string of the binary data argument. */ int wslua_bin2hex(lua_State* L, const guint8* data, const guint len, const gboolean lowercase, const gchar* sep) { luaL_Buffer b; guint i = 0; static const char byte_to_str_upper[256][3] = { "00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F", "10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F", "20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F", "30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F", "40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F", "50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F", "60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F", "70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F", "80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F", "90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F", "A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF", "B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF", "C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF", "D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF", "E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF", "F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF" }; static const char byte_to_str_lower[256][3] = { "00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f", "10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f", "20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f", "30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f", "40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f", "50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f", "60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f", "70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f", "80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f", "90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f", "a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af", "b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf", "c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf", "d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df", "e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef", "f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff" }; const char (*byte_to_str)[3] = byte_to_str_upper; const guint last = len - 1; if (lowercase) byte_to_str = byte_to_str_lower; luaL_buffinit(L, &b); for (i = 0; i < len; i++) { luaL_addlstring(&b, &(*byte_to_str[data[i]]), 2); if (sep && i < last) luaL_addstring(&b, sep); } luaL_pushresult(&b); return 1; } /* Pushes a binary string of the hex-ascii data argument. */ int wslua_hex2bin(lua_State* L, const char* data, const guint len, const gchar* sep) { luaL_Buffer b; guint i = 0; guint seplen = 0; gint8 c, d; static const gint8 str_to_nibble[256] = { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1, -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 }; if (sep) seplen = (guint) strlen(sep); luaL_buffinit(L, &b); for (i = 0; i < len;) { c = str_to_nibble[(guchar)data[i]]; if (c < 0) { if (seplen && strncmp(&data[i], sep, seplen) == 0) { i += seplen; continue; } else { break; } } d = str_to_nibble[(guchar)data[++i]]; if (d < 0) break; luaL_addchar(&b, (c * 16) + d); i++; } luaL_pushresult(&b); return 1; } /* * Editor modelines - http://www.wireshark.org/tools/modelines.html * * Local variables: * c-basic-offset: 4 * tab-width: 8 * indent-tabs-mode: nil * End: * * vi: set shiftwidth=4 tabstop=8 expandtab: * :indentSize=4:tabSize=8:noTabs=true: */
1.835938
2
src/Tile_Set.c
Timdo45/gf2d
0
7997875
#include "simple_logger.h" #include "Tile_Set.h" typedef struct { TileSet* tile_set_list; Uint32 tileset_count; }TileSetManager; static TileSetManager tile_set_manager = { 0 }; void tile_set_manager_close() { int i; for (i = 0; i < tile_set_manager.tileset_count; i++) { tile_set_free(&tile_set_manager.tile_set_list[i]); } free(tile_set_manager.tile_set_list); } void tile_set_manager_init(Uint32 tileset_count) { if (tileset_count <= 0) { slog("cannot init zero tilesets"); return; } tile_set_manager.tile_set_list = (TileSet*)gfc_allocate_array(sizeof(TileSet), tileset_count); if (!tile_set_manager.tile_set_list) { return; } tile_set_manager.tileset_count = tileset_count; } TileSet* tile_set_new() { int i; for (i = 0; i < tile_set_manager.tileset_count; i++) { if (!tile_set_manager.tile_set_list[i]._refcount) { tile_set_manager.tile_set_list[i]._refcount = 1; return &tile_set_manager.tile_set_list[i]; } } slog("we are out of memory for tile sets"); return NULL; } TileSet* tile_get_by_filename(char* filename) { int i; if (!filename)return NULL; for (i = 0; i < tile_set_manager.tileset_count; i++) { if (!tile_set_manager.tile_set_list[i]._refcount)continue; if (gfc_line_cmp(filename, tile_set_manager.tile_set_list[i].filename) == 0) { return &tile_set_manager.tile_set_list[i]; } } return NULL; } TileSet* tile_set_load( char* filename, Uint32 tile_width, Uint32 tile_height, Uint32 tile_count) { TileSet* tileset; if (!filename)return NULL; tileset = tile_get_by_filename(filename); if (tileset != NULL) { tileset->_refcount++; return tileset; } tileset = tile_set_new(); if (!tileset)return NULL; tileset->tile_image = gf2d_sprite_load_all( filename, tile_width, tile_height, tile_count); gfc_line_cpy(tileset->filename, filename); tileset->tile_width = tile_width; tileset->tile_height = tile_height; tileset->tile_count = tile_count; return tileset; } void tile_set_delete(TileSet* tileset) { if (!tileset)return; if (tileset->_refcount > 0) { slog("deleting tileset %s. However refcount is greater than 0", tileset->filename); } gf2d_sprite_free(tileset->tile_image); memset(tileset, 0, sizeof(TileSet)); } void tile_set_free(TileSet* tileset) { if (!tileset)return; if (tileset->_refcount == 0) { slog("trying to free %s tileset more times than loaded", tileset->filename); } tileset->_refcount--; if (tileset->_refcount == 0) { tile_set_delete(tileset); } } void tile_set_draw(TileSet* tileset, Uint32 tile, Vector2D position) { SDL_Rect hitbox; if (!tileset)return; if (!tileset->tile_image)return;// nothing to draw gf2d_sprite_draw( tileset->tile_image, position, NULL, NULL, NULL, NULL, NULL, tile); if (tile == 0) { hitbox = collision_box(position.x, position.y, tileset->tile_width, tileset->tile_height); //gf2d_draw_rect(hitbox, vector4d(255, 255, 255, 255)); } } //eol
1.46875
1