editcmddef.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. #ifndef MC_EDIT_CMD_DEF_H
  2. #define MC_EDIT_CMD_DEF_H
  3. /* in the distant future, keyboards will be invented with a
  4. separate key for each one of these commands *sigh* */
  5. /* special commands */
  6. #define CK_Insert_Char -1
  7. #define CK_Ignore_Key 0
  8. /* cursor movements */
  9. #define CK_BackSpace 1
  10. #define CK_Delete 2
  11. #define CK_Enter 3
  12. #define CK_Page_Up 4
  13. #define CK_Page_Down 5
  14. #define CK_Left 6
  15. #define CK_Right 7
  16. #define CK_Word_Left 8
  17. #define CK_Word_Right 9
  18. #define CK_Up 10
  19. #define CK_Down 11
  20. #define CK_Home 12
  21. #define CK_End 13
  22. #define CK_Tab 14
  23. #define CK_Undo 15
  24. #define CK_Beginning_Of_Text 16
  25. #define CK_End_Of_Text 17
  26. #define CK_Scroll_Up 18
  27. #define CK_Scroll_Down 19
  28. #define CK_Return 20
  29. #define CK_Begin_Page 21
  30. #define CK_End_Page 22
  31. #define CK_Delete_Word_Left 23
  32. #define CK_Delete_Word_Right 24
  33. #define CK_Paragraph_Up 25
  34. #define CK_Paragraph_Down 26
  35. /* file commands */
  36. #define CK_Save 101
  37. #define CK_Load 102
  38. #define CK_New 103
  39. #define CK_Save_As 104
  40. #define CK_Load_Prev_File 111
  41. #define CK_Load_Next_File 112
  42. /* block commands */
  43. #define CK_Mark 201
  44. #define CK_Copy 202
  45. #define CK_Move 203
  46. #define CK_Remove 204
  47. #define CK_Unmark 206
  48. #define CK_Save_Block 207
  49. #define CK_Column_Mark 208
  50. /* search and replace */
  51. #define CK_Find 301
  52. #define CK_Find_Again 302
  53. #define CK_Replace 303
  54. #define CK_Replace_Again 304
  55. #define CK_Complete_Word 305
  56. /* debugger commands */
  57. #define CK_Debug_Start 350
  58. #define CK_Debug_Stop 351
  59. #define CK_Debug_Toggle_Break 352
  60. #define CK_Debug_Clear 353
  61. #define CK_Debug_Next 354
  62. #define CK_Debug_Step 355
  63. #define CK_Debug_Back_Trace 356
  64. #define CK_Debug_Continue 357
  65. #define CK_Debug_Enter_Command 358
  66. #define CK_Debug_Until_Curser 359
  67. /* misc */
  68. #define CK_Insert_File 401
  69. #define CK_Exit 402
  70. #define CK_Toggle_Insert 403
  71. #define CK_Help 404
  72. #define CK_Date 405
  73. #define CK_Refresh 406
  74. #define CK_Goto 407
  75. #define CK_Delete_Line 408
  76. #define CK_Delete_To_Line_End 409
  77. #define CK_Delete_To_Line_Begin 410
  78. #define CK_Man_Page 411
  79. #define CK_Sort 412
  80. #define CK_Mail 413
  81. #define CK_Cancel 414
  82. #define CK_Complete 415
  83. #define CK_Paragraph_Format 416
  84. #define CK_Util 417
  85. #define CK_Type_Load_Python 418
  86. #define CK_Find_File 419
  87. #define CK_Ctags 420
  88. #define CK_Match_Bracket 421
  89. #define CK_Terminal 422
  90. #define CK_Terminal_App 423
  91. #define CK_ExtCmd 424
  92. #define CK_User_Menu 425
  93. #define CK_Find_Definition 426
  94. #define CK_Add_Collapse_Region 428
  95. /* application control */
  96. #define CK_Save_Desktop 451
  97. #define CK_New_Window 452
  98. #define CK_Cycle 453
  99. #define CK_Menu 454
  100. #define CK_Save_And_Quit 455
  101. #define CK_Run_Another 456
  102. #define CK_Check_Save_And_Quit 457
  103. #define CK_Maximize 458
  104. #define CK_Toggle_Syntax 480
  105. #define CK_Toggle_Line_Status 490
  106. /* macro */
  107. #define CK_Begin_Record_Macro 501
  108. #define CK_End_Record_Macro 502
  109. #define CK_Delete_Macro 503
  110. /* book mark */
  111. #define CK_Toggle_Bookmark 550
  112. #define CK_Flush_Bookmarks 551
  113. #define CK_Next_Bookmark 552
  114. #define CK_Prev_Bookmark 553
  115. /* highlight commands */
  116. #define CK_Page_Up_Highlight 604
  117. #define CK_Page_Down_Highlight 605
  118. #define CK_Left_Highlight 606
  119. #define CK_Right_Highlight 607
  120. #define CK_Word_Left_Highlight 608
  121. #define CK_Word_Right_Highlight 609
  122. #define CK_Up_Highlight 610
  123. #define CK_Down_Highlight 611
  124. #define CK_Home_Highlight 612
  125. #define CK_End_Highlight 613
  126. #define CK_Beginning_Of_Text_Highlight 614
  127. #define CK_End_Of_Text_Highlight 615
  128. #define CK_Begin_Page_Highlight 616
  129. #define CK_End_Page_Highlight 617
  130. #define CK_Scroll_Up_Highlight 618
  131. #define CK_Scroll_Down_Highlight 619
  132. #define CK_Paragraph_Up_Highlight 620
  133. #define CK_Paragraph_Down_Highlight 621
  134. /* X clipboard operations */
  135. #define CK_XStore 701
  136. #define CK_XCut 702
  137. #define CK_XPaste 703
  138. #define CK_Selection_History 704
  139. #define CK_Shell 801
  140. /* C-x or similar */
  141. #define CK_Ext_Mode 820
  142. #define CK_Select_Codepage 850
  143. #define CK_Insert_Literal 851
  144. #define CK_Execute_Macro 852
  145. #define CK_Begin_End_Macro 853
  146. /*
  147. Process a block through a shell command: CK_Pipe_Block(i) executes shell_cmd[i].
  148. shell_cmd[i] must process the file ~/cooledit.block and output ~/cooledit.block
  149. which is then inserted into the text in place of the original block. shell_cmd[i] must
  150. also produce a file homedir/cooledit.error . If this file is not empty an error will
  151. have been assumed to have occured, and the block will not be replaced.
  152. TODO: bring up a viewer to display the error message instead of inserting
  153. it into the text, which is annoying.
  154. */
  155. #define CK_Pipe_Block(i) (1000+(i))
  156. #define SHELL_COMMANDS_i {"/edit.indent.rc", "/edit.spell.rc", /* and so on */ 0 }
  157. #define CK_Macro(i) (2000+(i))
  158. #define CK_Last_Macro CK_Macro(0x7FFF)
  159. #else
  160. #define CK_User_Command(i) ((i) | (1 << 16))
  161. #define IS_USER_COMMAND(i) ((i) & (1 << 16))
  162. #define CK_Macro(i) ((i) | (1 << 17))
  163. #define IS_MACRO_COMMAND(i) ((i) & (1 << 17))
  164. #endif