- GlobalCommands_insert("InvertCurveTextureX", FreeCaller<Patch_FlipTextureX>(), Accelerator('I', (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK)));
- GlobalCommands_insert("InvertCurveTextureY", FreeCaller<Patch_FlipTextureY>(), Accelerator('I', (GdkModifierType)GDK_SHIFT_MASK));
- GlobalCommands_insert("IncPatchColumn", FreeCaller<Patch_InsertInsertColumn>(), Accelerator(GDK_KP_Add, (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK)));
- GlobalCommands_insert("IncPatchRow", FreeCaller<Patch_InsertInsertRow>(), Accelerator(GDK_KP_Add, (GdkModifierType)GDK_CONTROL_MASK));
- GlobalCommands_insert("DecPatchColumn", FreeCaller<Patch_DeleteLastColumn>(), Accelerator(GDK_KP_Subtract, (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK)));
- GlobalCommands_insert("DecPatchRow", FreeCaller<Patch_DeleteLastRow>(), Accelerator(GDK_KP_Subtract, (GdkModifierType)GDK_CONTROL_MASK));
- GlobalCommands_insert("NaturalizePatch", FreeCaller<Patch_NaturalTexture>(), Accelerator('N', (GdkModifierType)GDK_CONTROL_MASK));
- GlobalCommands_insert("PatchCylinder", FreeCaller<Patch_Cylinder>());
- GlobalCommands_insert("PatchDenseCylinder", FreeCaller<Patch_DenseCylinder>());
- GlobalCommands_insert("PatchVeryDenseCylinder", FreeCaller<Patch_VeryDenseCylinder>());
- GlobalCommands_insert("PatchSquareCylinder", FreeCaller<Patch_SquareCylinder>());
- GlobalCommands_insert("PatchXactCylinder", FreeCaller<Patch_XactCylinder>());
- GlobalCommands_insert("PatchXactSphere", FreeCaller<Patch_XactSphere>());
- GlobalCommands_insert("PatchXactCone", FreeCaller<Patch_XactCone>());
- GlobalCommands_insert("PatchEndCap", FreeCaller<Patch_Endcap>());
- GlobalCommands_insert("PatchBevel", FreeCaller<Patch_Bevel>());
- GlobalCommands_insert("PatchSquareBevel", FreeCaller<Patch_SquareBevel>());
- GlobalCommands_insert("PatchSquareEndcap", FreeCaller<Patch_SquareEndcap>());
- GlobalCommands_insert("PatchCone", FreeCaller<Patch_Cone>());
- GlobalCommands_insert("PatchSphere", FreeCaller<Patch_Sphere>());
- GlobalCommands_insert("SimplePatchMesh", FreeCaller<Patch_Plane>(), Accelerator('P', (GdkModifierType)GDK_SHIFT_MASK));
- GlobalCommands_insert("PatchInsertInsertColumn", FreeCaller<Patch_InsertInsertColumn>());
- GlobalCommands_insert("PatchInsertAddColumn", FreeCaller<Patch_InsertAddColumn>());
- GlobalCommands_insert("PatchInsertInsertRow", FreeCaller<Patch_InsertInsertRow>());
- GlobalCommands_insert("PatchInsertAddRow", FreeCaller<Patch_InsertAddRow>());
- GlobalCommands_insert("PatchDeleteFirstColumn", FreeCaller<Patch_DeleteFirstColumn>());
- GlobalCommands_insert("PatchDeleteLastColumn", FreeCaller<Patch_DeleteLastColumn>());
- GlobalCommands_insert("PatchDeleteFirstRow", FreeCaller<Patch_DeleteFirstRow>());
- GlobalCommands_insert("PatchDeleteLastRow", FreeCaller<Patch_DeleteLastRow>());
- GlobalCommands_insert("InvertCurve", FreeCaller<Patch_Invert>(), Accelerator('I', (GdkModifierType)GDK_CONTROL_MASK));
- GlobalCommands_insert("RedisperseRows", FreeCaller<Patch_RedisperseRows>(), Accelerator('E', (GdkModifierType)GDK_CONTROL_MASK));
- GlobalCommands_insert("RedisperseCols", FreeCaller<Patch_RedisperseCols>(), Accelerator('E', (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK)));
- GlobalCommands_insert("SmoothRows", FreeCaller<Patch_SmoothRows>(), Accelerator('W', (GdkModifierType)GDK_CONTROL_MASK));
- GlobalCommands_insert("SmoothCols", FreeCaller<Patch_SmoothCols>(), Accelerator('W', (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK)));
- GlobalCommands_insert("MatrixTranspose", FreeCaller<Patch_Transpose>(), Accelerator('M', (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK)));
- GlobalCommands_insert("CapCurrentCurve", FreeCaller<Patch_Cap>(), Accelerator('C', (GdkModifierType)GDK_SHIFT_MASK));
- GlobalCommands_insert("CycleCapTexturePatch", FreeCaller<Patch_CycleProjection>(), Accelerator('N', (GdkModifierType)(GDK_SHIFT_MASK|GDK_CONTROL_MASK)));
- GlobalCommands_insert("MakeOverlayPatch", FreeCaller<Patch_OverlayOn>(), Accelerator('Y'));
- GlobalCommands_insert("ClearPatchOverlays", FreeCaller<Patch_OverlayOff>(), Accelerator('L', (GdkModifierType)GDK_CONTROL_MASK));
-}
-
-void Patch_constructToolbar(GtkToolbar* toolbar)
-{
- toolbar_append_button(toolbar, "Put caps on the current patch (SHIFT + C)", "curve_cap.bmp", "CapCurrentCurve");
-}
-
-void Patch_constructMenu(GtkMenu* menu)
-{
- create_menu_item_with_mnemonic(menu, "Cylinder", "PatchCylinder");
- {
- GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "More Cylinders");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu_in_menu);
- create_menu_item_with_mnemonic(menu_in_menu, "Dense Cylinder", "PatchDenseCylinder");
- create_menu_item_with_mnemonic(menu_in_menu, "Very Dense Cylinder", "PatchVeryDenseCylinder");
- create_menu_item_with_mnemonic(menu_in_menu, "Square Cylinder", "PatchSquareCylinder");
- create_menu_item_with_mnemonic(menu_in_menu, "Exact Cylinder...", "PatchXactCylinder");
- }
- menu_separator (menu);
- create_menu_item_with_mnemonic(menu, "End cap", "PatchEndCap");
- create_menu_item_with_mnemonic(menu, "Bevel", "PatchBevel");
- {
- GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "More End caps, Bevels");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu_in_menu);
- create_menu_item_with_mnemonic(menu_in_menu, "Square Endcap", "PatchSquareBevel");
- create_menu_item_with_mnemonic(menu_in_menu, "Square Bevel", "PatchSquareEndcap");
- }
- menu_separator (menu);
- create_menu_item_with_mnemonic(menu, "Cone", "PatchCone");
- create_menu_item_with_mnemonic(menu, "Exact Cone...", "PatchXactCone");
- menu_separator (menu);
- create_menu_item_with_mnemonic(menu, "Sphere", "PatchSphere");
- create_menu_item_with_mnemonic(menu, "Exact Sphere...", "PatchXactSphere");
- menu_separator (menu);
- create_menu_item_with_mnemonic(menu, "Simple Patch Mesh...", "SimplePatchMesh");
- menu_separator (menu);
- {
- GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Insert");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu_in_menu);
- create_menu_item_with_mnemonic(menu_in_menu, "Insert (2) Columns", "PatchInsertInsertColumn");
- create_menu_item_with_mnemonic(menu_in_menu, "Add (2) Columns", "PatchInsertAddColumn");
- menu_separator (menu_in_menu);
- create_menu_item_with_mnemonic(menu_in_menu, "Insert (2) Rows", "PatchInsertInsertRow");
- create_menu_item_with_mnemonic(menu_in_menu, "Add (2) Rows", "PatchInsertAddRow");
- }
- {
- GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Delete");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu_in_menu);
- create_menu_item_with_mnemonic(menu_in_menu, "First (2) Columns", "PatchDeleteFirstColumn");
- create_menu_item_with_mnemonic(menu_in_menu, "Last (2) Columns", "PatchDeleteLastColumn");
- menu_separator (menu_in_menu);
- create_menu_item_with_mnemonic(menu_in_menu, "First (2) Rows", "PatchDeleteFirstRow");
- create_menu_item_with_mnemonic(menu_in_menu, "Last (2) Rows", "PatchDeleteLastRow");
- }
- menu_separator (menu);
- {
- GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Matrix");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu_in_menu);
- create_menu_item_with_mnemonic(menu_in_menu, "Invert", "InvertCurve");
- GtkMenu* menu_3 = create_sub_menu_with_mnemonic (menu_in_menu, "Re-disperse");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu_3);
- create_menu_item_with_mnemonic(menu_3, "Rows", "RedisperseRows");
- create_menu_item_with_mnemonic(menu_3, "Columns", "RedisperseCols");
- GtkMenu* menu_4 = create_sub_menu_with_mnemonic (menu_in_menu, "Smooth");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu_4);
- create_menu_item_with_mnemonic(menu_4, "Rows", "SmoothRows");
- create_menu_item_with_mnemonic(menu_4, "Columns", "SmoothCols");
- create_menu_item_with_mnemonic(menu_in_menu, "Transpose", "MatrixTranspose");
- }
- menu_separator (menu);
- create_menu_item_with_mnemonic(menu, "Cap Selection", "CapCurrentCurve");
- create_menu_item_with_mnemonic(menu, "Cycle Cap Texture", "CycleCapTexturePatch");
- menu_separator (menu);
- {
- GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic (menu, "Overlay");
- if (g_Layout_enableDetachableMenus.m_value)
- menu_tearoff (menu_in_menu);
- create_menu_item_with_mnemonic(menu_in_menu, "Set", "MakeOverlayPatch");
- create_menu_item_with_mnemonic(menu_in_menu, "Clear", "ClearPatchOverlays");
- }
-}
-
-
-#include <gtk/gtkbox.h>
-#include <gtk/gtktable.h>
-#include <gtk/gtktogglebutton.h>
-#include <gtk/gtkradiobutton.h>
-#include <gtk/gtkcombobox.h>
-#include <gtk/gtklabel.h>
+ GlobalCommands_insert("InvertCurveTextureX", makeCallbackF(Patch_FlipTextureX),
+ Accelerator('I', (GdkModifierType) (GDK_SHIFT_MASK | GDK_CONTROL_MASK)));
+ GlobalCommands_insert("InvertCurveTextureY", makeCallbackF(Patch_FlipTextureY),
+ Accelerator('I', (GdkModifierType) GDK_SHIFT_MASK));
+ GlobalCommands_insert("NaturalizePatch", makeCallbackF(Patch_NaturalTexture),
+ Accelerator('N', (GdkModifierType) GDK_CONTROL_MASK));
+ GlobalCommands_insert("PatchCylinder", makeCallbackF(Patch_Cylinder));
+ GlobalCommands_insert("PatchDenseCylinder", makeCallbackF(Patch_DenseCylinder));
+ GlobalCommands_insert("PatchVeryDenseCylinder", makeCallbackF(Patch_VeryDenseCylinder));
+ GlobalCommands_insert("PatchSquareCylinder", makeCallbackF(Patch_SquareCylinder));
+ GlobalCommands_insert("PatchXactCylinder", makeCallbackF(Patch_XactCylinder));
+ GlobalCommands_insert("PatchXactSphere", makeCallbackF(Patch_XactSphere));
+ GlobalCommands_insert("PatchXactCone", makeCallbackF(Patch_XactCone));
+ GlobalCommands_insert("PatchEndCap", makeCallbackF(Patch_Endcap));
+ GlobalCommands_insert("PatchBevel", makeCallbackF(Patch_Bevel));
+ GlobalCommands_insert("PatchSquareBevel", makeCallbackF(Patch_SquareBevel));
+ GlobalCommands_insert("PatchSquareEndcap", makeCallbackF(Patch_SquareEndcap));
+ GlobalCommands_insert("PatchCone", makeCallbackF(Patch_Cone));
+ GlobalCommands_insert("PatchSphere", makeCallbackF(Patch_Sphere));
+ GlobalCommands_insert("SimplePatchMesh", makeCallbackF(Patch_Plane),
+ Accelerator('P', (GdkModifierType) GDK_SHIFT_MASK));
+ GlobalCommands_insert("PatchInsertInsertColumn", makeCallbackF(Patch_InsertInsertColumn),
+ Accelerator(GDK_KEY_KP_Add, (GdkModifierType) (GDK_SHIFT_MASK | GDK_CONTROL_MASK)));
+ GlobalCommands_insert("PatchInsertAddColumn", makeCallbackF(Patch_InsertAddColumn));
+ GlobalCommands_insert("PatchInsertInsertRow", makeCallbackF(Patch_InsertInsertRow),
+ Accelerator(GDK_KEY_KP_Add, (GdkModifierType) GDK_CONTROL_MASK));
+ GlobalCommands_insert("PatchInsertAddRow", makeCallbackF(Patch_InsertAddRow));
+ GlobalCommands_insert("PatchDeleteFirstColumn", makeCallbackF(Patch_DeleteFirstColumn));
+ GlobalCommands_insert("PatchDeleteLastColumn", makeCallbackF(Patch_DeleteLastColumn),
+ Accelerator(GDK_KEY_KP_Subtract, (GdkModifierType) (GDK_SHIFT_MASK | GDK_CONTROL_MASK)));
+ GlobalCommands_insert("PatchDeleteFirstRow", makeCallbackF(Patch_DeleteFirstRow),
+ Accelerator(GDK_KEY_KP_Subtract, (GdkModifierType) GDK_CONTROL_MASK));
+ GlobalCommands_insert("PatchDeleteLastRow", makeCallbackF(Patch_DeleteLastRow));
+ GlobalCommands_insert("InvertCurve", makeCallbackF(Patch_Invert),
+ Accelerator('I', (GdkModifierType) GDK_CONTROL_MASK));
+ GlobalCommands_insert("RedisperseRows", makeCallbackF(Patch_RedisperseRows),
+ Accelerator('E', (GdkModifierType) GDK_CONTROL_MASK));
+ GlobalCommands_insert("RedisperseCols", makeCallbackF(Patch_RedisperseCols),
+ Accelerator('E', (GdkModifierType) (GDK_SHIFT_MASK | GDK_CONTROL_MASK)));
+ GlobalCommands_insert("SmoothRows", makeCallbackF(Patch_SmoothRows),
+ Accelerator('W', (GdkModifierType) GDK_CONTROL_MASK));
+ GlobalCommands_insert("SmoothCols", makeCallbackF(Patch_SmoothCols),
+ Accelerator('W', (GdkModifierType) (GDK_SHIFT_MASK | GDK_CONTROL_MASK)));
+ GlobalCommands_insert("MatrixTranspose", makeCallbackF(Patch_Transpose),
+ Accelerator('M', (GdkModifierType) (GDK_SHIFT_MASK | GDK_CONTROL_MASK)));
+ GlobalCommands_insert("CapCurrentCurve", makeCallbackF(Patch_Cap),
+ Accelerator('C', (GdkModifierType) GDK_SHIFT_MASK));
+ GlobalCommands_insert("CycleCapTexturePatch", makeCallbackF(Patch_CycleProjection),
+ Accelerator('N', (GdkModifierType) (GDK_SHIFT_MASK | GDK_CONTROL_MASK)));
+ GlobalCommands_insert("MakeOverlayPatch", makeCallbackF(Patch_OverlayOn), Accelerator('Y'));
+ GlobalCommands_insert("ClearPatchOverlays", makeCallbackF(Patch_OverlayOff),
+ Accelerator('L', (GdkModifierType) GDK_CONTROL_MASK));
+}
+
+void Patch_constructToolbar(ui::Toolbar toolbar)
+{
+ toolbar_append_button(toolbar, "Put caps on the current patch (SHIFT + C)", "cap_curve.png", "CapCurrentCurve");
+}
+
+void Patch_constructMenu(ui::Menu menu)
+{
+ create_menu_item_with_mnemonic(menu, "Cylinder", "PatchCylinder");
+ {
+ auto menu_in_menu = create_sub_menu_with_mnemonic(menu, "More Cylinders");
+ if (g_Layout_enableDetachableMenus.m_value) {
+ menu_tearoff(menu_in_menu);
+ }
+ create_menu_item_with_mnemonic(menu_in_menu, "Dense Cylinder", "PatchDenseCylinder");
+ create_menu_item_with_mnemonic(menu_in_menu, "Very Dense Cylinder", "PatchVeryDenseCylinder");
+ create_menu_item_with_mnemonic(menu_in_menu, "Square Cylinder", "PatchSquareCylinder");
+ create_menu_item_with_mnemonic(menu_in_menu, "Exact Cylinder...", "PatchXactCylinder");
+ }
+ menu_separator(menu);
+ create_menu_item_with_mnemonic(menu, "End cap", "PatchEndCap");
+ create_menu_item_with_mnemonic(menu, "Bevel", "PatchBevel");
+ {
+ auto menu_in_menu = create_sub_menu_with_mnemonic(menu, "More End caps, Bevels");
+ if (g_Layout_enableDetachableMenus.m_value) {
+ menu_tearoff(menu_in_menu);
+ }
+ create_menu_item_with_mnemonic(menu_in_menu, "Square Endcap", "PatchSquareBevel");
+ create_menu_item_with_mnemonic(menu_in_menu, "Square Bevel", "PatchSquareEndcap");
+ }
+ menu_separator(menu);
+ create_menu_item_with_mnemonic(menu, "Cone", "PatchCone");
+ create_menu_item_with_mnemonic(menu, "Exact Cone...", "PatchXactCone");
+ menu_separator(menu);
+ create_menu_item_with_mnemonic(menu, "Sphere", "PatchSphere");
+ create_menu_item_with_mnemonic(menu, "Exact Sphere...", "PatchXactSphere");
+ menu_separator(menu);
+ create_menu_item_with_mnemonic(menu, "Simple Patch Mesh...", "SimplePatchMesh");
+ menu_separator(menu);
+ {
+ auto menu_in_menu = create_sub_menu_with_mnemonic(menu, "Insert");
+ if (g_Layout_enableDetachableMenus.m_value) {
+ menu_tearoff(menu_in_menu);
+ }
+ create_menu_item_with_mnemonic(menu_in_menu, "Insert (2) Columns", "PatchInsertInsertColumn");
+ create_menu_item_with_mnemonic(menu_in_menu, "Add (2) Columns", "PatchInsertAddColumn");
+ menu_separator(menu_in_menu);
+ create_menu_item_with_mnemonic(menu_in_menu, "Insert (2) Rows", "PatchInsertInsertRow");
+ create_menu_item_with_mnemonic(menu_in_menu, "Add (2) Rows", "PatchInsertAddRow");
+ }
+ {
+ auto menu_in_menu = create_sub_menu_with_mnemonic(menu, "Delete");
+ if (g_Layout_enableDetachableMenus.m_value) {
+ menu_tearoff(menu_in_menu);
+ }
+ create_menu_item_with_mnemonic(menu_in_menu, "First (2) Columns", "PatchDeleteFirstColumn");
+ create_menu_item_with_mnemonic(menu_in_menu, "Last (2) Columns", "PatchDeleteLastColumn");
+ menu_separator(menu_in_menu);
+ create_menu_item_with_mnemonic(menu_in_menu, "First (2) Rows", "PatchDeleteFirstRow");
+ create_menu_item_with_mnemonic(menu_in_menu, "Last (2) Rows", "PatchDeleteLastRow");
+ }
+ menu_separator(menu);
+ {
+ auto menu_in_menu = create_sub_menu_with_mnemonic(menu, "Matrix");
+ if (g_Layout_enableDetachableMenus.m_value) {
+ menu_tearoff(menu_in_menu);
+ }
+ create_menu_item_with_mnemonic(menu_in_menu, "Invert", "InvertCurve");
+ auto menu_3 = create_sub_menu_with_mnemonic(menu_in_menu, "Re-disperse");
+ if (g_Layout_enableDetachableMenus.m_value) {
+ menu_tearoff(menu_3);
+ }
+ create_menu_item_with_mnemonic(menu_3, "Rows", "RedisperseRows");
+ create_menu_item_with_mnemonic(menu_3, "Columns", "RedisperseCols");
+ auto menu_4 = create_sub_menu_with_mnemonic(menu_in_menu, "Smooth");
+ if (g_Layout_enableDetachableMenus.m_value) {
+ menu_tearoff(menu_4);
+ }
+ create_menu_item_with_mnemonic(menu_4, "Rows", "SmoothRows");
+ create_menu_item_with_mnemonic(menu_4, "Columns", "SmoothCols");
+ create_menu_item_with_mnemonic(menu_in_menu, "Transpose", "MatrixTranspose");
+ }
+ menu_separator(menu);
+ create_menu_item_with_mnemonic(menu, "Cap Selection", "CapCurrentCurve");
+ create_menu_item_with_mnemonic(menu, "Cycle Cap Texture", "CycleCapTexturePatch");
+ menu_separator(menu);
+ {
+ auto menu_in_menu = create_sub_menu_with_mnemonic(menu, "Overlay");
+ if (g_Layout_enableDetachableMenus.m_value) {
+ menu_tearoff(menu_in_menu);
+ }
+ create_menu_item_with_mnemonic(menu_in_menu, "Set", "MakeOverlayPatch");
+ create_menu_item_with_mnemonic(menu_in_menu, "Clear", "ClearPatchOverlays");
+ }
+}
+
+