Version 21 (modified by 14 years ago) (diff) | ,
---|
Python-Clutter development notes
ModRana? will in the future use Clutter as an alternative to the current non-accelerated GTK GUI. Unfortunately, the documentation to the Python bindings for Clutter is in a sad state. This page serves as a compilation of various Clutter & Python related development notes, with the hope to piece together some sort of documentation for the most needed elements :)
NOTE: all of this information concerns Python bindings for Clutter 1.0
Gathered resources
documentation from various sources
official incomplete documentation, taken from Debian PyClutter package:
http://www.modrana.org/pyclutter for the package.
official documentation improved by Paolo Marti, from his GitHub page:
http://www.modrana.org/pyclutter_marti
PyClutter tutorial, also by Paolo Marti:
http://www.modrana.org/pyclutter_tutorial
complete examples for the above mentioned tutorial:
http://www.modrana.org/pyclutter_tutorial/examples
a short PyClutter tutorial by TuxRadar:
http://www.tuxradar.com/content/code-project-monitor-proc-python-and-clutter
a small PyClutter recipe:
http://otherwiseingle.blogspot.com/2010/02/pyclutter-recipes.html
issues
actors not getting motion notify events
Call set_reactive(True) on the actor and it will start receiving motion notify events. Clutter does this probably as an optimization, eq. it has to handle the motion notify event only for actors that request it.
compiling more recent clutter version
Raw notes
# compile dependencies libjson-glib-dev gobject-introspection PKG_CONFIG_PATH=/opt/lib/pkgconfig/ ./configure --enable-gtk-doc --enable-docs=yes --enable-introspection=yes checking for XEXT extension... configure: error: Not found ????
available methods
clutter GTK viewport methods
__class__ __cmp__ __copy__ __deepcopy__ __delattr__ __dict__ __doc__ __format__ __gdoc__ __getattribute__ __gobject_init__ __grefcount__ __gtype__ __hash__ __init__ __iter__ __module__ __new__ __reduce__ __reduce_ex__ __repr__ __setattr__ __sizeof__ __str__ __subclasshook__ add allocate allocate_available_size allocate_preferred_size animate animate_with_alpha animate_with_timeline apply_relative_transform_to_point apply_transform_to_point chain child_get child_get_property child_set child_set_property connect connect_after connect_object connect_object_after create_pango_context create_pango_layout destroy disconnect disconnect_by_func do_add do_allocate do_apply_transform do_create_child_meta do_destroy do_destroy_child_meta do_foreach do_foreach_with_internals do_get_adjustment do_get_adjustments do_get_child_meta do_get_id do_get_preferred_height do_get_preferred_width do_hide_all do_lower_child do_map do_paint do_parent_set do_parse_custom_node do_pick do_queue_redraw do_raise_child do_realize do_remove do_set_adjustment do_set_adjustments do_set_custom_property do_set_id do_show do_show_all do_sort_depth_order do_unmap do_unrealize emit emit_stop_by_name event find_child_by_name foreach foreach_with_internals freeze_notify get_adjustment get_adjustments get_allocation_box get_allocation_geometry get_anchor_point get_anchor_point_gravity get_animation get_child_meta get_children get_clip get_data get_depth get_fixed_position_set get_flags get_geometry get_gid get_height get_id get_name get_opacity get_origin get_paint_opacity get_paint_visibility get_pango_context get_parent get_position get_preferred_height get_preferred_size get_preferred_width get_properties get_property get_reactive get_rotation get_scale get_scale_center get_scale_gravity get_shader get_size get_stage get_transformation_matrix get_transformed_position get_transformed_size get_width get_x get_y get_z_rotation_gravity grab_key_focus handler_block handler_block_by_func handler_disconnect handler_is_connected handler_unblock handler_unblock_by_func has_clip hide hide_all install_child_meta is_in_clone_paint is_rotated is_scaled lower_actor lower_bottom lower_child map move_anchor_point move_anchor_point_from_gravity move_by notify paint parse_custom_node props queue_redraw queue_relayout raise_actor raise_child raise_top realize remove remove_clip reparent set_adjustment set_adjustments set_anchor_point set_anchor_point_from_gravity set_clip set_custom_property set_data set_depth set_fixed_position_set set_flags set_geometry set_height set_id set_name set_opacity set_parent set_position set_properties set_property set_reactive set_rotation set_scale set_scale_full set_scale_with_gravity set_shader set_shader_param_float set_shader_param_int set_size set_width set_x set_y set_z_rotation_from_gravity should_pick_paint show show_all sort_depth_order stop_emission thaw_notify transform_stage_point unmap unparent unrealize unset_flags weak_ref
ClutterGtk? Embed
__class__ __cmp__ __copy__ __deepcopy__ __delattr__ __dict__ __doc__ __format__ __gdoc__ __getattribute__ __gobject_init__ __grefcount__ __gtype__ __hash__ __init__ __iter__ __len__ __module__ __new__ __nonzero__ __reduce__ __reduce_ex__ __repr__ __setattr__ __sizeof__ __str__ __subclasshook__ activate add add_accelerator add_child add_events add_mnemonic_label add_with_properties allocation border_width can_activate_accel chain check_resize child_focus child_get child_get_property child_notify child_set child_set_property child_type children class_path connect connect_after connect_object connect_object_after construct_child create_pango_context create_pango_layout destroy disconnect disconnect_by_func do_add do_add_child do_button_press_event do_button_release_event do_can_activate_accel do_check_resize do_child_type do_client_event do_composite_name do_composited_changed do_configure_event do_construct_child do_delete_event do_destroy do_destroy_event do_direction_changed do_drag_begin do_drag_data_delete do_drag_data_get do_drag_data_received do_drag_drop do_drag_end do_drag_leave do_drag_motion do_enter_notify_event do_event do_expose_event do_focus do_focus_in_event do_focus_out_event do_forall do_get_accessible do_get_child_property do_get_internal_child do_grab_broken_event do_grab_focus do_grab_notify do_hide do_hide_all do_hierarchy_changed do_key_press_event do_key_release_event do_leave_notify_event do_map do_map_event do_mnemonic_activate do_motion_notify_event do_no_expose_event do_parent_set do_parser_finished do_popup_menu do_property_notify_event do_proximity_in_event do_proximity_out_event do_realize do_remove do_screen_changed do_scroll_event do_selection_clear_event do_selection_get do_selection_notify_event do_selection_received do_selection_request_event do_set_child_property do_set_focus_child do_set_name do_show do_show_all do_show_help do_size_allocate do_size_request do_state_changed do_style_set do_unmap do_unmap_event do_unrealize do_visibility_notify_event do_window_state_event drag_begin drag_check_threshold drag_dest_add_image_targets drag_dest_add_text_targets drag_dest_add_uri_targets drag_dest_find_target drag_dest_get_target_list drag_dest_get_track_motion drag_dest_set drag_dest_set_proxy drag_dest_set_target_list drag_dest_set_track_motion drag_dest_unset drag_get_data drag_highlight drag_source_add_image_targets drag_source_add_text_targets drag_source_add_uri_targets drag_source_get_target_list drag_source_set drag_source_set_icon drag_source_set_icon_name drag_source_set_icon_pixbuf drag_source_set_icon_stock drag_source_set_target_list drag_source_unset drag_unhighlight draw emit emit_stop_by_name ensure_style error_bell event flags focus_child forall foreach freeze_child_notify freeze_notify get_accessible get_action get_activate_signal get_allocation get_ancestor get_app_paintable get_border_width get_can_default get_can_focus get_child_requisition get_child_visible get_children get_clipboard get_colormap get_composite_name get_data get_direction get_display get_double_buffered get_events get_extension_events get_focus_chain get_focus_child get_focus_hadjustment get_focus_vadjustment get_has_tooltip get_has_window get_internal_child get_mapped get_modifier_style get_name get_no_show_all get_pango_context get_parent get_parent_window get_pointer get_properties get_property get_realized get_receives_default get_requisition get_resize_mode get_root_window get_screen get_sensitive get_settings get_size_request get_snapshot get_stage get_state get_style get_tooltip_markup get_tooltip_text get_tooltip_window get_toplevel get_visible get_visual get_window grab_add grab_default grab_focus grab_remove handler_block handler_block_by_func handler_disconnect handler_is_connected handler_unblock handler_unblock_by_func has_default has_focus has_focus_chain has_grab has_rc_style has_screen hide hide_all hide_on_delete input_shape_combine_mask install_child_property intersect is_ancestor is_composited is_drawable is_focus is_sensitive is_toplevel keynav_failed list_accel_closures list_child_properties list_mnemonic_labels map menu_get_for_attach_widget mnemonic_activate modify_base modify_bg modify_cursor modify_fg modify_font modify_style modify_text name need_resize notify parent parser_finished path propagate_expose props queue_clear queue_clear_area queue_draw queue_draw_area queue_resize queue_resize_no_redraw rc_get_style realize reallocate_redraws ref_accessible region_intersect remove remove_accelerator remove_data remove_mnemonic_label remove_no_notify render_icon reparent requisition reset_rc_styles reset_shapes resize_children resize_mode saved_state selection_add_target selection_add_targets selection_clear_targets selection_convert selection_owner_set selection_remove_all send_expose send_focus_change set_accel_path set_activate_signal set_allocation set_app_paintable set_border_width set_can_default set_can_focus set_child_visible set_colormap set_composite_name set_data set_direction set_double_buffered set_events set_extension_events set_flags set_focus_chain set_focus_child set_focus_hadjustment set_focus_vadjustment set_has_tooltip set_has_window set_mapped set_name set_no_show_all set_parent set_parent_window set_properties set_property set_realized set_reallocate_redraws set_receives_default set_redraw_on_allocate set_resize_mode set_scroll_adjustments set_sensitive set_set_scroll_adjustments_signal set_size_request set_state set_style set_tooltip_markup set_tooltip_text set_tooltip_window set_uposition set_usize set_visible set_window shape_combine_mask show show_all show_now size_allocate size_request state stop_emission style style_attach style_get_property thaw_child_notify thaw_notify translate_coordinates trigger_tooltip_query unmap unparent unrealize unset_flags unset_focus_chain weak_ref window
clutter.Texture
__class__ __cmp__ __copy__ __deepcopy__ __delattr__ __dict__ __doc__ __format__ __gdoc__ __getattribute__ __gobject_init__ __grefcount__ __gtype__ __hash__ __init__ __module__ __new__ __reduce__ __reduce_ex__ __repr__ __setattr__ __sizeof__ __str__ __subclasshook__ allocate allocate_available_size allocate_preferred_size animate animate_with_alpha animate_with_timeline apply_relative_transform_to_point apply_transform_to_point chain connect connect_after connect_object connect_object_after create_pango_context create_pango_layout destroy disconnect disconnect_by_func do_allocate do_apply_transform do_destroy do_get_id do_get_preferred_height do_get_preferred_width do_hide_all do_map do_paint do_parent_set do_parse_custom_node do_pick do_queue_redraw do_realize do_set_custom_property do_set_id do_show do_show_all do_unmap do_unrealize emit emit_stop_by_name event freeze_notify get_allocation_box get_allocation_geometry get_anchor_point get_anchor_point_gravity get_animation get_base_size get_clip get_cogl_material get_cogl_texture get_data get_depth get_filter_quality get_fixed_position_set get_flags get_geometry get_gid get_height get_id get_keep_aspect_ratio get_load_async get_load_data_async get_max_tile_waste get_name get_opacity get_paint_opacity get_paint_visibility get_pango_context get_parent get_pixel_format get_position get_preferred_height get_preferred_size get_preferred_width get_properties get_property get_reactive get_repeat get_rotation get_scale get_scale_center get_scale_gravity get_shader get_size get_stage get_sync_size get_transformation_matrix get_transformed_position get_transformed_size get_width get_x get_y get_z_rotation_gravity grab_key_focus handler_block handler_block_by_func handler_disconnect handler_is_connected handler_unblock handler_unblock_by_func has_clip hide hide_all is_in_clone_paint is_rotated is_scaled lower_actor lower_bottom map move_anchor_point move_anchor_point_from_gravity move_by notify paint parse_custom_node props queue_redraw queue_relayout raise_actor raise_top realize remove_clip reparent set_anchor_point set_anchor_point_from_gravity set_area_from_rgb_data set_clip set_cogl_material set_cogl_texture set_custom_property set_data set_depth set_filter_quality set_fixed_position_set set_flags set_from_file set_from_rgb_data set_from_yuv_data set_geometry set_height set_id set_keep_aspect_ratio set_load_async set_load_data_async set_name set_opacity set_parent set_position set_properties set_property set_reactive set_repeat set_rotation set_scale set_scale_full set_scale_with_gravity set_shader set_shader_param_float set_shader_param_int set_size set_sync_size set_width set_x set_y set_z_rotation_from_gravity should_pick_paint show show_all stop_emission thaw_notify transform_stage_point unmap unparent unrealize unset_flags weak_ref
clutter.Stage
__class__ __cmp__ __copy__ __deepcopy__ __delattr__ __dict__ __doc__ __format__ __gdoc__ __getattribute__ __gobject_init__ __grefcount__ __gtype__ __hash__ __init__ __iter__ __module__ __new__ __reduce__ __reduce_ex__ __repr__ __setattr__ __sizeof__ __str__ __subclasshook__ add allocate allocate_available_size allocate_preferred_size animate animate_with_alpha animate_with_timeline apply_relative_transform_to_point apply_transform_to_point chain child_get child_get_property child_set child_set_property connect connect_after connect_object connect_object_after create_pango_context create_pango_layout destroy disconnect disconnect_by_func do_add do_allocate do_apply_transform do_create_child_meta do_destroy do_destroy_child_meta do_foreach do_foreach_with_internals do_get_child_meta do_get_id do_get_preferred_height do_get_preferred_width do_hide_all do_lower_child do_map do_paint do_parent_set do_parse_custom_node do_pick do_queue_redraw do_raise_child do_realize do_remove do_set_custom_property do_set_id do_show do_show_all do_sort_depth_order do_unmap do_unrealize emit emit_stop_by_name ensure_current ensure_redraw ensure_viewport event find_child_by_name foreach foreach_with_internals freeze_notify get_actor_at_pos get_allocation_box get_allocation_geometry get_anchor_point get_anchor_point_gravity get_animation get_child_meta get_children get_clip get_color get_data get_depth get_fixed_position_set get_flags get_fog get_fullscreen get_geometry get_gid get_height get_id get_key_focus get_n_children get_name get_nth_child get_opacity get_paint_opacity get_paint_visibility get_pango_context get_parent get_perspective get_position get_preferred_height get_preferred_size get_preferred_width get_properties get_property get_reactive get_rotation get_scale get_scale_center get_scale_gravity get_shader get_size get_stage get_throttle_motion_events get_title get_transformation_matrix get_transformed_position get_transformed_size get_use_fog get_user_resizable get_width get_x get_y get_z_rotation_gravity grab_key_focus handler_block handler_block_by_func handler_disconnect handler_is_connected handler_unblock handler_unblock_by_func has_clip hide hide_all hide_cursor install_child_meta is_default is_in_clone_paint is_rotated is_scaled lower_actor lower_bottom lower_child map move_anchor_point move_anchor_point_from_gravity move_by notify paint parse_custom_node props queue_redraw queue_relayout raise_actor raise_child raise_top read_pixels realize remove remove_all remove_clip reparent set_anchor_point set_anchor_point_from_gravity set_clip set_color set_custom_property set_data set_depth set_fixed_position_set set_flags set_fog set_fullscreen set_geometry set_height set_id set_key_focus set_name set_opacity set_parent set_perspective set_position set_properties set_property set_reactive set_rotation set_scale set_scale_full set_scale_with_gravity set_shader set_shader_param_float set_shader_param_int set_size set_throttle_motion_events set_title set_use_fog set_user_resizable set_width set_x set_y set_z_rotation_from_gravity should_pick_paint show show_all show_cursor sort_depth_order stop_emission thaw_notify transform_stage_point unmap unparent unrealize unset_flags weak_ref
Clutter main module
ABSOLUTE_ORIGIN_CHANGED ACTOR_MAPPED ACTOR_REACTIVE ACTOR_REALIZED ACTOR_VISIBLE ALLOCATION_NONE ANIMATION_LAST Actor ActorBox ActorFlags AllocationFlags Alpha Animatable Animation AnimationMode BUTTON1_MASK BUTTON2_MASK BUTTON3_MASK BUTTON4_MASK BUTTON5_MASK BUTTON_PRESS BUTTON_RELEASE Backend Behaviour BehaviourBspline BehaviourDepth BehaviourEllipse BehaviourOpacity BehaviourPath BehaviourRotate BehaviourScale BindingPool CLIENT_MESSAGE CONTROL_MASK CUSTOM_MODE CairoContext CairoTexture ChildMeta Clone CloneTexture Color Container DELETE DESTROY_NOTIFY DeprecationWarning EASE_IN_BACK EASE_IN_BOUNCE EASE_IN_CIRC EASE_IN_CUBIC EASE_IN_ELASTIC EASE_IN_EXPO EASE_IN_OUT_BACK EASE_IN_OUT_BOUNCE EASE_IN_OUT_CIRC EASE_IN_OUT_CUBIC EASE_IN_OUT_ELASTIC EASE_IN_OUT_EXPO EASE_IN_OUT_QUAD EASE_IN_OUT_QUART EASE_IN_OUT_QUINT EASE_IN_OUT_SINE EASE_IN_QUAD EASE_IN_QUART EASE_IN_QUINT EASE_IN_SINE EASE_OUT_BACK EASE_OUT_BOUNCE EASE_OUT_CIRC EASE_OUT_CUBIC EASE_OUT_ELASTIC EASE_OUT_EXPO EASE_OUT_QUAD EASE_OUT_QUART EASE_OUT_QUINT EASE_OUT_SINE ENTER EVENT_FLAG_SYNTHETIC EVENT_NONE EXTENSION_DEVICE EffectTemplate Entry Event EventFlags EventType Exception FEATURE_OFFSCREEN FEATURE_SHADERS_GLSL FEATURE_STAGE_CURSOR FEATURE_STAGE_MULTIPLE FEATURE_STAGE_STATIC FEATURE_STAGE_USER_RESIZE FEATURE_SYNC_TO_VBLANK FEATURE_TEXTURE_NPOT FEATURE_TEXTURE_READ_PIXELS FEATURE_TEXTURE_YUV FONT_HINTING FONT_MIPMAPPING FeatureFlags FontFlags GRAVITY_CENTER GRAVITY_EAST GRAVITY_NONE GRAVITY_NORTH GRAVITY_NORTH_EAST GRAVITY_NORTH_WEST GRAVITY_SOUTH GRAVITY_SOUTH_EAST GRAVITY_SOUTH_WEST GRAVITY_WEST Geometry Gravity Group HYPER_MASK INIT_ERROR_BACKEND INIT_ERROR_INTERNAL INIT_ERROR_THREADS INIT_ERROR_UNKNOWN INIT_SUCCESS InitError InputDeviceType Interval KEYBOARD_DEVICE KEY_PRESS KEY_RELEASE Knot LEAVE LINEAR LOCK_MASK Label LazyModule LazyNamespace ListModel META_MASK MOD1_MASK MOD2_MASK MOD3_MASK MOD4_MASK MOD5_MASK MODIFIER_MASK MOTION Media Model ModelIter ModifierType NOTHING N_DEVICE_TYPES PATH_CLOSE PATH_CURVE_TO PATH_LINE_TO PATH_MOVE_TO PATH_REL_CURVE_TO PATH_REL_LINE_TO PATH_REL_MOVE_TO PICK_ALL PICK_NONE PICK_REACTIVE POINTER_DEVICE Path PathNode PathNodeType PickMode RELEASE_MASK REQUEST_HEIGHT_FOR_WIDTH REQUEST_WIDTH_FOR_HEIGHT ROTATE_CCW ROTATE_CW Rectangle RequestMode RotateAxis RotateDirection SCRIPT_ERROR_INVALID_PROPERTY SCRIPT_ERROR_INVALID_TYPE_FUNCTION SCRIPT_ERROR_INVALID_VALUE SCROLL SCROLL_DOWN SCROLL_LEFT SCROLL_RIGHT SCROLL_UP SHADER_ERROR_COMPILE SHADER_ERROR_NO_ASM SHADER_ERROR_NO_GLSL SHIFT_MASK STAGE_STATE STAGE_STATE_ACTIVATED STAGE_STATE_FULLSCREEN STAGE_STATE_OFFSCREEN SUPER_MASK Score Script ScriptError Scriptable ScrollDirection Shader ShaderError Stage StageState TEXTURE_ERROR_BAD_FORMAT TEXTURE_ERROR_NO_YUV TEXTURE_ERROR_OUT_OF_MEMORY TEXTURE_NONE TEXTURE_QUALITY_HIGH TEXTURE_QUALITY_LOW TEXTURE_QUALITY_MEDIUM TEXTURE_RGB_FLAG_BGR TEXTURE_RGB_FLAG_PREMULT TEXTURE_YUV_FLAG_YUV2 TIMELINE_BACKWARD TIMELINE_FORWARD Text Texture TextureError TextureFlags TextureQuality Timeline TimelineDirection UNIT_EM UNIT_MM UNIT_PIXEL UNIT_POINT UnitType Units Vertex Warning X_AXIS Y_AXIS Z_AXIS __builtins__ __doc__ __file__ __name__ __path__ __version__ _clutter _gobject _init alpha_register_func backend_get_default base_init binding_pool_find binding_pool_get_for_class clear_glyph_cache clutter_version cogl color_from_hls color_from_pixel color_from_string color_parse deprecation dl do_event effect_fade effect_move effect_path effect_rotate effect_scale event_get event_peek events_pending feature_available feature_get_all get_actor_by_gid get_current_event_time get_debug_enabled get_default_frame_rate get_font_flags get_font_map get_keyboard_grab get_motion_events_enabled get_pointer_grab get_script_id get_show_fps get_timestamp grab_keyboard grab_pointer grab_pointer_for_device init keysym_to_unicode keysyms ltihooks main main_level main_quit path_new_with_description rectangle_new_with_color redraw set_default_frame_rate set_font_flags set_motion_events_enabled stage_get_default sys texture_new_from_actor texture_new_from_file threads_enter threads_init threads_leave timeline_new_for_duration ungrab_keyboard ungrab_pointer ungrab_pointer_for_device ver