campy.private.backends.backend_base module

Common abstract base classes for various backends.

There are three different types of backends.

  • GraphicsBackendBase: Everything graphical - windows, canvas objects, labels, interactors.
  • AudioBackendBase: Everything auditory - creating and playing sounds.
  • ConsoleBackendBase: Everything textual - fonts and lines.

The Tk backend is a graphical backend only. The Java backend is all three.

Other implementations of ConsoleBackendBase have been spun out into their own library popup-console.

These abstract base classes are provided for backend developers to see which methods their backend will need to support. It is considered under development and can change at any time.

class campy.private.backends.backend_base.AudioBackendBase[source]

Bases: abc.ABC

Interface for audio backends.

create_sound(sound, *args)[source]
delete_sound(sound, *args)[source]
play_note(note, repeat)[source]
play_sound(sound, *args)[source]
class campy.private.backends.backend_base.ConsoleBackendBase[source]

Bases: abc.ABC

Interface for console backends.

clear_console()[source]
echo_console()[source]
end_line_console()[source]
get_console_line()[source]
put_console(line, stderr=False)[source]
set_console_font(font)[source]
set_console_size(console_size)[source]
class campy.private.backends.backend_base.GraphicsBackendBase[source]

Bases: abc.ABC

Interface for graphical backends.

event_add_keypress_handler(event, handler)[source]
event_add_mouse_handler(event, handler)[source]
event_add_window_changed_handler(handler)[source]
event_generate_keypress(event)[source]
event_generate_mouse(event)[source]
event_pump_one()[source]
event_set_window_closed_handler(handler)[source]
g3drect_constructor(gobject, width, height, raised)[source]
g3drect_set_raised(gobject, raised)[source]
garc_constructor(garc)[source]
garc_set_frame_rectangle(garc, x, y, width, height)[source]
garc_set_start_angle(garc, angle)[source]
garc_set_sweep_angle(garc, angle)[source]
gbufferedimage_constructor(gobject, x, y, width, height)[source]
gbufferedimage_fill(gobject, rgb)[source]
gbufferedimage_fill_region(gobject, x, y, width, height, rgb)[source]
gbufferedimage_load(gobject, filename)[source]
gbufferedimage_resize(gobject, width, height, retain)[source]
gbufferedimage_save(gobject, filename)[source]
gbufferedimage_set_rgb(gobject, x, y, rgb)[source]
gbufferedimage_update_all_pixels(gobject, base64)[source]
gbutton_constructor(gbutton)[source]
gbutton_set_disabled(gbutton)[source]
gbutton_set_label(gbutton)[source]
gcheckbox_constructor(gcheckbox)[source]
gcheckbox_is_selected(gcheckbox)[source]
gcheckbox_set_selected(gcheckbox, state)[source]
gchooser_add_item(gchooser, item)[source]
gchooser_constructor(gchooser)[source]
gchooser_get_selected_item(gchooser)[source]
gchooser_set_selected_item(gchooser, item)[source]
gcompound_add(compound, gobject)[source]
gcompound_constructor(gobject)[source]
get_next_event(mask)[source]
gfilechooser_show_open_dialog(current_dir, file_filter)[source]
gfilechooser_show_save_dialog(current_dir, file_filter)[source]
gfont_attributes_from_system_name(font_name)[source]
gfont_default_attributes()[source]
gfont_get_font_metrics(gfont)[source]
gfont_measure_text_width(gfont, text)[source]
gimage_blank(gimage, width, height)[source]
gimage_constructor(gimage, filename)[source]
gimage_get_pixel(gimage, row, col)[source]
gimage_preview(gimage)[source]
gimage_set_pixel(gimage, row, col, rgb)[source]
glabel_constructor(glabel)[source]
glabel_set_font(glabel, gfont)[source]
glabel_set_label(glabel, text)[source]
gline_constructor(gline)[source]
gline_set_end_point(gline, x, y)[source]
gline_set_start_point(gline, x, y)[source]
gobject_contains(gobject, x, y)[source]
gobject_get_bounds(gobject)[source]
gobject_get_size(gobject)[source]
gobject_remove(gobject)[source]
gobject_rotate(gobject, theta)[source]
gobject_scale(gobject, sx, sy)[source]
gobject_send_backward(gobject)[source]
gobject_send_forward(gobject)[source]
gobject_send_to_back(gobject)[source]
gobject_send_to_front(gobject)[source]
gobject_set_color(gobject, color)[source]
gobject_set_fill_color(gobject, color)[source]
gobject_set_filled(gobject, flag)[source]
gobject_set_line_width(gobject, line_width)[source]
gobject_set_location(gobject, x, y)[source]
gobject_set_size(gobject, width, height)[source]
gobject_set_visible(gobject, flag)[source]
goptionpane_show_confirm_dialog(message, title, confirm_type)[source]
goptionpane_show_input_dialog(message, title)[source]
goptionpane_show_message_dialog(message, title, message_type)[source]
goptionpane_show_option_dialog(message, title, options, initially_selected)[source]
goptionpane_show_text_file_dialog(message, title, rows, cols)[source]
goval_constructor(goval)[source]
gpolygon_add_vertex(gpolygon, x, y)[source]
gpolygon_constructor(gpolygon)[source]
grect_constructor(grect)[source]
groundrect_constructor(gobject, width, height, corner)[source]
gslider_constructor(gslider, min, max, value)[source]
gslider_get_value(gslider)[source]
gslider_set_value(gslider, value)[source]
gtextfield_constructor(gtextfield, num_chars)[source]
gtextfield_get_text(gtextfield)[source]
gtextfield_set_text(gtextfield, text)[source]
gtimer_constructor(timer)[source]
gtimer_delete(timer)[source]
gtimer_pause(timer, millis)[source]
gtimer_start(timer)[source]
gtimer_stop(timer)[source]
gwindow_add_to_region(gwindow, gobject, region)[source]
gwindow_clear(gwindow)[source]
gwindow_clear_canvas(gwindow)[source]
gwindow_close(gwindow)[source]
gwindow_constructor(gwindow, width, height, top_compound, visible=True)[source]
gwindow_delete(gwindow)[source]
gwindow_draw(gwindow, gobject)[source]
gwindow_exit_graphics()[source]
gwindow_get_height()[source]
gwindow_get_width()[source]
gwindow_remove_from_region(gwindow, gobject, region)[source]
gwindow_repaint(gwindow)[source]
gwindow_request_focus(gwindow)[source]
gwindow_set_exit_on_close(gwindow, exit_on_close)[source]
gwindow_set_region_alignment(gwindow, region, align)[source]
gwindow_set_visible(gwindow, flag)[source]
gwindow_set_window_title(gwindow, title)[source]
image_find(filename)[source]
image_load(filename)[source]
set_action_command(gobject, cmd)[source]
timer_pause(event)[source]
timer_schedule(function, delay_ms)[source]
wait_for_event(mask)[source]