dnl $Id: convert_gtk.m4,v 1.2 2003/05/02 16:07:24 murrayc Exp $ include(convert_glib.m4) # # Table of widgets # _EQUAL(gboolean,int) _EQUAL(gint,int) _EQUAL(gint*,int*) _EQUAL(gint&,int&) _EQUAL(guint,unsigned int) _EQUAL(guint*,unsigned int*) _EQUAL(guint&,unsigned int&) _EQUAL(gdouble,double) _EQUAL(gdouble*,double*) _EQUAL(gfloat, float) _EQUAL(float*,gfloat[]) _EQUAL(GdkAtom,Gdk::Atom) _EQUAL(const-char*,const-gchar*) _EQUAL(return-char*,return-gchar*) _EQUAL(gpointer,void*) _EQUAL(gconstpointer,const void*) # # Basic Types _CONVERSION(`int',`bool',`$3') _CONVERSION(`bool',`int',`static_cast($3)') _CONVERSION(`unsigned int',`bool',`$3') _CONVERSION(`bool',`unsigned int',`static_cast($3)') _CONVERSION(`int&',`gint*',`&($3)') _CONVERSION(`gint*',`int&',`*($3)') _CONVERSION(`guint&',`guint*',`&($3)') _CONVERSION(`double&',`gdouble*',`&($3)') _CONVERSION(`float&',`gfloat*',`&($3)') _CONVERSION(`gchar**',`char**',`$3') _CONVERSION(`char**',`gchar**',`$3') _CONVERSION(`gpointer&',`gpointer*',`&($3)') _CONVERSION(`void*&',`gpointer*',`&($3)') _CONVERSION(`GError*&',`GError**',`&($3)') # Enums: _CONV_ENUM(Gtk,AccelFlags) _CONV_ENUM(Gtk,ArrowType) _CONV_ENUM(Gtk,AttachOptions) _CONV_ENUM(Gtk,ButtonBoxStyle) _CONV_ENUM(Gtk,ButtonsType) _CONV_ENUM(Gtk,CalendarDisplayOptions) _CONV_ENUM(Gtk,CellRendererMode) _CONV_ENUM(Gtk,CellRendererState) _CONV_ENUM(Gtk,CornerType) _CONV_ENUM(Gtk,CurveType) _CONV_ENUM(Gtk,DeleteType) _CONV_ENUM(Gtk,DestDefaults) _CONV_ENUM(Gtk,DirectionType) _CONV_ENUM(Gtk,ExpanderStyle) _CONV_ENUM(Gtk,ImageType) _CONV_ENUM(Gtk,Justification) _CONV_ENUM(Gtk,MenuDirectionType) _CONV_ENUM(Gtk,MessageType) _CONV_ENUM(Gtk,MetricType) _CONV_ENUM(Gtk,MovementStep) _CONV_ENUM(Gtk,NotebookTab) _CONV_ENUM(Gtk,Orientation) _CONV_ENUM(Gtk,PackType) _CONV_ENUM(Gtk,PolicyType) _CONV_ENUM(Gtk,PositionType) _CONV_ENUM(Gtk,PreviewType) _CONV_ENUM(Gtk,ProgressBarOrientation) _CONV_ENUM(Gtk,ProgressBarStyle) _CONV_ENUM(Gtk,ReliefStyle) _CONV_ENUM(Gtk,ResizeMode) _CONV_ENUM(Gtk,ScrollType) _CONV_ENUM(Gtk,SelectionMode) _CONV_ENUM(Gtk,ShadowType) _CONV_ENUM(Gtk,SizeGroupMode) _CONV_ENUM(Gtk,SortType) _CONV_ENUM(Gtk,SpinButtonUpdatePolicy) _CONV_ENUM(Gtk,SpinType) _CONV_ENUM(Gtk,StateType) _CONV_ENUM(Gtk,TextDirection) _CONV_ENUM(Gtk,TextSearchFlags) _CONV_ENUM(Gtk,TextWindowType) _CONV_ENUM(Gtk,ToolbarChildType) _CONV_ENUM(Gtk,ToolbarStyle) _CONV_ENUM(Gtk,TreeModelFlags) _CONV_ENUM(Gtk,TreeViewColumnSizing) _CONV_ENUM(Gtk,TreeViewDropPosition) _CONV_ENUM(Gtk,UpdateType) _CONV_ENUM(Gtk,Visibility) _CONV_ENUM(Gtk,WidgetHelpType) _CONV_ENUM(Gtk,WindowPosition) _CONV_ENUM(Gtk,WindowType) _CONV_ENUM(Gtk,WrapMode) _CONVERSION(`GtkIconSize',`IconSize',`IconSize(static_cast($3))') _CONVERSION(`GtkIconSize',`Gtk::IconSize',`Gtk::IconSize(static_cast($3))') _CONVERSION(`IconSize',`GtkIconSize',`static_cast(int($3))') _CONVERSION(`Gtk::IconSize',`GtkIconSize',`static_cast(int($3))') include(convert_atk.m4) include(convert_pango.m4) include(convert_gdk.m4) _CONVERSION(`guint',`WindowType',`static_cast($3)') _CONVERSION(`PolicyType&',`GtkPolicyType*',`(($2) &($3))') _CONVERSION(`SortType&',`GtkSortType*',`(($2) &($3))') _CONVERSION(`SortType*',`GtkSortType*',`(($2) ($3))') _CONVERSION(`GtkSortType*',`SortType*',`(($2) ($3))') _CONVERSION(`guint8',`Gtk::StateType',`static_cast($3)') # StockID: _CONVERSION(`const Gtk::StockID&',`const char*',`($3).get_c_str()') _CONVERSION(`char*',`StockID',`StockID($3)') # the StockID ctor handles 0 # # Ptr (gtk+) -> Ptr (gtkmm) define(`__FP2P',`($`'2)Glib::unwrap($`'3)') define(`__RP2P',`Glib::wrap($`'3)') define(`__RP2PD',`Glib::wrap((tran`'slit($`'2,:,))($`'3))') define(`__RP2CPD',`Glib::wrap((tran`'slit(pat`'subst($`'2,^const ,),:,))($`'3))') _CONVERSION(`GtkAdjustment*',`Gtk::Adjustment*',__RP2P) _CONVERSION(`GtkAdjustment*',`Adjustment*',__RP2P) _CONVERSION(`GtkWidget*',`Gtk::Widget*',__RP2P) _CONVERSION(`GtkWidget*',`Widget*',__RP2P) _CONVERSION(`GtkWindow*',`Window*',__RP2P) _CONVERSION(`GtkMenu*',`Menu*',__RP2P) # Ptr (gtk+) -> const Ptr (gtkmm) _CONVERSION(`GtkAdjustment*',`const Gtk::Adjustment*',__RP2P) _CONVERSION(`GtkAdjustment*',`const Adjustment*',__RP2P) _CONVERSION(`GtkWidget*',`const Gtk::Widget*',__RP2P) _CONVERSION(`GtkWidget*',`const Widget*',__RP2P) _CONVERSION(`GtkWindow*',`const Window*',__RP2P) # Style: _CONVERSION(`GtkStyle*',`Glib::RefPtr