void OnExportClicked( GtkButton* button, gpointer user_data ){
ui::Widget window = lookup_widget( GTK_WIDGET( button ), "w_plugplug2" );
- ASSERT_NOTNULL( window );
+ ASSERT_TRUE( window );
const char* cpath = GlobalRadiant().m_pfnFileDialog( window, false, "Save as Obj", 0, 0, false, false, true );
if ( !cpath ) {
return;
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_show( hbox );
- g_pTimeLine = GTK_ADJUSTMENT( gtk_adjustment_new( 0, 0, 30000, 100, 250, 0 ) );
+ g_pTimeLine = ui::Adjustment( 0, 0, 30000, 100, 250, 0 );
gtk_signal_connect( GTK_OBJECT( g_pTimeLine ), "value_changed", GTK_SIGNAL_FUNC( ci_timeline_changed ), NULL );
w = gtk_hscale_new( g_pTimeLine );
gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
g_object_set_data( G_OBJECT( dlg ), "roughness", entry );
g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Roughness );
- adj = gtk_adjustment_new( 1, 1, 32767, 1, 10, 0 );
+ adj = ui::Adjustment( 1, 1, 32767, 1, 10, 0 );
g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( general_random ), NULL );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
gtk_widget_show( spin );
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
g_object_set_data( G_OBJECT( dlg ), "nv_text", label );
- adj = gtk_adjustment_new( 8, 1, MAX_ROWS, 1, 10, 0 );
+ adj = ui::Adjustment( 8, 1, MAX_ROWS, 1, 10, 0 );
g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_nhnv_spin ), &NH );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
gtk_widget_show( spin );
gtk_widget_set_usize( spin, 60, -2 );
g_object_set_data( G_OBJECT( dlg ), "nh", spin );
- adj = gtk_adjustment_new( 8, 1, MAX_ROWS, 1, 10, 0 );
+ adj = ui::Adjustment( 8, 1, MAX_ROWS, 1, 10, 0 );
g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_nhnv_spin ), &NV );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
gtk_widget_show( spin );
gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, TRUE, 0 );
gtk_object_set_data( GTK_OBJECT( dlg ), "snap_text", label );
- adj = gtk_adjustment_new( 8, 0, 256, 1, 10, 0 );
+ adj = ui::Adjustment( 8, 0, 256, 1, 10, 0 );
g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_snaptogrid_spin ), &SP );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
gtk_widget_show( spin );
gtk_widget_show( label );
gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, TRUE, 0 );
- adj = gtk_adjustment_new( 0, 0, 110, 1, 10, 0 );
+ adj = ui::Adjustment( 0, 0, 110, 1, 10, 0 );
g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_decimate ), NULL );
g_object_set_data( G_OBJECT( dlg ), "decimate_adj", adj );
scale = gtk_hscale_new( GTK_ADJUSTMENT( adj ) );
gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
g_object_set_data( G_OBJECT( dlg ), "fix_rate_text", label );
- adj = gtk_adjustment_new( 0, -65536, 65536, 1, 16, 0 );
+ adj = ui::Adjustment( 0, -65536, 65536, 1, 16, 0 );
g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( fix_value_changed ), NULL );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
gtk_widget_show( spin );
gtk_widget_show( label );
gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, TRUE, 0 );
- adj = gtk_adjustment_new( 60, 0, 90, 1, 10, 0 );
+ adj = ui::Adjustment( 60, 0, 90, 1, 10, 0 );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
gtk_widget_show( spin );
gtk_box_pack_start( GTK_BOX( hbox2 ), spin, FALSE, TRUE, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
gtk_box_pack_start( GTK_BOX( hbox ), label, FALSE, TRUE, 0 );
- adj = gtk_adjustment_new( 30, -90, 90, 1, 10, 0 );
+ adj = ui::Adjustment( 30, -90, 90, 1, 10, 0 );
gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( preview_spin ), &elevation );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
gtk_widget_show( spin );
gtk_box_pack_start( GTK_BOX( hbox ), spin, FALSE, TRUE, 0 );
g_signal_connect( G_OBJECT( spin ), "focus_out_event", G_CALLBACK( doublevariable_spinfocusout ), &elevation );
- adj = gtk_adjustment_new( 30, 0, 359, 1, 10, 0 );
+ adj = ui::Adjustment( 30, 0, 359, 1, 10, 0 );
gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( preview_spin ), &azimuth );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
gtk_widget_show( spin );
GtkWidget *transslider, *translabel, *clipslider, *cliplabel;
GtkWidget *show2check, *show3check, *portalcheck;
int loop = 1, ret = IDCANCEL;
- GtkObject *adj;
dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_window_set_title( GTK_WINDOW( dlg ), "Portal Viewer Configuration" );
gtk_widget_show( hbox );
gtk_box_pack_start( GTK_BOX( vbox2 ), hbox, TRUE, TRUE, 0 );
- adj = gtk_adjustment_new( portals.width_3d, 2, 40, 1, 1, 0 );
+ auto adj = ui::Adjustment( portals.width_3d, 2, 40, 1, 1, 0 );
lw3slider = gtk_hscale_new( GTK_ADJUSTMENT( adj ) );
gtk_widget_show( lw3slider );
gtk_box_pack_start( GTK_BOX( hbox ), lw3slider, TRUE, TRUE, 0 );
lw3label = ui::Label( "" );
gtk_widget_show( lw3label );
gtk_box_pack_start( GTK_BOX( hbox ), lw3label, FALSE, TRUE, 0 );
- gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( OnScroll3d ), lw3label );
+ gtk_signal_connect( GTK_OBJECT(adj), "value_changed", GTK_SIGNAL_FUNC( OnScroll3d ), lw3label );
table = ui::Table( 2, 4, FALSE );
gtk_widget_show( table );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
- adj = gtk_adjustment_new( portals.trans_3d, 0, 100, 1, 1, 0 );
+ adj = ui::Adjustment( portals.trans_3d, 0, 100, 1, 1, 0 );
transslider = gtk_hscale_new( GTK_ADJUSTMENT( adj ) );
gtk_widget_show( transslider );
gtk_table_attach( GTK_TABLE( table ), transslider, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( translabel ), 0.0, 0.0 );
- gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( OnScrollTrans ), translabel );
+ gtk_signal_connect( GTK_OBJECT(adj), "value_changed", GTK_SIGNAL_FUNC( OnScrollTrans ), translabel );
- adj = gtk_adjustment_new( portals.clip_range, 1, 128, 1, 1, 0 );
+ adj = ui::Adjustment( portals.clip_range, 1, 128, 1, 1, 0 );
clipslider = gtk_hscale_new( GTK_ADJUSTMENT( adj ) );
gtk_widget_show( clipslider );
gtk_table_attach( GTK_TABLE( table ), clipslider, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( cliplabel ), 0.0, 0.0 );
- gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( OnScrollClip ), cliplabel );
+ gtk_signal_connect( GTK_OBJECT(adj), "value_changed", GTK_SIGNAL_FUNC( OnScrollClip ), cliplabel );
hbox = ui::HBox( TRUE, 5 );
gtk_widget_show( hbox );
gtk_widget_show( hbox );
gtk_box_pack_start( GTK_BOX( vbox2 ), hbox, TRUE, FALSE, 0 );
- adj = gtk_adjustment_new( portals.width_2d, 2, 40, 1, 1, 0 );
+ adj = ui::Adjustment( portals.width_2d, 2, 40, 1, 1, 0 );
lw2slider = gtk_hscale_new( GTK_ADJUSTMENT( adj ) );
gtk_widget_show( lw2slider );
gtk_box_pack_start( GTK_BOX( hbox ), lw2slider, TRUE, TRUE, 0 );
lw2label = ui::Label( "" );
gtk_widget_show( lw2label );
gtk_box_pack_start( GTK_BOX( hbox ), lw2label, FALSE, TRUE, 0 );
- gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( OnScroll2d ), lw2label );
+ gtk_signal_connect( GTK_OBJECT(adj), "value_changed", GTK_SIGNAL_FUNC( OnScroll2d ), lw2label );
hbox = ui::HBox( FALSE, 5 );
gtk_widget_show( hbox );
globalOutputStream() << "SunPlug: adviced mapcoordsmins=" << minX << " " << maxY << "\n"; // console info about mapcoordsmins
globalOutputStream() << "SunPlug: adviced mapcoordsmaxs=" << maxX << " " << minY << "\n"; // console info about mapcoordsmaxs
- spinner_adj_MinX = (GtkAdjustment *)gtk_adjustment_new( map_minX, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of minimum x value
- spinner_adj_MinY = (GtkAdjustment *)gtk_adjustment_new( map_minY, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of minimum y value
- spinner_adj_MaxX = (GtkAdjustment *)gtk_adjustment_new( map_maxX, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of maximum x value
- spinner_adj_MaxY = (GtkAdjustment *)gtk_adjustment_new( map_maxY, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of maximum y value
+ spinner_adj_MinX = ui::Adjustment( map_minX, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of minimum x value
+ spinner_adj_MinY = ui::Adjustment( map_minY, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of minimum y value
+ spinner_adj_MaxX = ui::Adjustment( map_maxX, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of maximum x value
+ spinner_adj_MaxY = ui::Adjustment( map_maxY, -65536.0, 65536.0, 1.0, 5.0, 0 ); // create adjustment for value and range of maximum y value
button = ui::Button( "Get optimal mapcoords" ); // create button with text
g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( input_optimal ), NULL ); // connect button with callback function
return g_signal_connect(G_OBJECT(*this), "key-press-event", (GCallback) +func, &pass);
}
+ Adjustment::Adjustment(double value,
+ double lower, double upper,
+ double step_increment, double page_increment,
+ double page_size)
+ : Adjustment(GTK_ADJUSTMENT(gtk_adjustment_new(value, lower, upper, step_increment, page_increment, page_size)))
+ { }
+
Alignment::Alignment(float xalign, float yalign, float xscale, float yscale)
: Alignment(GTK_ALIGNMENT(gtk_alignment_new(xalign, yalign, xscale, yscale)))
{ }
#include <string>
+using ui_adjustment = struct _GtkAdjustment;
using ui_alignment = struct _GtkAlignment;
using ui_box = struct _GtkBox;
using ui_button = struct _GtkButton;
using ui_menu = struct _GtkMenu;
using ui_menuitem = struct _GtkMenuItem;
using ui_modal = struct ModalDialog;
+using ui_object = struct _GtkObject;
using ui_scrolledwindow = struct _GtkScrolledWindow;
using ui_table = struct _GtkTable;
using ui_treemodel = struct _GtkTreeModel;
NO,
};
- template<class Self, class T>
- class Convertible {
- public:
- T *handle() const
- { return (T *) static_cast<const Self *>(this)->_handle; }
+ template<class Self, class T, bool implicit = true>
+ struct Convertible;
+ template<class Self, class T>
+ struct Convertible<Self, T, true> {
operator T *() const
- { return handle(); }
+ { return reinterpret_cast<T *>(static_cast<const Self *>(this)->_handle); }
+ };
+
+ template<class Self, class T>
+ struct Convertible<Self, T, false> {
+ explicit operator T *() const
+ { return reinterpret_cast<T *>(static_cast<const Self *>(this)->_handle); }
};
- class Base {
+ class Object : public Convertible<Object, ui_object, false> {
public:
void *_handle;
- Base(void *h) : _handle(h)
+ Object(void *h) : _handle(h)
{ }
explicit operator bool() const
{ return _handle; }
};
- static_assert(sizeof(Base) == sizeof(ui_widget *), "object slicing");
+ static_assert(sizeof(Object) == sizeof(ui_widget *), "object slicing");
- class Widget : public Base, public Convertible<Widget, ui_widget> {
+ class Widget : public Object, public Convertible<Widget, ui_widget> {
public:
using native = ui_widget;
- explicit Widget(ui_widget *h = nullptr) : Base((void *) h)
+ explicit Widget(ui_widget *h = nullptr) : Object((void *) h)
{ }
alert_response alert(std::string text, std::string title = "NetRadiant",
bool want_save = false);
};
- static_assert(sizeof(Widget) == sizeof(Base), "object slicing");
+ static_assert(sizeof(Widget) == sizeof(Object), "object slicing");
extern Widget root;
}; \
static_assert(sizeof(name) == sizeof(super), "object slicing")
+ WRAP(Adjustment, Widget, ui_adjustment,
+ Adjustment(double value,
+ double lower, double upper,
+ double step_increment, double page_increment,
+ double page_size);
+ );
+
WRAP(Alignment, Widget, ui_alignment,
Alignment(float xalign, float yalign, float xscale, float yscale);
);
}
inline WindowVector windowvector_for_widget_centre( ui::Widget widget ){
- return WindowVector( static_cast<float>( widget.handle()->allocation.width / 2 ), static_cast<float>( widget.handle()->allocation.height / 2 ) );
+ return WindowVector( static_cast<float>( GTK_WIDGET(widget)->allocation.width / 2 ), static_cast<float>(GTK_WIDGET(widget)->allocation.height / 2 ) );
}
gboolean selection_button_press_freemove( ui::Widget widget, GdkEventButton* event, WindowObserver* observer ){
{
++digits;
}
- GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( value, lower, upper, step, 10, 0 ) ), step, digits ) );
+ GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( ui::Adjustment( value, lower, upper, step, 10, 0 ), step, digits ) );
gtk_widget_show( GTK_WIDGET( spin ) );
gtk_widget_set_size_request( GTK_WIDGET( spin ), 64, -1 );
return spin;
#endif
// adjustment
- GtkObject* adj = gtk_adjustment_new( value, lower, upper, step_increment, page_increment, 0 );
- AddIntAdjustmentData( *GTK_ADJUSTMENT( adj ), IntImportCaller( data ), IntExportCaller( data ) );
+ auto adj = ui::Adjustment( value, lower, upper, step_increment, page_increment, 0 );
+ AddIntAdjustmentData( *GTK_ADJUSTMENT(adj), IntImportCaller( data ), IntExportCaller( data ) );
// scale
ui::Widget alignment = ui::Alignment( 0.0, 0.5, 1.0, 0.0 );
}
gint window_realize_remove_decoration( ui::Widget widget, gpointer data ){
- gdk_window_set_decorations( widget.handle()->window, (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MENU | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE ) );
+ gdk_window_set_decorations( GTK_WIDGET(widget)->window, (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MENU | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE ) );
return FALSE;
}
// so we need to have at least one initialisation somewhere
entry_set_float( entry, g_pi_globals.shift[0] );
- GtkAdjustment* adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 1, 1, 0 ) );
+ GtkAdjustment* adj = ui::Adjustment( 0, -8192, 8192, 1, 1, 0 );
g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( window ), "hshift_adj", adj );
gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 );
entry_set_float( entry, g_pi_globals.shift[1] );
- GtkAdjustment* adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 1, 1, 0 ) );
+ GtkAdjustment* adj = ui::Adjustment( 0, -8192, 8192, 1, 1, 0 );
g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( window ), "vshift_adj", adj );
gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 );
entry_set_float( entry, g_pi_globals.scale[0] );
- GtkAdjustment* adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0, -1000, 1000, 1, 1, 0 ) );
+ GtkAdjustment* adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 );
g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( window ), "hscale_adj", adj );
gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 );
entry_set_float( entry, g_pi_globals.scale[1] );
- GtkAdjustment* adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0, -1000, 1000, 1, 1, 0 ) );
+ GtkAdjustment* adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 );
g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( window ), "vscale_adj", adj );
gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 );
entry_set_float( entry, g_pi_globals.rotate );
- GtkAdjustment* adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0, -1000, 1000, 1, 1, 0 ) ); // NOTE: Arnout - this really should be 360 but can't change it anymore as it could break existing maps
+ GtkAdjustment* adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 ); // NOTE: Arnout - this really should be 360 but can't change it anymore as it could break existing maps
g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( window ), "rotate_adj", adj );
(GtkAttachOptions) ( 0 ), 0, 0 );
}
{
- GtkAdjustment* adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0, -359, 359, 1, 10, 0 ) );
+ GtkAdjustment* adj = ui::Adjustment( 0, -359, 359, 1, 10, 0 );
GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( adj, 1, 0 ) );
gtk_widget_show( GTK_WIDGET( spin ) );
gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 0, 1,
g_rotate_dialog.x = spin;
}
{
- GtkAdjustment* adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0, -359, 359, 1, 10, 0 ) );
+ GtkAdjustment* adj = ui::Adjustment( 0, -359, 359, 1, 10, 0 );
GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( adj, 1, 0 ) );
gtk_widget_show( GTK_WIDGET( spin ) );
gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 1, 2,
g_rotate_dialog.y = spin;
}
{
- GtkAdjustment* adj = GTK_ADJUSTMENT( gtk_adjustment_new( 0, -359, 359, 1, 10, 0 ) );
+ GtkAdjustment* adj = ui::Adjustment( 0, -359, 359, 1, 10, 0 );
GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( adj, 1, 0 ) );
gtk_widget_show( GTK_WIDGET( spin ) );
gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 2, 3,
(GtkAttachOptions) ( 0 ), 0, 0 );
}
{
- GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 2 ) );
+ GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 2 ) );
m_hshiftIncrement.m_spin = spin;
m_hshiftSpinner.connect( spin );
gtk_widget_show( GTK_WIDGET( spin ) );
(GtkAttachOptions) ( 0 ), 0, 0 );
}
{
- GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 2 ) );
+ GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 2 ) );
m_vshiftIncrement.m_spin = spin;
m_vshiftSpinner.connect( spin );
gtk_widget_show( GTK_WIDGET( spin ) );
(GtkAttachOptions) ( 0 ), 0, 0 );
}
{
- GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 5 ) );
+ GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 5 ) );
m_hscaleIncrement.m_spin = spin;
m_hscaleSpinner.connect( spin );
gtk_widget_show( GTK_WIDGET( spin ) );
(GtkAttachOptions) ( 0 ), 0, 0 );
}
{
- GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 5 ) );
+ GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 5 ) );
m_vscaleIncrement.m_spin = spin;
m_vscaleSpinner.connect( spin );
gtk_widget_show( GTK_WIDGET( spin ) );
(GtkAttachOptions) ( 0 ), 0, 0 );
}
{
- GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 2 ) );
+ GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 2 ) );
m_rotateIncrement.m_spin = spin;
m_rotateSpinner.connect( spin );
gtk_widget_show( GTK_WIDGET( spin ) );
gtk_widget_set_usize( button, 60, -2 );
}
{
- ui::Widget spin = ui::Widget(gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 1, 0, 1 << 16, 1, 10, 0 ) ), 0, 6 ));
+ ui::Widget spin = ui::Widget(gtk_spin_button_new( ui::Adjustment( 1, 0, 1 << 16, 1, 10, 0 ), 0, 6 ));
gtk_widget_show( spin );
gtk_table_attach( GTK_TABLE( table ), spin, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
AddDialogData( *GTK_SPIN_BUTTON( spin ), m_fitHorizontal );
}
{
- ui::Widget spin = ui::Widget(gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 1, 0, 1 << 16, 1, 10, 0 ) ), 0, 6 ));
+ ui::Widget spin = ui::Widget(gtk_spin_button_new( ui::Adjustment( 1, 0, 1 << 16, 1, 10, 0 ), 0, 6 ));
gtk_widget_show( spin );
gtk_table_attach( GTK_TABLE( table ), spin, 3, 4, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
gtk_widget_show( GTK_WIDGET( g_TextureBrowser.m_treeViewTree ) );
}
{ // gl_widget scrollbar
- ui::Widget w = ui::Widget(gtk_vscrollbar_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,0,1,1,0 ) ) ));
+ ui::Widget w = ui::Widget(gtk_vscrollbar_new( ui::Adjustment( 0,0,0,1,1,0 ) ));
gtk_table_attach( GTK_TABLE( table ), w, 2, 3, 1, 2, GTK_SHRINK, GTK_FILL, 0, 0 );
gtk_widget_show( w );
g_TextureBrowser.m_texture_scroll = w;
ScopeDisableScreenUpdates disableScreenUpdates( "Processing...", "Loading Shaders" );
GlobalShaderSystem().refresh();
UpdateAllWindows();
- GtkTreeSelection* selection = gtk_tree_view_get_selection((GtkTreeView*) GlobalTextureBrowser().m_treeViewTree.handle());
+ GtkTreeSelection* selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(GlobalTextureBrowser().m_treeViewTree));
GtkTreeModel* model = NULL;
GtkTreeIter iter;
if ( gtk_tree_selection_get_selected (selection, &model, &iter) )
if ( ClipMode() && GlobalClipPoints_Find( mousePosition, (VIEWTYPE)m_viewType, m_fScale ) != 0 ) {
GdkCursor *cursor;
cursor = gdk_cursor_new( GDK_CROSSHAIR );
- gdk_window_set_cursor( m_gl_widget.handle()->window, cursor );
+ gdk_window_set_cursor( GTK_WIDGET(m_gl_widget)->window, cursor );
gdk_cursor_unref( cursor );
}
else
{
- gdk_window_set_cursor( m_gl_widget.handle()->window, 0 );
+ gdk_window_set_cursor( GTK_WIDGET(m_gl_widget)->window, 0 );
}
}