#include "image.h"
-void toolbar_append( GtkToolbar* toolbar, GtkToolItem* button, const char* description ){
+void toolbar_append( ui::Toolbar toolbar, GtkToolItem* button, const char* description ){
gtk_widget_show_all(GTK_WIDGET(button));
gtk_widget_set_tooltip_text(GTK_WIDGET(button), description);
gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(button));
}
-ui::ToolButton toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback ){
+ui::ToolButton toolbar_append_button( ui::Toolbar toolbar, const char* description, const char* icon, const Callback& callback ){
auto button = ui::ToolButton(GTK_TOOL_BUTTON(gtk_tool_button_new(GTK_WIDGET(new_local_image(icon)), nullptr)));
button_connect_callback(button, callback);
toolbar_append(toolbar, GTK_TOOL_ITEM(button), description);
return button;
}
-ui::ToggleToolButton toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback ){
+ui::ToggleToolButton toolbar_append_toggle_button( ui::Toolbar toolbar, const char* description, const char* icon, const Callback& callback ){
auto button = ui::ToggleToolButton(GTK_TOGGLE_TOOL_BUTTON(gtk_toggle_tool_button_new()));
toggle_button_connect_callback(button, callback);
gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(button), GTK_WIDGET(new_local_image(icon)));
return button;
}
-ui::ToolButton toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Command& command ){
+ui::ToolButton toolbar_append_button( ui::Toolbar toolbar, const char* description, const char* icon, const Command& command ){
return toolbar_append_button( toolbar, description, icon, command.m_callback );
}
}
using ToggleButtonSetActiveCaller = ReferenceCaller1<GtkToggleToolButton, bool, toggle_button_set_active_callback>;
-ui::ToggleToolButton toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Toggle& toggle ){
+ui::ToggleToolButton toolbar_append_toggle_button( ui::Toolbar toolbar, const char* description, const char* icon, const Toggle& toggle ){
auto button = toolbar_append_toggle_button( toolbar, description, icon, toggle.m_command.m_callback );
GtkToggleToolButton *button_ = button;
toggle.m_exportCallback( ToggleButtonSetActiveCaller( *button_ ) );
#include <uilib/uilib.h>
#include "generic/callbackfwd.h"
-typedef struct _GtkButton GtkButton;
-typedef struct _GtkToggleButton GtkToggleButton;
-typedef struct _GtkToolbar GtkToolbar;
class Command;
class Toggle;
-ui::ToolButton toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback );
-ui::ToolButton toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Command& command );
-ui::ToggleToolButton toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback );
-ui::ToggleToolButton toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Toggle& toggle );
+ui::ToolButton toolbar_append_button( ui::Toolbar toolbar, const char* description, const char* icon, const Callback& callback );
+ui::ToolButton toolbar_append_button( ui::Toolbar toolbar, const char* description, const char* icon, const Command& command );
+ui::ToggleToolButton toolbar_append_toggle_button( ui::Toolbar toolbar, const char* description, const char* icon, const Callback& callback );
+ui::ToggleToolButton toolbar_append_toggle_button( ui::Toolbar toolbar, const char* description, const char* icon, const Toggle& toggle );
#endif
struct _GtkTextView;
struct _GtkToggleButton;
struct _GtkToggleToolButton;
+struct _GtkToolbar;
struct _GtkToolButton;
struct _GtkToolItem;
struct _GtkTreeModel;
,
);
+ WRAP(Toolbar, Widget, _GtkToolbar, (),
+ ,
+ );
+
class TreeModel;
WRAP(TreeView, Widget, _GtkTreeView, (),
TreeView();
}
-void CamWnd_constructToolbar( GtkToolbar* toolbar ){
+void CamWnd_constructToolbar( ui::Toolbar toolbar ){
toolbar_append_toggle_button( toolbar, "Cubic clip the camera view (\\)", "view_cubicclipping.png", "ToggleCubicClip" );
}
void fill_view_camera_menu( ui::Menu menu );
typedef struct _GtkToolbar GtkToolbar;
-void CamWnd_constructToolbar( GtkToolbar* toolbar );
+void CamWnd_constructToolbar( ui::Toolbar toolbar );
void CamWnd_registerShortcuts();
void GlobalCamera_Benchmark();
return create_menu_item_with_mnemonic( menu, mnemonic, command );
}
-GtkToolButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName ){
+ui::ToolButton toolbar_append_button( ui::Toolbar toolbar, const char* description, const char* icon, const char* commandName ){
return toolbar_append_button( toolbar, description, icon, GlobalCommands_find( commandName ) );
}
-GtkToggleToolButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName ){
+ui::ToggleToolButton toolbar_append_toggle_button( ui::Toolbar toolbar, const char* description, const char* icon, const char* commandName ){
return toolbar_append_toggle_button( toolbar, description, icon, GlobalToggles_find( commandName ) );
}
typedef struct _GtkToolbar GtkToolbar;
// this DOES NOT set up the shortcut using command_connect_accelerator
-GtkToolButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName );
+ui::ToolButton toolbar_append_button( ui::Toolbar toolbar, const char* description, const char* icon, const char* commandName );
// this DOES NOT set up the shortcut using command_connect_accelerator
-GtkToggleToolButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName );
+ui::ToggleToolButton toolbar_append_toggle_button( ui::Toolbar toolbar, const char* description, const char* icon, const char* commandName );
template<typename Element> class BasicVector3;
SelectByType_registerShortcuts();
}
-void File_constructToolbar( GtkToolbar* toolbar ){
+void File_constructToolbar( ui::Toolbar toolbar ){
toolbar_append_button( toolbar, "Open an existing map (CTRL + O)", "file_open.png", "OpenMap" );
toolbar_append_button( toolbar, "Save the active map (CTRL + S)", "file_save.png", "SaveMap" );
}
-void UndoRedo_constructToolbar( GtkToolbar* toolbar ){
+void UndoRedo_constructToolbar( ui::Toolbar toolbar ){
toolbar_append_button( toolbar, "Undo (CTRL + Z)", "undo.png", "Undo" );
toolbar_append_button( toolbar, "Redo (CTRL + Y)", "redo.png", "Redo" );
}
-void RotateFlip_constructToolbar( GtkToolbar* toolbar ){
+void RotateFlip_constructToolbar( ui::Toolbar toolbar ){
toolbar_append_button( toolbar, "x-axis Flip", "brush_flipx.png", "MirrorSelectionX" );
toolbar_append_button( toolbar, "x-axis Rotate", "brush_rotatex.png", "RotateSelectionX" );
toolbar_append_button( toolbar, "y-axis Flip", "brush_flipy.png", "MirrorSelectionY" );
toolbar_append_button( toolbar, "z-axis Rotate", "brush_rotatez.png", "RotateSelectionZ" );
}
-void Select_constructToolbar( GtkToolbar* toolbar ){
+void Select_constructToolbar( ui::Toolbar toolbar ){
toolbar_append_button( toolbar, "Select touching", "selection_selecttouching.png", "SelectTouching" );
toolbar_append_button( toolbar, "Select inside", "selection_selectinside.png", "SelectInside" );
}
-void CSG_constructToolbar( GtkToolbar* toolbar ){
+void CSG_constructToolbar( ui::Toolbar toolbar ){
toolbar_append_button( toolbar, "CSG Subtract (SHIFT + U)", "selection_csgsubtract.png", "CSGSubtract" );
toolbar_append_button( toolbar, "CSG Merge (CTRL + U)", "selection_csgmerge.png", "CSGMerge" );
toolbar_append_button( toolbar, "Hollow", "selection_makehollow.png", "CSGHollow" );
}
-void ComponentModes_constructToolbar( GtkToolbar* toolbar ){
+void ComponentModes_constructToolbar( ui::Toolbar toolbar ){
toolbar_append_toggle_button( toolbar, "Select Vertices (V)", "modify_vertices.png", "DragVertices" );
toolbar_append_toggle_button( toolbar, "Select Edges (E)", "modify_edges.png", "DragEdges" );
toolbar_append_toggle_button( toolbar, "Select Faces (F)", "modify_faces.png", "DragFaces" );
}
-void Clipper_constructToolbar( GtkToolbar* toolbar ){
+void Clipper_constructToolbar( ui::Toolbar toolbar ){
toolbar_append_toggle_button( toolbar, "Clipper (X)", "view_clipper.png", "ToggleClipper" );
}
-void XYWnd_constructToolbar( GtkToolbar* toolbar ){
+void XYWnd_constructToolbar( ui::Toolbar toolbar ){
toolbar_append_button( toolbar, "Change views", "view_change.png", "NextView" );
}
-void Manipulators_constructToolbar( GtkToolbar* toolbar ){
+void Manipulators_constructToolbar( ui::Toolbar toolbar ){
toolbar_append_toggle_button( toolbar, "Translate (W)", "select_mousetranslate.png", "MouseTranslate" );
toolbar_append_toggle_button( toolbar, "Rotate (R)", "select_mouserotate.png", "MouseRotate" );
toolbar_append_toggle_button( toolbar, "Scale", "select_mousescale.png", "MouseScale" );
Clipper_constructToolbar( toolbar );
}
-GtkToolbar* create_main_toolbar( MainFrame::EViewStyle style ){
- GtkToolbar* toolbar = GTK_TOOLBAR( gtk_toolbar_new() );
+ui::Toolbar create_main_toolbar( MainFrame::EViewStyle style ){
+ auto toolbar = ui::Toolbar(GTK_TOOLBAR( gtk_toolbar_new() ));
gtk_orientable_set_orientation( GTK_ORIENTABLE(toolbar), GTK_ORIENTATION_HORIZONTAL );
gtk_toolbar_set_style( toolbar, GTK_TOOLBAR_ICONS );
GlobalCommands_insert( "ClearPatchOverlays", FreeCaller<Patch_OverlayOff>(), Accelerator( 'L', (GdkModifierType)GDK_CONTROL_MASK ) );
}
-void Patch_constructToolbar( GtkToolbar* toolbar ){
+void Patch_constructToolbar( ui::Toolbar toolbar ){
toolbar_append_button( toolbar, "Put caps on the current patch (SHIFT + C)", "cap_curve.png", "CapCurrentCurve" );
}
#include "string/stringfwd.h"
void Patch_registerCommands();
-typedef struct _GtkToolbar GtkToolbar;
-typedef struct _GtkMenu GtkMenu;
-void Patch_constructToolbar( GtkToolbar* toolbar );
+void Patch_constructToolbar( ui::Toolbar toolbar );
void Patch_constructMenu( ui::Menu menu );
namespace scene