ContextMenuHandlers.m 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /**
  2. * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
  3. *
  4. * This library is free software; you can redistribute it and/or modify it under
  5. * the terms of the GNU Lesser General Public License as published by the Free
  6. * Software Foundation; either version 2.1 of the License, or (at your option)
  7. * any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11. * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  12. * details.
  13. */
  14. #import "ContextMenuHandlers.h"
  15. #import "MenuManager.h"
  16. @implementation NSObject (ContextMenuHandlers)
  17. + (void)ContextMenuHandlers_addViewSpecificStuffToMenu:(id)arg1 browserViewController:(id)arg2 context:(unsigned int)arg3 // 10.7 & 10.8
  18. {
  19. [self ContextMenuHandlers_addViewSpecificStuffToMenu:arg1 browserViewController:arg2 context:arg3];
  20. MenuManager* menuManager = [MenuManager sharedInstance];
  21. if (menuManager.menuItems.count > 0)
  22. {
  23. [menuManager addItemsToMenu:arg1 forFiles:menuManager.menuItems];
  24. [menuManager.menuItems removeAllObjects];
  25. }
  26. }
  27. + (void)ContextMenuHandlers_addViewSpecificStuffToMenu:(id)arg1 clickedView:(id)arg2 browserViewController:(id)arg3 context:(unsigned int)arg4 // 10.9
  28. {
  29. [self ContextMenuHandlers_addViewSpecificStuffToMenu:arg1 clickedView:arg2 browserViewController:arg3 context:arg4];
  30. MenuManager* menuManager = [MenuManager sharedInstance];
  31. if (menuManager.menuItems.count > 0)
  32. {
  33. [menuManager addItemsToMenu:arg1 forFiles:menuManager.menuItems];
  34. [menuManager.menuItems removeAllObjects];
  35. }
  36. }
  37. + (void)ContextMenuHandlers_handleContextMenuCommon:(unsigned int)arg1 nodes:(const struct TFENodeVector*)arg2 event:(id)arg3 view:(id)arg4 windowController:(id)arg5 addPlugIns:(BOOL)arg6 // 10.7
  38. {
  39. MenuManager* menuManager = [MenuManager sharedInstance];
  40. menuManager.menuItems = (NSMutableArray*)[menuManager pathsForNodes:arg2];
  41. [self ContextMenuHandlers_handleContextMenuCommon:arg1 nodes:arg2 event:arg3 view:arg4 windowController:arg5 addPlugIns:arg6];
  42. }
  43. + (void)ContextMenuHandlers_handleContextMenuCommon:(unsigned int)arg1 nodes:(const struct TFENodeVector*)arg2 event:(id)arg3 view:(id)arg4 browserController:(id)arg5 addPlugIns:(BOOL)arg6 // 10.8
  44. {
  45. MenuManager* menuManager = [MenuManager sharedInstance];
  46. menuManager.menuItems = (NSMutableArray*)[menuManager pathsForNodes:arg2];
  47. [self ContextMenuHandlers_handleContextMenuCommon:arg1 nodes:arg2 event:arg3 view:arg4 browserController:arg5 addPlugIns:arg6];
  48. }
  49. + (void)ContextMenuHandlers_handleContextMenuCommon:(unsigned int)arg1 nodes:(const struct TFENodeVector*)arg2 event:(id)arg3 clickedView:(id)arg4 browserViewController:(id)arg5 addPlugIns:(BOOL)arg6 // 10.9
  50. {
  51. MenuManager* menuManager = [MenuManager sharedInstance];
  52. menuManager.menuItems = (NSMutableArray*)[menuManager pathsForNodes:arg2];
  53. [self ContextMenuHandlers_handleContextMenuCommon:arg1 nodes:arg2 event:arg3 clickedView:arg4 browserViewController:arg5 addPlugIns:arg6];
  54. }
  55. - (void)ContextMenuHandlers_configureWithNodes:(const struct TFENodeVector*)arg1 windowController:(id)arg2 container:(BOOL)arg3 // 10.7
  56. {
  57. [self ContextMenuHandlers_configureWithNodes:arg1 windowController:arg2 container:arg3];
  58. TContextMenu* realSelf = (TContextMenu*)self;
  59. MenuManager* menuManager = [MenuManager sharedInstance];
  60. NSArray* selectedItems = [menuManager pathsForNodes:arg1];
  61. [menuManager addItemsToMenu:realSelf forFiles:selectedItems];
  62. }
  63. - (void)ContextMenuHandlers_configureWithNodes:(const struct TFENodeVector*)arg1 browserController:(id)arg2 container:(BOOL)arg3 // 10.8
  64. {
  65. [self ContextMenuHandlers_configureWithNodes:arg1 browserController:arg2 container:arg3];
  66. TContextMenu* realSelf = (TContextMenu*)self;
  67. MenuManager* menuManager = [MenuManager sharedInstance];
  68. NSArray* selectedItems = [menuManager pathsForNodes:arg1];
  69. [menuManager addItemsToMenu:realSelf forFiles:selectedItems];
  70. }
  71. - (void)ContextMenuHandlers_configureFromMenuNeedsUpdate:(id)arg1 clickedView:(id)arg2 container:(BOOL)arg3 event:(id)arg4 selectedNodes:(const struct TFENodeVector *)arg5 // 10.9
  72. {
  73. [self ContextMenuHandlers_configureFromMenuNeedsUpdate:arg1 clickedView:arg2 container:arg3 event:arg4 selectedNodes:arg5]; // 10.8
  74. TContextMenu* realSelf = (TContextMenu*)self;
  75. MenuManager* menuManager = [MenuManager sharedInstance];
  76. NSArray* selectedItems = [menuManager pathsForNodes:arg5];
  77. [menuManager addItemsToMenu:realSelf forFiles:selectedItems];
  78. }
  79. @end