Re: New patch for bug 55767



Kristian Rietveld <kristian planet nl> writes:

> Hi,
> 
> Here's a new patch for bug 55767. All of Owen's comments are processed in
> this patch. You can find his comments at:
> 
> http://mail.gnome.org/archives/gtk-devel-list/2001-June/msg00323.html

I'm applying this patch now. I didn't have to change a whole lot going
through it in substance. I did spend quite a bit of time on the docs,
partly doing some mechanical transformations (moving @returns: to the
bottom, changing it to Return value:), partly to improve the
descriptions in some places.

There were a few functions that decided not to apply for one 
reason or another (listed below) 
 
> The only function I'm not sure about is gtk_label_get_attributes, I hope
> somebody can take a look at it to check if it's right.

I ended up rewriting this part of the patch quite a bit, to get
the effect I wanted:

 gtk_label_get_attributes() returns whatever was set by
 gtk_label_set_attributes()

For people's reference I've also included all applied functions
below, roughly categorized into:

 * Straightforward stuff

 * Functions with multiple return values. There would be some argument
   here that these should all be split into one getter for return
   value since multiple return values map really badly into
   some languages (in particular Java) 

   I left them as multiple return values for the moment.

 * Functions where it was a little unclear what should be returned
   because there was a choice between:

    a) Returning a value indicating "unset" when the value was 
       unset.

    b) Returning the effective value that is used by GTK+ when
       the value has not been explicitely set.

   I uniformly went with a) as the more logical choice, and the
   choice that corresponds to what the property interface should
   return, but in some cases b) might be the more useful return
   value from C. 

If anybody wants to give the list of applied functions a look
over and give some comments, that would be appreciated. The
more eyes the better.

Regards,
                                        Owen

== Unapplied Functions ==

/* Doesn't make much sense - low level hook */
GtkColorSelectionChangePaletteFunc gtk_color_selection_get_change_palette_hook (void);

/* Broken widget */
GtkWidget*        gtk_tree_item_get_subtree             (GtkTreeItem         *tree_item);
/* Changes coming up */
void              gtk_cell_renderer_text_get_fixed_size (GtkCellRendererText *renderer,
							 gboolean            *fixed_size,
							 gint                *width,
							 gint                *height);
/* Discouraged function */
void              gtk_window_get_wmclass                (GtkWindow           *window,
							 gchar               *wmclass_name,
							 gchar               *wmclass_class);
/* Really badly named setter */
GtkWindowPosition gtk_window_get_position               (GtkWindow           *window);
/* Changes coming up */
void              gtk_widget_get_uposition              (GtkWidget           *widget,
							 gboolean            *x_set,
							 gboolean            *y_set,
							 gint                *x,
							 gint                *y);
/* Some brokeness in the definition of the setter */
void              gtk_text_view_get_text_window_size    (GtkTextView         *text_view,
							 gint                *width,
							 gint                *height);


== Applied functions  ==

/* Basic property getters (57) */

GtkWidget*                gtk_accel_label_get_accel_widget        (GtkAccelLabel         *accel_label);
gdouble                   gtk_adjustment_get_value                (GtkAdjustment         *adjustment);
gboolean                  gtk_box_get_homogeneous                 (GtkBox                *box);
gboolean                  gtk_cell_renderer_toggle_get_radio      (GtkCellRendererToggle *toggle);
gboolean                  gtk_check_menu_item_get_active          (GtkCheckMenuItem      *check_menu_item);
guint                     gtk_container_get_border_width          (GtkContainer          *container);
GtkAdjustment *           gtk_container_get_focus_vadjustment     (GtkContainer          *container);
GtkAdjustment *           gtk_container_get_focus_hadjustment     (GtkContainer          *container);
GtkResizeMode             gtk_container_get_resize_mode           (GtkContainer          *container);
gboolean                  gtk_editable_get_editable               (GtkEditable           *editable);
gboolean                  gtk_entry_get_visibility                (GtkEntry              *entry);
gunichar                  gtk_entry_get_invisible_char            (GtkEntry              *entry);
gint                      gtk_entry_get_max_length                (GtkEntry              *entry);
GtkWidget *               gtk_frame_get_label_widget              (GtkFrame              *frame);
GtkPositionType           gtk_handle_box_get_handle_position      (GtkHandleBox          *handle_box);
GtkShadowType             gtk_handle_box_get_shadow_type          (GtkHandleBox          *handle_box);
G_CONST_RETURN gchar *    gtk_label_get_label                     (GtkLabel              *label);
GtkJustification          gtk_label_get_justify                   (GtkLabel              *label);
gboolean                  gtk_label_get_line_wrap                 (GtkLabel              *label);
gboolean                  gtk_label_get_use_markup                (GtkLabel              *label);
gboolean                  gtk_label_get_use_underline             (GtkLabel              *label);
gboolean                  gtk_menu_get_tearoff_state              (GtkMenu               *menu);
G_CONST_RETURN gchar *    gtk_menu_get_title                      (GtkMenu               *menu);
GtkWidget *               gtk_menu_item_get_submenu               (GtkMenuItem           *menu_item);
gboolean                  gtk_notebook_get_show_border            (GtkNotebook           *notebook);
gboolean                  gtk_notebook_get_show_tabs              (GtkNotebook           *notebook);
GtkPositionType           gtk_notebook_get_tab_pos                (GtkNotebook           *notebook);
gboolean                  gtk_notebook_get_scrollable             (GtkNotebook           *notebook);
GtkUpdateType             gtk_range_get_update_policy             (GtkRange              *range);
GtkMetricType             gtk_ruler_get_metric                    (GtkRuler              *ruler);
GtkCornerType             gtk_scrolled_window_get_placement       (GtkScrolledWindow     *scrolled_window);
GtkShadowType             gtk_scrolled_window_get_shadow_type     (GtkScrolledWindow     *scrolled_window);
guint                     gtk_spin_button_get_digits              (GtkSpinButton         *spin_button);
GtkSpinButtonUpdatePolicy gtk_spin_button_get_update_policy       (GtkSpinButton         *spin_button);
gboolean                  gtk_spin_button_get_numeric             (GtkSpinButton         *spin_button);
gboolean                  gtk_spin_button_get_wrap                (GtkSpinButton         *spin_button);
gboolean                  gtk_spin_button_get_snap_to_ticks       (GtkSpinButton         *spin_button);
gboolean                  gtk_table_get_homogeneous               (GtkTable              *table);
GtkTextBuffer *           gtk_text_layout_get_buffer              (GtkTextLayout         *layout);
gboolean                  gtk_toggle_button_get_mode              (GtkToggleButton       *toggle_button);
GtkOrientation            gtk_toolbar_get_orientation             (GtkToolbar            *toolbar);
GtkToolbarStyle           gtk_toolbar_get_style                   (GtkToolbar            *toolbar);
GtkIconSize               gtk_toolbar_get_icon_size               (GtkToolbar            *toolbar);
gboolean                  gtk_toolbar_get_tooltips                (GtkToolbar            *toolbar);
GtkTreeSelectionMode      gtk_tree_selection_get_mode             (GtkTreeSelection      *selection);
gboolean                  gtk_tree_view_get_reorderable           (GtkTreeView           *tree_view);
gint                      gtk_tree_view_column_get_sort_column_id (GtkTreeViewColumn     *tree_column);
GtkShadowType             gtk_viewport_get_shadow_type            (GtkViewport           *viewport);
GtkWidget *               gtk_widget_get_parent                   (GtkWidget             *widget);
G_CONST_RETURN gchar *    gtk_window_get_title                    (GtkWindow             *window);
G_CONST_RETURN gchar *    gtk_window_get_role                     (GtkWindow             *window);
GtkWindow *               gtk_window_get_transient_for            (GtkWindow             *window);
GdkWindowTypeHint         gtk_window_get_type_hint                (GtkWindow             *window);
gboolean                  gtk_window_get_destroy_with_parent      (GtkWindow             *window);
gboolean                  gtk_window_get_has_frame                (GtkWindow             *window);
gboolean                  gtk_window_get_modal                    (GtkWindow             *window);
GdkModifierType           gtk_window_get_mnemonic_modifier        (GtkWindow             *window);

