Re: missing getters



On 5 Jun 2001, Havoc Pennington wrote:
>
> Kristian Rietveld <kristian planet nl> writes:
> > getset.pl: found 425 setters.
> > getset.pl: found 602 getters.
> > getsel.pl: 265 missing getters found.
>
> 265 seems like a lot of bloat, but a lot of these wouldn't need to be
> added, so it may be OK. I'd lean toward the change I suppose.
>
> Would be worth scanning GDK and gdk-pixbuf as well.

I thought that my script was scanning GDK and gdk-pixbuf, but it wasn't
(little bug :). Attached is a new script and a new list of missing
getters.

The script has scanned gdk-pixbuf, but gdk-pixbuf doesn't seem to have any
setters (I verified manually ;).

regards,


	Kris

-- 
Odi et amo. Quare id faciam, fortasse requiris?
	Nescio, sed fieri sentio et excrucior.

-Catullus (Carmen 85)
getset.pl: found 485 setters.
getset.pl: found 848 getters.
getsel.pl: 318 missing getters found.


listing missing getters:

gdk_fb_window_get_child_handler
gdk_fb_get_rotation
gdk_gc_get_foreground
gdk_gc_get_background
gdk_gc_get_font
gdk_gc_get_function
gdk_gc_get_fill
gdk_gc_get_tile
gdk_gc_get_stipple
gdk_gc_get_ts_origin
gdk_gc_get_clip_origin
gdk_gc_get_clip_mask
gdk_gc_get_clip_rectangle
gdk_gc_get_clip_region
gdk_gc_get_subwindow
gdk_gc_get_exposures
gdk_gc_get_line_attributes
gdk_gc_get_dashes
gdk_gc_get_rgb_fg_color
gdk_gc_get_rgb_bg_color
gdk_device_get_source
gdk_device_get_mode
gdk_device_get_key
gdk_device_get_axis_use
gdk_input_get_extension_events
gdk_pango_context_get_colormap
gdk_rgb_gc_get_foreground
gdk_rgb_gc_get_background
gdk_rgb_get_verbose
gdk_rgb_get_install
gdk_rgb_get_min_colors
gdk_window_get_geometry_hints
gdk_window_get_override_redirect
gdk_window_get_child_shapes
gdk_window_get_static_gravities
gdk_window_get_hints
gdk_window_get_type_hint
gdk_window_get_modal_hint
gdk_window_get_geometry_hints
gdk_window_get_title
gdk_window_get_role
gdk_window_get_transient_for
gdk_window_get_background
gdk_window_get_back_pixmap
gdk_window_get_cursor
gdk_window_get_icon_list
gdk_window_get_icon
gdk_window_get_icon_name
gdk_window_get_group
gdk_window_get_functions
gdk_window_get_debug_updates
gdk_input_common_get_key
gdk_input_common_get_axes
gtk_accel_label_get_accel_widget
gtk_adjustment_get_value
gtk_binding_get_new
gtk_binding_get_by_class
gtk_binding_get_find
gtk_binding_get_activate
gtk_binding_get_add_path
gtk_box_get_homogeneous
gtk_box_get_child_packing
gtk_cell_renderer_text_get_fixed_size
gtk_cell_renderer_toggle_get_radio
gtk_check_menu_item_get_active
gtk_check_menu_item_get_show_toggle
gtk_clipboard_get_with_data
gtk_clipboard_get_with_owner
gtk_clipboard_get_text
gtk_clist_get_shadow_type
gtk_clist_get_selection_mode
gtk_clist_get_reorderable
gtk_clist_get_use_drag_icons
gtk_clist_get_button_actions
gtk_clist_get_column_justification
gtk_clist_get_column_visibility
gtk_clist_get_column_resizeable
gtk_clist_get_column_auto_resize
gtk_clist_get_column_width
gtk_clist_get_column_min_width
gtk_clist_get_column_max_width
gtk_clist_get_row_height
gtk_clist_get_foreground
gtk_clist_get_background
gtk_clist_get_shift
gtk_clist_get_row_data_full
gtk_clist_get_compare_func
gtk_clist_get_sort_column
gtk_clist_get_sort_type
gtk_clist_get_auto_sort
gtk_color_selection_get_update_policy
gtk_color_selection_get_change_palette_hook
gtk_combo_get_value_in_list
gtk_combo_get_use_arrows
gtk_combo_get_use_arrows_always
gtk_combo_get_case_sensitive
gtk_combo_get_item_string
gtk_combo_get_popdown_strings
gtk_container_get_border_width
gtk_container_get_resize_mode
gtk_container_get_focus_chain
gtk_container_get_reallocate_redraws
gtk_container_get_focus_child
gtk_container_get_focus_vadjustment
gtk_container_get_focus_hadjustment
gtk_ctree_node_get_shift
gtk_ctree_node_get_foreground
gtk_ctree_node_get_background
gtk_ctree_node_get_row_data_full
gtk_ctree_get_indent
gtk_ctree_get_spacing
gtk_ctree_get_show_stub
gtk_ctree_get_line_style
gtk_ctree_get_expander_style
gtk_ctree_get_drag_compare_func
gtk_curve_get_gamma
gtk_curve_get_range
gtk_curve_get_curve_type
gtk_window_get_modal
gtk_window_get_destroy_with_parent
gtk_dialog_get_response_sensitive
gtk_dialog_get_default_response
gtk_drag_dest_get_proxy
gtk_drag_source_get_icon
gtk_drag_get_icon_widget
gtk_drag_get_icon_pixmap
gtk_drag_get_icon_default
gtk_drag_get_default_icon
gtk_editable_get_editable
gtk_entry_get_visibility
gtk_entry_get_invisible_char
gtk_entry_get_editable
gtk_entry_get_max_length
gtk_entry_get_position
gtk_frame_get_label_widget
gtk_frame_get_label_align
gtk_frame_get_shadow_type
gtk_handle_box_get_shadow_type
gtk_handle_box_get_handle_position
gtk_handle_box_get_snap_edge
gtk_icon_get_new
gtk_icon_get_new_from_pixbuf
gtk_icon_get_ref
gtk_icon_get_unref
gtk_icon_get_copy
gtk_icon_get_render_icon
gtk_icon_get_add_source
gtk_icon_get_get_sizes
gtk_icon_get_invalidate_caches
gtk_image_get_from_pixmap
gtk_image_get_from_image
gtk_image_get_from_file
gtk_image_get_from_pixbuf
gtk_image_get_from_stock
gtk_image_get_from_icon_set
gtk_image_get_from_animation
gtk_im_context_get_client_window
gtk_im_context_get_cursor_location
gtk_im_context_get_use_preedit
gtk_item_factory_get_translate_func
gtk_label_get_attributes
gtk_label_get_markup
gtk_label_get_markup_with_mnemonic
gtk_label_get_mnemonic_widget
gtk_label_get_text_with_mnemonic
gtk_label_get_justify
gtk_label_get_pattern
gtk_label_get_line_wrap
gtk_layout_get_size
gtk_list_get_selection_mode
gtk_list_store_get_n_columns
gtk_list_store_get_column_type
gtk_list_store_get_value
gtk_list_store_get_valist
gtk_menu_get_tearoff_state
gtk_menu_get_title
gtk_menu_item_get_submenu
gtk_menu_item_get_placement
gtk_misc_get_alignment
gtk_misc_get_padding
gtk_notebook_get_page
gtk_notebook_get_show_border
gtk_notebook_get_show_tabs
gtk_notebook_get_tab_pos
gtk_notebook_get_homogeneous_tabs
gtk_notebook_get_tab_border
gtk_notebook_get_tab_hborder
gtk_notebook_get_tab_vborder
gtk_notebook_get_scrollable
gtk_notebook_get_tab_label_text
gtk_notebook_get_menu_label_text
gtk_notebook_get_tab_label_packing
gtk_object_get_data_full
gtk_object_get_data_by_id_full
gtk_packer_get_child_packing
gtk_packer_get_spacing
gtk_packer_get_default_border_width
gtk_packer_get_default_pad
gtk_packer_get_default_ipad
gtk_pixmap_get_build_insensitive
gtk_preview_get_expand
gtk_preview_get_gamma
gtk_preview_get_color_cube
gtk_preview_get_install_cmap
gtk_preview_get_reserved
gtk_preview_get_dither
gtk_progress_get_show_text
gtk_progress_get_text_alignment
gtk_progress_get_format_string
gtk_progress_get_adjustment
gtk_progress_get_percentage
gtk_progress_get_activity_mode
gtk_progress_bar_get_bar_style
gtk_progress_bar_get_discrete_blocks
gtk_progress_bar_get_activity_step
gtk_progress_bar_get_activity_blocks
gtk_radio_button_get_group
gtk_radio_menu_item_get_group
gtk_range_get_update_policy
gtk_rbtree_node_get_height
gtk_rc_get_image_loader
gtk_ruler_get_metric
gtk_ruler_get_range
gtk_scrolled_window_get_policy
gtk_scrolled_window_get_placement
gtk_scrolled_window_get_shadow_type
gtk_settings_get_property_value
gtk_settings_get_string_property
gtk_settings_get_long_property
gtk_settings_get_double_property
gtk_spin_button_get_digits
gtk_spin_button_get_increments
gtk_spin_button_get_range
gtk_spin_button_get_value
gtk_spin_button_get_update_policy
gtk_spin_button_get_numeric
gtk_spin_button_get_wrap
gtk_spin_button_get_snap_to_ticks
gtk_style_get_background
gtk_table_get_row_spacing
gtk_table_get_col_spacing
gtk_table_get_row_spacings
gtk_table_get_col_spacings
gtk_table_get_homogeneous
gtk_text_get_editable
gtk_text_get_word_wrap
gtk_text_get_line_wrap
gtk_text_get_adjustments
gtk_text_btree_get_mark
gtk_text_layout_get_buffer
gtk_text_layout_get_default_style
gtk_text_layout_get_contexts
gtk_text_layout_get_screen_width
gtk_text_layout_get_preedit_string
gtk_text_anchored_child_get_layout
gtk_text_view_get_border_window_size
gtk_text_view_get_text_window_size
gtk_tips_query_get_caller
gtk_tips_query_get_labels
gtk_toggle_button_get_mode
gtk_toolbar_get_icon_size
gtk_toolbar_get_orientation
gtk_toolbar_get_style
gtk_toolbar_get_tooltips
gtk_tooltips_get_delay
gtk_tooltips_get_tip
gtk_tooltips_get_colors
gtk_tree_get_selection_mode
gtk_tree_get_view_mode
gtk_tree_get_view_lines
gtk_tree_item_get_subtree
gtk_tree_view_column_get_tree_view
gtk_tree_selection_get_mode
gtk_tree_selection_get_select_function
gtk_tree_sortable_sort_column_id_get_func
gtk_tree_store_get_n_columns
gtk_tree_store_get_column_type
gtk_tree_store_get_value
gtk_tree_store_get_valist
gtk_tree_view_get_headers_clickable
gtk_tree_view_get_column_drag_function
gtk_tree_view_get_reorderable
gtk_tree_view_get_rows_drag_source
gtk_tree_view_get_rows_drag_dest
gtk_tree_view_column_get_attributes
gtk_tree_view_column_get_cell_data_func
gtk_tree_view_column_get_sort_column_id
gtk_tree_view_column_cell_get_cell_data
gtk_viewport_get_shadow_type
gtk_widget_get_scroll_adjustments
gtk_widget_get_scroll_adjustments
gtk_widget_get_state
gtk_widget_get_sensitive
gtk_widget_get_app_paintable
gtk_widget_get_double_buffered
gtk_widget_get_parent
gtk_widget_get_uposition
gtk_widget_get_usize
gtk_widget_get_rc_style
gtk_decorated_window_get_title
gtk_window_get_title
gtk_window_get_wmclass
gtk_window_get_role
gtk_window_get_position
gtk_window_get_transient_for
gtk_window_get_type_hint
gtk_window_get_destroy_with_parent
gtk_window_get_geometry_hints
gtk_window_get_has_frame
gtk_window_get_frame_dimensions
gtk_window_get_decorated
gtk_window_get_modal
gtk_window_get_mnemonic_modifier
gtk_window_get_policy
gtk_window_get_default_size
gtk_window_get_focus
gtk_window_get_default
gtk_paned_get_gutter_size
gtk_clist_get_reorderable
#!/usr/bin/perl -w

