#include "patchdialog.h"
+#include <gtk/gtk.h>
+
#include "itexdef.h"
#include "debugging/debugging.h"
-#include <gtk/gtk.h>
-
#include "gtkutil/idledraw.h"
#include "gtkutil/entry.h"
#include "gtkutil/button.h"
#endif
}
-class PatchSetFixedSubdivisions
-{
-const PatchFixedSubdivisions& m_subdivisions;
-public:
-PatchSetFixedSubdivisions( const PatchFixedSubdivisions& subdivisions ) : m_subdivisions( subdivisions ){
-}
-void operator()( Patch& patch ) const {
- Patch_setFixedSubdivisions( patch, m_subdivisions );
-}
-};
-
void Scene_PatchSetFixedSubdivisions( const PatchFixedSubdivisions& subdivisions ){
UndoableCommand command( "patchSetFixedSubdivisions" );
- Scene_forEachVisibleSelectedPatch( PatchSetFixedSubdivisions( subdivisions ) );
+ Scene_forEachVisibleSelectedPatch([&](Patch &patch) {
+ Patch_setFixedSubdivisions(patch, subdivisions);
+ });
}
-typedef struct _GtkCheckButton GtkCheckButton;
class Subdivisions
{
public:
ui::CheckButton m_enabled;
-GtkEntry* m_horizontal;
-GtkEntry* m_vertical;
-Subdivisions() : m_enabled( (GtkCheckButton *) 0 ), m_horizontal( 0 ), m_vertical( 0 ){
+ui::Entry m_horizontal;
+ui::Entry m_vertical;
+Subdivisions() : m_enabled( ui::null ), m_horizontal( ui::null ), m_vertical( ui::null ){
}
void update(){
PatchFixedSubdivisions subdivisions;
if ( subdivisions.m_enabled ) {
entry_set_int( m_horizontal, static_cast<int>( subdivisions.m_x ) );
entry_set_int( m_vertical, static_cast<int>( subdivisions.m_y ) );
- gtk_widget_set_sensitive( GTK_WIDGET( m_horizontal ), TRUE );
- gtk_widget_set_sensitive( GTK_WIDGET( m_vertical ), TRUE );
+ gtk_widget_set_sensitive( m_horizontal , TRUE );
+ gtk_widget_set_sensitive( m_vertical , TRUE );
}
else
{
- gtk_entry_set_text( m_horizontal, "" );
- gtk_entry_set_text( m_vertical, "" );
- gtk_widget_set_sensitive( GTK_WIDGET( m_horizontal ), FALSE );
- gtk_widget_set_sensitive( GTK_WIDGET( m_vertical ), FALSE );
+ m_horizontal.text("");
+ m_vertical.text("");
+ gtk_widget_set_sensitive( m_horizontal , FALSE );
+ gtk_widget_set_sensitive( m_vertical , FALSE );
}
}
void cancel(){
update();
}
-typedef MemberCaller<Subdivisions, &Subdivisions::cancel> CancelCaller;
+typedef MemberCaller<Subdivisions, void(), &Subdivisions::cancel> CancelCaller;
void apply(){
Scene_PatchSetFixedSubdivisions(
PatchFixedSubdivisions(
)
);
}
-typedef MemberCaller<Subdivisions, &Subdivisions::apply> ApplyCaller;
-static void applyGtk( GtkToggleButton* toggle, Subdivisions* self ){
+typedef MemberCaller<Subdivisions, void(), &Subdivisions::apply> ApplyCaller;
+static void applyGtk( ui::ToggleButton toggle, Subdivisions* self ){
self->apply();
}
};
float m_fVShift; */
int m_nCol;
int m_nRow;
-ui::ComboBoxText m_pRowCombo{nullptr};
-ui::ComboBoxText m_pColCombo{nullptr};
+ui::ComboBoxText m_pRowCombo{ui::null};
+ui::ComboBoxText m_pColCombo{ui::null};
std::size_t m_countRows;
std::size_t m_countCols;
PatchInspector() :
m_horizontalSubdivisionsEntry( Subdivisions::ApplyCaller( m_subdivisions ), Subdivisions::CancelCaller( m_subdivisions ) ),
m_verticalSubdivisionsEntry( Subdivisions::ApplyCaller( m_subdivisions ), Subdivisions::CancelCaller( m_subdivisions ) ),
- m_idleDraw( MemberCaller<PatchInspector, &PatchInspector::GetPatchInfo>( *this ) ){
+ m_idleDraw( MemberCaller<PatchInspector, void(), &PatchInspector::GetPatchInfo>( *this ) ){
m_fS = 0.0f;
m_fT = 0.0f;
m_fX = 0.0f;
}
bool visible(){
- return gtk_widget_get_visible( GetWidget() );
+ return GetWidget().visible();
}
// void UpdateInfo();
g_PatchInspector.importData();
}
-class PatchSetTextureRepeat
-{
-float m_s, m_t;
-public:
-PatchSetTextureRepeat( float s, float t ) : m_s( s ), m_t( t ){
-}
-void operator()( Patch& patch ) const {
- patch.SetTextureRepeat( m_s, m_t );
-}
-};
-
void Scene_PatchTileTexture_Selected( scene::Graph& graph, float s, float t ){
- Scene_forEachVisibleSelectedPatch( PatchSetTextureRepeat( s, t ) );
+ Scene_forEachVisibleSelectedPatch([&](Patch &patch) {
+ patch.SetTextureRepeat(s, t);
+ });
SceneChangeNotify();
}
Patch_FlipTextureY();
}
-struct PatchRotateTexture
-{
- float m_angle;
-public:
- PatchRotateTexture( float angle ) : m_angle( angle ){
- }
- void operator()( Patch& patch ) const {
- patch.RotateTexture( m_angle );
- }
-};
-
void Scene_PatchRotateTexture_Selected( scene::Graph& graph, float angle ){
- Scene_forEachVisibleSelectedPatch( PatchRotateTexture( angle ) );
-}
-
-class PatchScaleTexture
-{
-float m_s, m_t;
-public:
-PatchScaleTexture( float s, float t ) : m_s( s ), m_t( t ){
+ Scene_forEachVisibleSelectedPatch([&](Patch &patch) {
+ patch.RotateTexture(angle);
+ });
}
-void operator()( Patch& patch ) const {
- patch.ScaleTexture( m_s, m_t );
-}
-};
float Patch_convertScale( float scale ){
if ( scale > 0 ) {
}
void Scene_PatchScaleTexture_Selected( scene::Graph& graph, float s, float t ){
- Scene_forEachVisibleSelectedPatch( PatchScaleTexture( Patch_convertScale( s ), Patch_convertScale( t ) ) );
-}
-
-class PatchTranslateTexture
-{
-float m_s, m_t;
-public:
-PatchTranslateTexture( float s, float t )
- : m_s( s ), m_t( t ){
-}
-void operator()( Patch& patch ) const {
- patch.TranslateTexture( m_s, m_t );
+ s = Patch_convertScale(s);
+ t = Patch_convertScale(t);
+ Scene_forEachVisibleSelectedPatch([&](Patch &patch) {
+ patch.ScaleTexture(s, t);
+ });
}
-};
void Scene_PatchTranslateTexture_Selected( scene::Graph& graph, float s, float t ){
- Scene_forEachVisibleSelectedPatch( PatchTranslateTexture( s, t ) );
+ Scene_forEachVisibleSelectedPatch([&](Patch &patch) {
+ patch.TranslateTexture(s, t);
+ });
}
static void OnBtnPatchAutoCap( ui::Widget widget, gpointer data ){
Patch_AutoCapTexture();
}
-static void OnSpinChanged( GtkAdjustment *adj, gpointer data ){
+static void OnSpinChanged(ui::Adjustment adj, gpointer data ){
texdef_t td;
td.rotate = 0;
}
// update the point-by-point view
- OnSelchangeComboColRow( ui::root ,0 );
+ OnSelchangeComboColRow( ui::root, 0 );
}
static gint OnDialogKey( ui::Widget widget, GdkEventKey* event, gpointer data ){
- if ( event->keyval == GDK_Return ) {
+ if ( event->keyval == GDK_KEY_Return ) {
OnApply( ui::root, 0 );
return TRUE;
}
- else if ( event->keyval == GDK_Escape ) {
+ else if ( event->keyval == GDK_KEY_Escape ) {
g_PatchInspector.GetPatchInfo();
return TRUE;
}
{
- GtkVBox* vbox = ui::VBox( FALSE, 5 );
+ auto vbox = ui::VBox( FALSE, 5 );
gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
- gtk_widget_show( GTK_WIDGET( vbox ) );
- gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( vbox ) );
+ vbox.show();
+ window.add(vbox);
{
- GtkHBox* hbox = ui::HBox( FALSE, 5 );
- gtk_widget_show( GTK_WIDGET( hbox ) );
- gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), TRUE, TRUE, 0 );
+ auto hbox = ui::HBox( FALSE, 5 );
+ hbox.show();
+ vbox.pack_start( hbox, TRUE, TRUE, 0 );
{
- GtkVBox* vbox2 = ui::VBox( FALSE, 0 );
+ auto vbox2 = ui::VBox( FALSE, 0 );
gtk_container_set_border_width( GTK_CONTAINER( vbox2 ), 0 );
- gtk_widget_show( GTK_WIDGET( vbox2 ) );
- gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox2 ), TRUE, TRUE, 0 );
+ vbox2.show();
+ hbox.pack_start( vbox2, TRUE, TRUE, 0 );
{
- GtkFrame* frame = ui::Frame( "Details" );
- gtk_widget_show( GTK_WIDGET( frame ) );
- gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
+ auto frame = ui::Frame( "Details" );
+ frame.show();
+ vbox2.pack_start( frame, TRUE, TRUE, 0 );
{
- GtkVBox* vbox3 = ui::VBox( FALSE, 5 );
+ auto vbox3 = ui::VBox( FALSE, 5 );
gtk_container_set_border_width( GTK_CONTAINER( vbox3 ), 5 );
- gtk_widget_show( GTK_WIDGET( vbox3 ) );
- gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( vbox3 ) );
+ vbox3.show();
+ frame.add(vbox3);
{
- GtkTable* table = ui::Table( 2, 2, FALSE );
- gtk_widget_show( GTK_WIDGET( table ) );
- gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
+ auto table = ui::Table( 2, 2, FALSE );
+ table.show();
+ vbox3.pack_start( table, TRUE, TRUE, 0 );
gtk_table_set_row_spacings( table, 5 );
gtk_table_set_col_spacings( table, 5 );
{
- GtkLabel* label = GTK_LABEL( ui::Label( "Row:" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
+ auto label = ui::Label( "Row:" );
+ label.show();
+ table.attach(label, {0, 1, 0, 1}, {(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0)}, {0, 0});
}
{
- GtkLabel* label = GTK_LABEL( ui::Label( "Column:" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 1, 2, 0, 1,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
+ auto label = ui::Label( "Column:" );
+ label.show();
+ table.attach(label, {1, 2, 0, 1}, {(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0)}, {0, 0});
}
{
- auto combo = ui::ComboBoxText();
- g_signal_connect( G_OBJECT( combo ), "changed", G_CALLBACK( OnSelchangeComboColRow ), this );
- AddDialogData( *GTK_COMBO_BOX(combo), m_nRow );
-
- gtk_widget_show( GTK_WIDGET( combo ) );
- gtk_table_attach( table, GTK_WIDGET( combo ), 0, 1, 1, 2,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( combo ), 60, -1 );
+ auto combo = ui::ComboBoxText(ui::New);
+ combo.connect( "changed", G_CALLBACK( OnSelchangeComboColRow ), this );
+ AddDialogData( combo, m_nRow );
+
+ combo.show();
+ table.attach(combo, {0, 1, 1, 2}, {(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0)}, {0, 0});
+ combo.dimensions(60, -1);
m_pRowCombo = combo;
}
{
- auto combo = ui::ComboBoxText();
- g_signal_connect( G_OBJECT( combo ), "changed", G_CALLBACK( OnSelchangeComboColRow ), this );
- AddDialogData( *GTK_COMBO_BOX(combo), m_nCol );
-
- gtk_widget_show( GTK_WIDGET( combo ) );
- gtk_table_attach( table, GTK_WIDGET( combo ), 1, 2, 1, 2,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( combo ), 60, -1 );
+ auto combo = ui::ComboBoxText(ui::New);
+ combo.connect( "changed", G_CALLBACK( OnSelchangeComboColRow ), this );
+ AddDialogData( combo, m_nCol );
+
+ combo.show();
+ table.attach(combo, {1, 2, 1, 2}, {(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0)}, {0, 0});
+ combo.dimensions(60, -1);
m_pColCombo = combo;
}
}
- GtkTable* table = ui::Table( 5, 2, FALSE );
- gtk_widget_show( GTK_WIDGET( table ) );
- gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
+ auto table = ui::Table( 5, 2, FALSE );
+ table.show();
+ vbox3.pack_start( table, TRUE, TRUE, 0 );
gtk_table_set_row_spacings( table, 5 );
gtk_table_set_col_spacings( table, 5 );
{
- GtkLabel* label = GTK_LABEL( ui::Label( "X:" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
+ auto label = ui::Label( "X:" );
+ label.show();
+ table.attach(label, {0, 1, 0, 1}, {GTK_EXPAND | GTK_FILL, 0});
}
{
- GtkLabel* label = GTK_LABEL( ui::Label( "Y:" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
+ auto label = ui::Label( "Y:" );
+ label.show();
+ table.attach(label, {0, 1, 1, 2}, {GTK_EXPAND | GTK_FILL, 0});
}
{
- GtkLabel* label = GTK_LABEL( ui::Label( "Z:" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 2, 3,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
+ auto label = ui::Label( "Z:" );
+ label.show();
+ table.attach(label, {0, 1, 2, 3}, {GTK_EXPAND | GTK_FILL, 0});
}
{
- GtkLabel* label = GTK_LABEL( ui::Label( "S:" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 3, 4,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
+ auto label = ui::Label( "S:" );
+ label.show();
+ table.attach(label, {0, 1, 3, 4}, {GTK_EXPAND | GTK_FILL, 0});
}
{
- GtkLabel* label = GTK_LABEL( ui::Label( "T:" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 4, 5,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
+ auto label = ui::Label( "T:" );
+ label.show();
+ table.attach(label, {0, 1, 4, 5}, {GTK_EXPAND | GTK_FILL, 0});
}
{
- GtkEntry* entry = ui::Entry();
- gtk_widget_show( GTK_WIDGET( entry ) );
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 0, 1,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- AddDialogData( *entry, m_fX );
-
- g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
+ auto entry = ui::Entry(ui::New);
+ entry.show();
+ table.attach(entry, {1, 2, 0, 1}, {GTK_EXPAND | GTK_FILL, 0});
+ AddDialogData( entry, m_fX );
+
+ entry.connect( "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
}
{
- GtkEntry* entry = ui::Entry();
- gtk_widget_show( GTK_WIDGET( entry ) );
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- AddDialogData( *entry, m_fY );
-
- g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
+ auto entry = ui::Entry(ui::New);
+ entry.show();
+ table.attach(entry, {1, 2, 1, 2}, {GTK_EXPAND | GTK_FILL, 0});
+ AddDialogData( entry, m_fY );
+
+ entry.connect( "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
}
{
- GtkEntry* entry = ui::Entry();
- gtk_widget_show( GTK_WIDGET( entry ) );
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 2, 3,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- AddDialogData( *entry, m_fZ );
-
- g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
+ auto entry = ui::Entry(ui::New);
+ entry.show();
+ table.attach(entry, {1, 2, 2, 3}, {GTK_EXPAND | GTK_FILL, 0});
+ AddDialogData( entry, m_fZ );
+
+ entry.connect( "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
}
{
- GtkEntry* entry = ui::Entry();
- gtk_widget_show( GTK_WIDGET( entry ) );
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 3, 4,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- AddDialogData( *entry, m_fS );
-
- g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
+ auto entry = ui::Entry(ui::New);
+ entry.show();
+ table.attach(entry, {1, 2, 3, 4}, {GTK_EXPAND | GTK_FILL, 0});
+ AddDialogData( entry, m_fS );
+
+ entry.connect( "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
}
{
- GtkEntry* entry = ui::Entry();
- gtk_widget_show( GTK_WIDGET( entry ) );
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 4, 5,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- AddDialogData( *entry, m_fT );
-
- g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
+ auto entry = ui::Entry(ui::New);
+ entry.show();
+ table.attach(entry, {1, 2, 4, 5}, {GTK_EXPAND | GTK_FILL, 0});
+ AddDialogData( entry, m_fT );
+
+ entry.connect( "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
}
}
}
if ( g_pGameDescription->mGameType == "doom3" ) {
- GtkFrame* frame = ui::Frame( "Tesselation" );
- gtk_widget_show( GTK_WIDGET( frame ) );
- gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
+ auto frame = ui::Frame( "Tesselation" );
+ frame.show();
+ vbox2.pack_start( frame, TRUE, TRUE, 0 );
{
- GtkVBox* vbox3 = ui::VBox( FALSE, 5 );
+ auto vbox3 = ui::VBox( FALSE, 5 );
gtk_container_set_border_width( GTK_CONTAINER( vbox3 ), 5 );
- gtk_widget_show( GTK_WIDGET( vbox3 ) );
- gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( vbox3 ) );
+ vbox3.show();
+ frame.add(vbox3);
{
- GtkTable* table = ui::Table( 3, 2, FALSE );
- gtk_widget_show( GTK_WIDGET( table ) );
- gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
+ auto table = ui::Table( 3, 2, FALSE );
+ table.show();
+ vbox3.pack_start( table, TRUE, TRUE, 0 );
gtk_table_set_row_spacings( table, 5 );
gtk_table_set_col_spacings( table, 5 );
{
- GtkLabel* label = GTK_LABEL( ui::Label( "Fixed" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
+ auto label = ui::Label( "Fixed" );
+ label.show();
+ table.attach(label, {0, 1, 0, 1}, {GTK_EXPAND | GTK_FILL, 0});
}
{
- auto check = ui::CheckButton(GTK_CHECK_BUTTON( gtk_check_button_new() ));
- gtk_widget_show( GTK_WIDGET( check ) );
- gtk_table_attach( table, GTK_WIDGET( check ), 1, 2, 0, 1,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
+ auto check = ui::CheckButton::from( gtk_check_button_new() );
+ check.show();
+ table.attach(check, {1, 2, 0, 1}, {GTK_EXPAND | GTK_FILL, 0});
m_subdivisions.m_enabled = check;
- guint handler_id = g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( &Subdivisions::applyGtk ), &m_subdivisions );
+ guint handler_id = check.connect( "toggled", G_CALLBACK( &Subdivisions::applyGtk ), &m_subdivisions );
g_object_set_data( G_OBJECT( check ), "handler", gint_to_pointer( handler_id ) );
}
{
- GtkLabel* label = GTK_LABEL( ui::Label( "Horizontal" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
+ auto label = ui::Label( "Horizontal" );
+ label.show();
+ table.attach(label, {0, 1, 1, 2}, {GTK_EXPAND | GTK_FILL, 0});
}
{
- GtkEntry* entry = ui::Entry();
- gtk_widget_show( GTK_WIDGET( entry ) );
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
+ auto entry = ui::Entry(ui::New);
+ entry.show();
+ table.attach(entry, {1, 2, 1, 2}, {GTK_EXPAND | GTK_FILL, 0});
m_subdivisions.m_horizontal = entry;
m_horizontalSubdivisionsEntry.connect( entry );
}
{
- GtkLabel* label = GTK_LABEL( ui::Label( "Vertical" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 2, 3,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
+ auto label = ui::Label( "Vertical" );
+ label.show();
+ table.attach(label, {0, 1, 2, 3}, {GTK_EXPAND | GTK_FILL, 0});
}
{
- GtkEntry* entry = ui::Entry();
- gtk_widget_show( GTK_WIDGET( entry ) );
- gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 2, 3,
- (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
+ auto entry = ui::Entry(ui::New);
+ entry.show();
+ table.attach(entry, {1, 2, 2, 3}, {GTK_EXPAND | GTK_FILL, 0});
m_subdivisions.m_vertical = entry;
m_verticalSubdivisionsEntry.connect( entry );
}
}
}
{
- GtkFrame* frame = ui::Frame( "Texturing" );
- gtk_widget_show( GTK_WIDGET( frame ) );
- gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
+ auto frame = ui::Frame( "Texturing" );
+ frame.show();
+ hbox.pack_start( frame, TRUE, TRUE, 0 );
{
- GtkVBox* vbox2 = ui::VBox( FALSE, 5 );
- gtk_widget_show( GTK_WIDGET( vbox2 ) );
- gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( vbox2 ) );
+ auto vbox2 = ui::VBox( FALSE, 5 );
+ vbox2.show();
+ frame.add(vbox2);
gtk_container_set_border_width( GTK_CONTAINER( vbox2 ), 5 );
{
- GtkLabel* label = GTK_LABEL( ui::Label( "Name:" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( label ), TRUE, TRUE, 0 );
+ auto label = ui::Label( "Name:" );
+ label.show();
+ vbox2.pack_start( label, TRUE, TRUE, 0 );
gtk_label_set_justify( label, GTK_JUSTIFY_LEFT );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
}
{
- GtkEntry* entry = ui::Entry();
+ auto entry = ui::Entry(ui::New);
// gtk_editable_set_editable (GTK_ENTRY (entry), false);
- gtk_widget_show( GTK_WIDGET( entry ) );
- gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( entry ), TRUE, TRUE, 0 );
- AddDialogData( *entry, m_strName );
+ entry.show();
+ vbox2.pack_start( entry, TRUE, TRUE, 0 );
+ AddDialogData( entry, m_strName );
- g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
+ entry.connect( "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
}
{
- GtkTable* table = ui::Table( 5, 4, FALSE );
- gtk_widget_show( GTK_WIDGET( table ) );
- gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
+ auto table = ui::Table( 5, 4, FALSE );
+ table.show();
+ vbox2.pack_start( table, TRUE, TRUE, 0 );
gtk_table_set_row_spacings( table, 5 );
gtk_table_set_col_spacings( table, 5 );
{
- GtkLabel* label = GTK_LABEL( ui::Label( "Horizontal Shift Step" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 2, 4, 0, 1,
- (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
- (GtkAttachOptions)( 0 ), 0, 0 );
+ auto label = ui::Label( "Horizontal Shift Step" );
+ label.show();
+ table.attach(label, {2, 4, 0, 1}, {GTK_FILL | GTK_EXPAND, 0});
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
}
{
- GtkLabel* label = GTK_LABEL( ui::Label( "Vertical Shift Step" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 2, 4, 1, 2,
- (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
- (GtkAttachOptions)( 0 ), 0, 0 );
+ auto label = ui::Label( "Vertical Shift Step" );
+ label.show();
+ table.attach(label, {2, 4, 1, 2}, {GTK_FILL | GTK_EXPAND, 0});
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
}
{
- GtkLabel* label = GTK_LABEL( ui::Label( "Horizontal Stretch Step" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 2, 3, 2, 3,
- (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
- (GtkAttachOptions)( 0 ), 0, 0 );
+ auto label = ui::Label( "Horizontal Stretch Step" );
+ label.show();
+ table.attach(label, {2, 3, 2, 3}, {GTK_FILL | GTK_EXPAND, 0});
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
}
{
- GtkButton* button = ui::Button( "Flip" );
- gtk_widget_show( GTK_WIDGET( button ) );
- gtk_table_attach( table, GTK_WIDGET( button ), 3, 4, 2, 3,
- (GtkAttachOptions)( GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchFlipX ), 0 );
- gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
+ auto button = ui::Button( "Flip" );
+ button.show();
+ table.attach(button, {3, 4, 2, 3}, {GTK_FILL, 0});
+ button.connect( "clicked", G_CALLBACK( OnBtnPatchFlipX ), 0 );
+ button.dimensions(60, -1);
}
{
- GtkLabel* label = GTK_LABEL( ui::Label( "Vertical Stretch Step" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 2, 3, 3, 4,
- (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
- (GtkAttachOptions)( 0 ), 0, 0 );
+ auto label = ui::Label( "Vertical Stretch Step" );
+ label.show();
+ table.attach(label, {2, 3, 3, 4}, {GTK_FILL | GTK_EXPAND, 0});
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
}
{
- GtkButton* button = ui::Button( "Flip" );
- gtk_widget_show( GTK_WIDGET( button ) );
- gtk_table_attach( table, GTK_WIDGET( button ), 3, 4, 3, 4,
- (GtkAttachOptions)( GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchFlipY ), 0 );
- gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
+ auto button = ui::Button( "Flip" );
+ button.show();
+ table.attach(button, {3, 4, 3, 4}, {GTK_FILL, 0});
+ button.connect( "clicked", G_CALLBACK( OnBtnPatchFlipY ), 0 );
+ button.dimensions(60, -1);
}
{
- GtkLabel* label = GTK_LABEL( ui::Label( "Rotate Step" ) );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach( table, GTK_WIDGET( label ), 2, 4, 4, 5,
- (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
- (GtkAttachOptions)( 0 ), 0, 0 );
+ auto label = ui::Label( "Rotate Step" );
+ label.show();
+ table.attach(label, {2, 4, 4, 5}, {GTK_FILL | GTK_EXPAND, 0});
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
}
{
- GtkEntry* entry = ui::Entry();
- gtk_widget_show( GTK_WIDGET( entry ) );
- gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 0, 1,
- (GtkAttachOptions)( GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
- g_object_set_data( G_OBJECT( window ), "hshift_entry", entry );
+ auto entry = ui::Entry(ui::New);
+ entry.show();
+ table.attach(entry, {0, 1, 0, 1}, {GTK_FILL, 0});
+ entry.dimensions(50, -1);
+ g_object_set_data( G_OBJECT( window ), "hshift_entry", (void *) entry );
// we fill in this data, if no patch is selected the widgets are unmodified when the inspector is raised
// so we need to have at least one initialisation somewhere
entry_set_float( entry, g_pi_globals.shift[0] );
auto adj = ui::Adjustment( 0, -8192, 8192, 1, 1, 0 );
- g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), (gpointer) entry );
+ adj.connect( "value_changed", G_CALLBACK( OnSpinChanged ), (gpointer) entry );
g_object_set_data( G_OBJECT( window ), "hshift_adj", (gpointer) adj );
auto spin = ui::SpinButton( adj, 1, 0 );
- gtk_widget_show( GTK_WIDGET( spin ) );
- gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 0, 1,
- (GtkAttachOptions)( 0 ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 10, -1 );
+ spin.show();
+ table.attach(spin, {1, 2, 0, 1}, {0, 0});
+ spin.dimensions(10, -1);
gtk_widget_set_can_focus( spin, false );
}
{
- GtkEntry* entry = ui::Entry();
- gtk_widget_show( GTK_WIDGET( entry ) );
- gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 1, 2,
- (GtkAttachOptions)( GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
+ auto entry = ui::Entry(ui::New);
+ entry.show();
+ table.attach(entry, {0, 1, 1, 2}, {GTK_FILL, 0});
+ entry.dimensions(50, -1);
entry_set_float( entry, g_pi_globals.shift[1] );
auto adj = ui::Adjustment( 0, -8192, 8192, 1, 1, 0 );
- g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
+ adj.connect( "value_changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( window ), "vshift_adj", (gpointer) adj );
auto spin = ui::SpinButton( adj, 1, 0 );
- gtk_widget_show( GTK_WIDGET( spin ) );
- gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 1, 2,
- (GtkAttachOptions)( 0 ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 10, -1 );
+ spin.show();
+ table.attach(spin, {1, 2, 1, 2}, {0, 0});
+ spin.dimensions(10, -1);
gtk_widget_set_can_focus( spin, false );
}
{
- GtkEntry* entry = ui::Entry();
- gtk_widget_show( GTK_WIDGET( entry ) );
- gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 2, 3,
- (GtkAttachOptions)( GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
+ auto entry = ui::Entry(ui::New);
+ entry.show();
+ table.attach(entry, {0, 1, 2, 3}, {GTK_FILL, 0});
+ entry.dimensions(50, -1);
entry_set_float( entry, g_pi_globals.scale[0] );
auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 );
- g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
+ adj.connect( "value_changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( window ), "hscale_adj", (gpointer) adj );
auto spin = ui::SpinButton( adj, 1, 0 );
- gtk_widget_show( GTK_WIDGET( spin ) );
- gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 2, 3,
- (GtkAttachOptions)( 0 ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 10, -1 );
+ spin.show();
+ table.attach(spin, {1, 2, 2, 3}, {0, 0});
+ spin.dimensions(10, -1);
gtk_widget_set_can_focus( spin, false );
}
{
- GtkEntry* entry = ui::Entry();
- gtk_widget_show( GTK_WIDGET( entry ) );
- gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 3, 4,
- (GtkAttachOptions)( GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
+ auto entry = ui::Entry(ui::New);
+ entry.show();
+ table.attach(entry, {0, 1, 3, 4}, {GTK_FILL, 0});
+ entry.dimensions(50, -1);
entry_set_float( entry, g_pi_globals.scale[1] );
auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 );
- g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
+ adj.connect( "value_changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( window ), "vscale_adj", (gpointer) adj );
auto spin = ui::SpinButton( adj, 1, 0 );
- gtk_widget_show( GTK_WIDGET( spin ) );
- gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 3, 4,
- (GtkAttachOptions)( 0 ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 10, -1 );
+ spin.show();
+ table.attach(spin, {1, 2, 3, 4}, {0, 0});
+ spin.dimensions(10, -1);
gtk_widget_set_can_focus( spin, false );
}
{
- GtkEntry* entry = ui::Entry();
- gtk_widget_show( GTK_WIDGET( entry ) );
- gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 4, 5,
- (GtkAttachOptions)( GTK_FILL ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
+ auto entry = ui::Entry(ui::New);
+ entry.show();
+ table.attach(entry, {0, 1, 4, 5}, {GTK_FILL, 0});
+ entry.dimensions(50, -1);
entry_set_float( entry, g_pi_globals.rotate );
auto 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 );
+ adj.connect( "value_changed", G_CALLBACK( OnSpinChanged ), entry );
g_object_set_data( G_OBJECT( window ), "rotate_adj", (gpointer) adj );
auto spin = ui::SpinButton( adj, 1, 0 );
- gtk_widget_show( GTK_WIDGET( spin ) );
- gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 4, 5,
- (GtkAttachOptions)( 0 ),
- (GtkAttachOptions)( 0 ), 0, 0 );
- gtk_widget_set_size_request( GTK_WIDGET( spin ), 10, -1 );
+ spin.show();
+ table.attach(spin, {1, 2, 4, 5}, {0, 0});
+ spin.dimensions(10, -1);
gtk_widget_set_can_focus( spin, false );
}
}
- GtkHBox* hbox2 = ui::HBox( TRUE, 5 );
- gtk_widget_show( GTK_WIDGET( hbox2 ) );
- gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( hbox2 ), TRUE, FALSE, 0 );
+ auto hbox2 = ui::HBox( TRUE, 5 );
+ hbox2.show();
+ vbox2.pack_start( hbox2, TRUE, FALSE, 0 );
{
- GtkButton* button = ui::Button( "Auto Cap" );
- gtk_widget_show( GTK_WIDGET( button ) );
- gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchAutoCap ), 0 );
- gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
+ auto button = ui::Button( "Auto Cap" );
+ button.show();
+ hbox2.pack_end(button, TRUE, FALSE, 0);
+ button.connect( "clicked", G_CALLBACK( OnBtnPatchAutoCap ), 0 );
+ button.dimensions(60, -1);
}
{
- GtkButton* button = ui::Button( "CAP" );
- gtk_widget_show( GTK_WIDGET( button ) );
- gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchdetails ), 0 );
- gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
+ auto button = ui::Button( "CAP" );
+ button.show();
+ hbox2.pack_end(button, TRUE, FALSE, 0);
+ button.connect( "clicked", G_CALLBACK( OnBtnPatchdetails ), 0 );
+ button.dimensions(60, -1);
}
{
- GtkButton* button = ui::Button( "Set..." );
- gtk_widget_show( GTK_WIDGET( button ) );
- gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchreset ), 0 );
- gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
+ auto button = ui::Button( "Set..." );
+ button.show();
+ hbox2.pack_end(button, TRUE, FALSE, 0);
+ button.connect( "clicked", G_CALLBACK( OnBtnPatchreset ), 0 );
+ button.dimensions(60, -1);
}
{
- GtkButton* button = ui::Button( "Natural" );
- gtk_widget_show( GTK_WIDGET( button ) );
- gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchnatural ), 0 );
- gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
+ auto button = ui::Button( "Natural" );
+ button.show();
+ hbox2.pack_end(button, TRUE, FALSE, 0);
+ button.connect( "clicked", G_CALLBACK( OnBtnPatchnatural ), 0 );
+ button.dimensions(60, -1);
}
{
- GtkButton* button = ui::Button( "Fit" );
- gtk_widget_show( GTK_WIDGET( button ) );
- gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
- g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchfit ), 0 );
- gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
+ auto button = ui::Button( "Fit" );
+ button.show();
+ hbox2.pack_end(button, TRUE, FALSE, 0);
+ button.connect( "clicked", G_CALLBACK( OnBtnPatchfit ), 0 );
+ button.dimensions(60, -1);
}
}
}
void PatchInspector_Construct(){
- GlobalCommands_insert( "PatchInspector", FreeCaller<PatchInspector_toggleShown>(), Accelerator( 'S', (GdkModifierType)GDK_SHIFT_MASK ) );
+ GlobalCommands_insert( "PatchInspector", makeCallbackF(PatchInspector_toggleShown), Accelerator( 'S', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalPreferenceSystem().registerPreference( "PatchWnd", WindowPositionTrackerImportStringCaller( g_PatchInspector.m_position_tracker ), WindowPositionTrackerExportStringCaller( g_PatchInspector.m_position_tracker ) );
- GlobalPreferenceSystem().registerPreference( "SI_PatchTexdef_Scale1", FloatImportStringCaller( g_pi_globals.scale[0] ), FloatExportStringCaller( g_pi_globals.scale[0] ) );
- GlobalPreferenceSystem().registerPreference( "SI_PatchTexdef_Scale2", FloatImportStringCaller( g_pi_globals.scale[1] ), FloatExportStringCaller( g_pi_globals.scale[1] ) );
- GlobalPreferenceSystem().registerPreference( "SI_PatchTexdef_Shift1", FloatImportStringCaller( g_pi_globals.shift[0] ), FloatExportStringCaller( g_pi_globals.shift[0] ) );
- GlobalPreferenceSystem().registerPreference( "SI_PatchTexdef_Shift2", FloatImportStringCaller( g_pi_globals.shift[1] ), FloatExportStringCaller( g_pi_globals.shift[1] ) );
- GlobalPreferenceSystem().registerPreference( "SI_PatchTexdef_Rotate", FloatImportStringCaller( g_pi_globals.rotate ), FloatExportStringCaller( g_pi_globals.rotate ) );
+ GlobalPreferenceSystem().registerPreference( "PatchWnd", make_property<WindowPositionTracker_String>( g_PatchInspector.m_position_tracker ) );
+ GlobalPreferenceSystem().registerPreference( "SI_PatchTexdef_Scale1", make_property_string( g_pi_globals.scale[0] ) );
+ GlobalPreferenceSystem().registerPreference( "SI_PatchTexdef_Scale2", make_property_string( g_pi_globals.scale[1] ) );
+ GlobalPreferenceSystem().registerPreference( "SI_PatchTexdef_Shift1", make_property_string( g_pi_globals.shift[0] ) );
+ GlobalPreferenceSystem().registerPreference( "SI_PatchTexdef_Shift2", make_property_string( g_pi_globals.shift[1] ) );
+ GlobalPreferenceSystem().registerPreference( "SI_PatchTexdef_Rotate", make_property_string( g_pi_globals.rotate ) );
- typedef FreeCaller1<const Selectable&, PatchInspector_SelectionChanged> PatchInspectorSelectionChangedCaller;
+ typedef FreeCaller<void(const Selectable&), PatchInspector_SelectionChanged> PatchInspectorSelectionChangedCaller;
GlobalSelectionSystem().addSelectionChangeCallback( PatchInspectorSelectionChangedCaller() );
- typedef FreeCaller<PatchInspector_queueDraw> PatchInspectorQueueDrawCaller;
+ typedef FreeCaller<void(), PatchInspector_queueDraw> PatchInspectorQueueDrawCaller;
Patch_addTextureChangedCallback( PatchInspectorQueueDrawCaller() );
}
void PatchInspector_Destroy(){