Re: introspection and broken API



On Tue, 2005-03-29 at 14:41 +0900, Ryan McDougall wrote:
> On Fri, 2005-25-03 at 01:06 -0500, Havoc Pennington wrote:
> > On Fri, 2005-03-25 at 00:45 -0500, Havoc Pennington wrote:
> > >  - put the main loop only in the GLib layer, no gtk_main visible
> > >  - hide color allocation, just always use the GdkRGB stuff
> > >  - fix some of the other examples of weird X features leaking through
> > >  - gdk_drawable_get_size() replaced by get_width()/get_height() 
> > >    accessors
> > >  - omit deprecated APIs
> > >  - omit non-multihead-correct APIs
> > > 
> > 
> > A couple other good ones I remembered:
> >  - dumping GtkObject out of the class hierarchy
> >  - killing off the argument to gtk_window_new
> > 
> > I know there are more.
> > 
> > Havoc
> 
> - DnD is heavily based on X selections, and thus weirdness seeps
> through. Sepecifically, GTK should provide a canonical list of supported
> GtkTargetEntry's, map those to X selections, then hide the whole mess
> from the programmer with getter/setters to those targets.
> 

We have made quite some progress towards that goal in 2.6, with hi-level
api to handle text, images and uris:

void           gtk_target_list_add_text_targets  (GtkTargetList  *list,
						  guint           info);
void           gtk_target_list_add_image_targets (GtkTargetList  *list,
						  guint           info,
						  gboolean        writable);
void           gtk_target_list_add_uri_targets   (GtkTargetList  *list,
						  guint           info);

gboolean gtk_selection_data_set_text (GtkSelectionData
*selection_data,
				      const gchar          *str,
				      gint                  len);
guchar * gtk_selection_data_get_text (GtkSelectionData
*selection_data);
gboolean gtk_selection_data_set_pixbuf   (GtkSelectionData
*selection_data,
				          GdkPixbuf         *pixbuf);
GdkPixbuf *gtk_selection_data_get_pixbuf (GtkSelectionData
*selection_data);
gboolean gtk_selection_data_set_uris (GtkSelectionData
*selection_data,
				      gchar               **uris);
gchar  **gtk_selection_data_get_uris (GtkSelectionData
*selection_data);

void           gtk_drag_dest_add_text_targets  (GtkWidget    *widget);
void           gtk_drag_dest_add_image_targets (GtkWidget    *widget);
void           gtk_drag_dest_add_uri_targets   (GtkWidget    *widget);

void           gtk_drag_source_add_text_targets  (GtkWidget
*widget);
void           gtk_drag_source_add_image_targets (GtkWidget    *widget);
void           gtk_drag_source_add_uri_targets   (GtkWidget    *widget);

Matthias







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