/* Properties of subparts (4) */

G_CONST_RETURN gchar *gtk_notebook_get_tab_label_text    (GtkNotebook       *notebook,
							  GtkWidget         *child);
void                  gtk_text_view_get_text_window_size (GtkTextView       *text_view,
							  GtkTextWindowType  type);
guint                 gtk_table_get_row_spacing          (GtkTable          *table,
							  guint              row);
guint                 gtk_table_get_col_spacing          (GtkTable          *table,
							  guint              column);


/* Simple properties, with multiple return values (9) */

void gtk_frame_get_label_align       (GtkFrame          *frame,
				      gfloat            *xalign,
				      gfloat            *yalign);
void gtk_layout_get_size             (GtkLayout         *layout,
				      guint             *width,
				      guint             *height);
void gtk_misc_get_alignment          (GtkMisc           *misc,
				      gfloat            *xalign,
				      gfloat            *yalign);
void gtk_misc_get_padding            (GtkMisc           *misc,
				      gint              *xpad,
				      gint              *ypad);
void gtk_ruler_get_range             (GtkRuler          *ruler,
				      gdouble           *lower,
				      gdouble           *upper,
				      gdouble           *position,
				      gdouble           *max_size);
void gtk_spin_button_get_increments  (GtkSpinButton     *spin_button,
				      gdouble           *step,
				      gdouble           *page);
void gtk_spin_button_get_range       (GtkSpinButton     *spin_button,
				      gdouble           *min,
				      gdouble           *max);
void gtk_window_get_frame_dimensions (GtkWindow         *window,
				      gint              *left,
				      gint              *top,
				      gint              *right,
				      gint              *bottom);
void gtk_scrolled_window_get_policy  (GtkScrolledWindow *scrolled_window,
				      GtkPolicyType     *hscrollbar_policy,
				      GtkPolicyType     *vscrollvar_policy);

/* Properties where the decision was to made to return unset, rather than
 * the default value which is used when the value is unset. (8)
 */
gboolean              gtk_container_get_focus_chain    (GtkContainer  *container,
							GList        **focusable_widgets);
GtkPositionType       gtk_handle_box_get_snap_edge     (GtkHandleBox  *handle_box);
GtkWidget *           gtk_label_get_mnemonic_widget    (GtkLabel      *label);
void                  gtk_widget_get_usize             (GtkWidget     *widget,
							gint          *width,
							gint          *height);
GtkWidget*            gtk_notebook_get_menu_label      (GtkNotebook   *notebook,
							GtkWidget     *child);
G_CONST_RETURN gchar *gtk_notebook_get_menu_label_text (GtkNotebook   *notebook,
							GtkWidget     *child);
PangoAttrList *       gtk_label_get_attributes         (GtkLabel      *label);
void                  gtk_window_get_default_size      (GtkWindow     *window,
							gint          *width,
							gint          *height);

/* Misc getters (2) */

guint      gtk_table_get_default_row_spacing (GtkTable        *table);
guint      gtk_table_get_default_col_spacing (GtkTable        *table);




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