示例#1
0
void get_text_size(int *width, int *height, enum client_font font, const char *text) {
    PyObject* ret = PY_CALL("sis", "get_text_size", font, text);
    int m_width, m_height;
    if(PyArg_ParseTuple(ret, "ii", &m_width, &m_height) == 0) errlog("Type error\n");
    if(width) *width = m_width;
    if(height) *height = m_height;
}
void
PyIMEngine::lookup_table_page_up ()
{
	PyObject *pValue = NULL;
	pValue = PY_CALL ("lookup_table_page_up");
	PY_CHECK_RET (pValue);
	Py_XDECREF (pValue);
}
void
PyIMEngine::focus_out ()
{
	PyObject *pValue = NULL;

	pValue = PY_CALL ("focus_out");
	PY_CHECK_RET (pValue);

	Py_XDECREF (pValue);
}
void
PyIMEngine::reset ()
{
	PyObject *pValue = NULL;

	pValue = PY_CALL ("reset");
	PY_CHECK_RET (pValue);

	Py_XDECREF (pValue);
}
示例#5
0
void ui_main(int argc, char *argv[]) {
    PY_CALL("s", "ui_main");
}
示例#6
0
bool city_dialog_is_open(struct city *pcity) {
    PyObject* ret = PY_CALL("sO", "city_dialog_is_open", py_mapper_city(pcity));
    int retval;
    if(PyArg_ParseTuple(ret, "i", &retval) == 0) errlog("Type error\n");
    return (bool)retval;
}
示例#7
0
void get_sprite_dimensions(struct sprite *sprite, int *width, int *height) {
    PyObject* ret = PY_CALL("sO", "get_sprite_dimensions", py_get_pyobject(sprite));
    if(PyArg_ParseTuple(ret, "ii", width, height) == 0) errlog("Type error\n");
}
示例#8
0
void get_overview_area_dimensions(int *width, int *height) {
    PyObject* ret = PY_CALL("s", "get_overview_area_dimensions");
    if(PyArg_ParseTuple(ret, "ii", width, height) == 0) errlog("Type error\n");
}
示例#9
0
void py_setup_callglue() {
void* ptr;
	ptr = python_call_idle_callbacks;
	PY_CALL("ssi", "add_function", "call_idle_callbacks", (int)ptr);
	ptr = python_client_start_server;
	PY_CALL("ssi", "add_function", "client_start_server", (int)ptr);
	ptr = python_connect_to_server;
	PY_CALL("ssi", "add_function", "connect_to_server", (int)ptr);
	ptr = python_real_timer_callback;
	PY_CALL("ssi", "add_function", "real_timer_callback", (int)ptr);
	ptr = python_input_from_server;
	PY_CALL("ssi", "add_function", "input_from_server", (int)ptr);
	ptr = python_py_dsend_packet_player_ready;
	PY_CALL("ssi", "add_function", "py_dsend_packet_player_ready", (int)ptr);
	ptr = python_send_chat;
	PY_CALL("ssi", "add_function", "send_chat", (int)ptr);
	ptr = python_control_mouse_cursor_pos;
	PY_CALL("ssi", "add_function", "control_mouse_cursor_pos", (int)ptr);
	ptr = python_recenter_button_pressed;
	PY_CALL("ssi", "add_function", "recenter_button_pressed", (int)ptr);
	ptr = python_recenter_at_tile_int;
	PY_CALL("ssi", "add_function", "recenter_at_tile_int", (int)ptr);
	ptr = python_init_mapcanvas_and_overview;
	PY_CALL("ssi", "add_function", "init_mapcanvas_and_overview", (int)ptr);
	ptr = python_map_canvas_resized;
	PY_CALL("ssi", "add_function", "map_canvas_resized", (int)ptr);
	ptr = python_init_things;
	PY_CALL("ssi", "add_function", "init_things", (int)ptr);
	ptr = python_update_map_canvas_visible;
	PY_CALL("ssi", "add_function", "update_map_canvas_visible", (int)ptr);
	ptr = python_update_map_canvas;
	PY_CALL("ssi", "add_function", "update_map_canvas", (int)ptr);
	ptr = python_get_mapview_store;
	PY_CALL("ssi", "add_function", "get_mapview_store", (int)ptr);
	ptr = python_key_unit_move_direction;
	PY_CALL("ssi", "add_function", "key_unit_move_direction", (int)ptr);
	ptr = python_key_unit_goto;
	PY_CALL("ssi", "add_function", "key_unit_goto", (int)ptr);
	ptr = python_update_line;
	PY_CALL("ssi", "add_function", "update_line", (int)ptr);
	ptr = python_key_cancel_action;
	PY_CALL("ssi", "add_function", "key_cancel_action", (int)ptr);
	ptr = python_key_unit_road;
	PY_CALL("ssi", "add_function", "key_unit_road", (int)ptr);
	ptr = python_key_unit_build_city;
	PY_CALL("ssi", "add_function", "key_unit_build_city", (int)ptr);
	ptr = python_key_unit_trade_route;
	PY_CALL("ssi", "add_function", "key_unit_trade_route", (int)ptr);
	ptr = python_key_unit_irrigate;
	PY_CALL("ssi", "add_function", "key_unit_irrigate", (int)ptr);
	ptr = python_key_unit_mine;
	PY_CALL("ssi", "add_function", "key_unit_mine", (int)ptr);
	ptr = python_key_unit_transform;
	PY_CALL("ssi", "add_function", "key_unit_transform", (int)ptr);
	ptr = python_key_unit_fortress;
	PY_CALL("ssi", "add_function", "key_unit_fortress", (int)ptr);
	ptr = python_key_unit_fortify;
	PY_CALL("ssi", "add_function", "key_unit_fortify", (int)ptr);
	ptr = python_key_unit_airbase;
	PY_CALL("ssi", "add_function", "key_unit_airbase", (int)ptr);
	ptr = python_key_unit_pollution;
	PY_CALL("ssi", "add_function", "key_unit_pollution", (int)ptr);
	ptr = python_key_unit_paradrop;
	PY_CALL("ssi", "add_function", "key_unit_paradrop", (int)ptr);
	ptr = python_key_unit_fallout;
	PY_CALL("ssi", "add_function", "key_unit_fallout", (int)ptr);
	ptr = python_key_unit_sentry;
	PY_CALL("ssi", "add_function", "key_unit_sentry", (int)ptr);
	ptr = python_key_unit_pillage;
	PY_CALL("ssi", "add_function", "key_unit_pillage", (int)ptr);
	ptr = python_key_unit_homecity;
	PY_CALL("ssi", "add_function", "key_unit_homecity", (int)ptr);
	ptr = python_key_unit_unload_all;
	PY_CALL("ssi", "add_function", "key_unit_unload_all", (int)ptr);
	ptr = python_key_unit_wait;
	PY_CALL("ssi", "add_function", "key_unit_wait", (int)ptr);
	ptr = python_key_unit_done;
	PY_CALL("ssi", "add_function", "key_unit_done", (int)ptr);
	ptr = python_key_unit_disband;
	PY_CALL("ssi", "add_function", "key_unit_disband", (int)ptr);
	ptr = python_action_button_pressed;
	PY_CALL("ssi", "add_function", "action_button_pressed", (int)ptr);
	ptr = python_free_ref;
	PY_CALL("ssi", "add_function", "free_ref", (int)ptr);
	ptr = python_key_end_turn;
	PY_CALL("ssi", "add_function", "key_end_turn", (int)ptr);
	ptr = python_get_num_messages;
	PY_CALL("ssi", "add_function", "get_num_messages", (int)ptr);
	ptr = python_get_message;
	PY_CALL("ssi", "add_function", "get_message", (int)ptr);
	ptr = python_finish_city_at_unit;
	PY_CALL("ssi", "add_function", "finish_city_at_unit", (int)ptr);
	ptr = python_canvas_pos_to_nearest_tile_id;
	PY_CALL("ssi", "add_function", "canvas_pos_to_nearest_tile_id", (int)ptr);
	ptr = python_set_mapview_origin;
	PY_CALL("ssi", "add_function", "set_mapview_origin", (int)ptr);
	ptr = python_get_map_view_origin;
	PY_CALL("ssi", "add_function", "get_map_view_origin", (int)ptr);
	ptr = python_get_units_in_focus;
	PY_CALL("ssi", "add_function", "get_units_in_focus", (int)ptr);
	ptr = python_get_units_at_tile;
	PY_CALL("ssi", "add_function", "get_units_at_tile", (int)ptr);
	ptr = python_can_unit_do_activity;
	PY_CALL("ssi", "add_function", "can_unit_do_activity", (int)ptr);
	ptr = python_tile_activity_time;
	PY_CALL("ssi", "add_function", "tile_activity_time", (int)ptr);
	ptr = python_can_unit_add_or_build_city;
	PY_CALL("ssi", "add_function", "can_unit_add_or_build_city", (int)ptr);
	ptr = python_unit_can_help_build_wonder_here;
	PY_CALL("ssi", "add_function", "unit_can_help_build_wonder_here", (int)ptr);
	ptr = python_can_unit_paradrop;
	PY_CALL("ssi", "add_function", "can_unit_paradrop", (int)ptr);
	ptr = python_can_unit_change_homecity;
	PY_CALL("ssi", "add_function", "can_unit_change_homecity", (int)ptr);
	ptr = python_get_unit_properties;
	PY_CALL("ssi", "add_function", "get_unit_properties", (int)ptr);
	ptr = python_get_unit_name;
	PY_CALL("ssi", "add_function", "get_unit_name", (int)ptr);
	ptr = python_request_new_unit_activity;
	PY_CALL("ssi", "add_function", "request_new_unit_activity", (int)ptr);
	ptr = python_set_unit_focus;
	PY_CALL("ssi", "add_function", "set_unit_focus", (int)ptr);
	ptr = python_city_dialog_redraw_map;
	PY_CALL("ssi", "add_function", "city_dialog_redraw_map", (int)ptr);
	ptr = python_get_citydlg_canvas_width;
	PY_CALL("ssi", "add_function", "get_citydlg_canvas_width", (int)ptr);
	ptr = python_get_citydlg_canvas_height;
	PY_CALL("ssi", "add_function", "get_citydlg_canvas_height", (int)ptr);
	ptr = python_city_unhappy;
	PY_CALL("ssi", "add_function", "city_unhappy", (int)ptr);
	ptr = python_city_happy;
	PY_CALL("ssi", "add_function", "city_happy", (int)ptr);
	ptr = python_city_celebrating;
	PY_CALL("ssi", "add_function", "city_celebrating", (int)ptr);
	ptr = python_city_get_prod;
	PY_CALL("ssi", "add_function", "city_get_prod", (int)ptr);
	ptr = python_city_get_size;
	PY_CALL("ssi", "add_function", "city_get_size", (int)ptr);
	ptr = python_city_turns_to_grow;
	PY_CALL("ssi", "add_function", "city_turns_to_grow", (int)ptr);
	ptr = python_city_granary_size;
	PY_CALL("ssi", "add_function", "city_granary_size", (int)ptr);
	ptr = python_city_production_turns_to_build;
	PY_CALL("ssi", "add_function", "city_production_turns_to_build", (int)ptr);
	ptr = python_city_get_shield_stock;
	PY_CALL("ssi", "add_function", "city_get_shield_stock", (int)ptr);
	ptr = python_city_name;
	PY_CALL("ssi", "add_function", "city_name", (int)ptr);
	ptr = python_city_get_production_image;
	PY_CALL("ssi", "add_function", "city_get_production_image", (int)ptr);
	ptr = python_city_get_production_cost;
	PY_CALL("ssi", "add_function", "city_get_production_cost", (int)ptr);
	ptr = python_city_get_production_name;
	PY_CALL("ssi", "add_function", "city_get_production_name", (int)ptr);
	ptr = python_city_get_citizen_count;
	PY_CALL("ssi", "add_function", "city_get_citizen_count", (int)ptr);
	ptr = python_city_rotate_specialist;
	PY_CALL("ssi", "add_function", "city_rotate_specialist", (int)ptr);
	ptr = python_city_map_click;
	PY_CALL("ssi", "add_function", "city_map_click", (int)ptr);
	ptr = python_city_change_production_type;
	PY_CALL("ssi", "add_function", "city_change_production_type", (int)ptr);
	ptr = python_get_units_present_in_city;
	PY_CALL("ssi", "add_function", "get_units_present_in_city", (int)ptr);
	ptr = python_get_playable_nation_count;
	PY_CALL("ssi", "add_function", "get_playable_nation_count", (int)ptr);
	ptr = python_city_style_of_nation_id;
	PY_CALL("ssi", "add_function", "city_style_of_nation_id", (int)ptr);
	ptr = python_get_name_of_nation_id;
	PY_CALL("ssi", "add_function", "get_name_of_nation_id", (int)ptr);
	ptr = python_set_nation_settings;
	PY_CALL("ssi", "add_function", "set_nation_settings", (int)ptr);
	ptr = python_disconnect_from_server;
	PY_CALL("ssi", "add_function", "disconnect_from_server", (int)ptr);
	ptr = python_get_buildable_improvements_in_city;
	PY_CALL("ssi", "add_function", "get_buildable_improvements_in_city", (int)ptr);
	ptr = python_get_buildable_units_in_city;
	PY_CALL("ssi", "add_function", "get_buildable_units_in_city", (int)ptr);
	ptr = python_set_tax_values;
	PY_CALL("ssi", "add_function", "set_tax_values", (int)ptr);
	ptr = python_get_tax_value;
	PY_CALL("ssi", "add_function", "get_tax_value", (int)ptr);
	ptr = python_get_gold_amount;
	PY_CALL("ssi", "add_function", "get_gold_amount", (int)ptr);
	ptr = python_get_gold_income;
	PY_CALL("ssi", "add_function", "get_gold_income", (int)ptr);
	ptr = python_get_techs;
	PY_CALL("ssi", "add_function", "get_techs", (int)ptr);
	ptr = python_set_tech_goal;
	PY_CALL("ssi", "add_function", "set_tech_goal", (int)ptr);
	ptr = python_get_current_tech;
	PY_CALL("ssi", "add_function", "get_current_tech", (int)ptr);
	ptr = python_get_current_year_name;
	PY_CALL("ssi", "add_function", "get_current_year_name", (int)ptr);
	ptr = python_get_governments;
	PY_CALL("ssi", "add_function", "get_governments", (int)ptr);
	ptr = python_change_government;
	PY_CALL("ssi", "add_function", "change_government", (int)ptr);
	ptr = python_py_accept_treaty;
	PY_CALL("ssi", "add_function", "py_accept_treaty", (int)ptr);
	ptr = python_py_cancel_treaty;
	PY_CALL("ssi", "add_function", "py_cancel_treaty", (int)ptr);
	ptr = python_call_callback;
	PY_CALL("ssi", "add_function", "call_callback", (int)ptr);
	ptr = python_city_production_buy_gold_cost;
	PY_CALL("ssi", "add_function", "city_production_buy_gold_cost", (int)ptr);
	ptr = python_city_can_buy;
	PY_CALL("ssi", "add_function", "city_can_buy", (int)ptr);
	ptr = python_city_buy_production;
	PY_CALL("ssi", "add_function", "city_buy_production", (int)ptr);
	ptr = python_get_turn_done_button_state;
	PY_CALL("ssi", "add_function", "get_turn_done_button_state", (int)ptr);
}