#
# getset.pl - lists all missing 'getters'
#
# (C) 2001 Kristian Rietveld <kristian planet nl>
#

use strict;

# step 1: find all .h files

my $temp;
my @files;

foreach $temp (`find -name '*.h'`) {
	if ($temp =~ /\.\/(.*?)\/.*$/) {
		if ($1 eq 'gdk' || $1 eq 'gdk-pixbuf' || $1 eq 'gtk') {
			push (@files, $temp);
		}
	}
}

# step 2: get all _set functions

my @setters;

foreach $temp (@files) {
	open (FH, "< $temp") || warn "couldn't open $temp\n";
	while (<FH>) {
		if (/^.*?\w+.*((gdk|gtk)_[\w_]*_set_[\w_]*).*\(.*$/) {
			push (@setters, $1);
		}
	}
	close (FH);
}

print "getset.pl: found $#setters setters.\n";

# step 3: get all _get functions

my @getters;

foreach $temp (@files) {
	open (FH, "< $temp") || warn "couldn't open $temp\n";
	while (<FH>) {
		if (/^.*?\w+.*((gdk|gtk)_[\w_]*_get_[\w_]*).*\(.*$/) {
			push (@getters, $1);
		}
	}
	close (FH);
}

print "getset.pl: found $#getters getters.\n";

# step 4: find all missing _get functions

my @missing_funcs;
my ($gettername, $f, $i);

foreach $temp (@setters) {
	$gettername = $temp;
	$gettername =~ s/_set_/_get_/;

	# this is an ugly hack

	$i = 0;

	foreach $f (@getters) {
		last if ($f eq $gettername);
		$i++;
	}

	if (($i - 1) == $#getters) {
		push (@missing_funcs, $gettername);
	}
}

# step 5: dump all missing getters on the terminal

print "getsel.pl: $#missing_funcs missing getters found.\n";

print "\n\nlisting missing getters:\n\n";

foreach $temp (@missing_funcs) {
	print $temp, "\n";
}

# done

exit 0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]