Browse Source

mcedit: rename MCEDIT_DRAG_NORMAL to MCEDIT_DRAG_NONE.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Andrew Borodin 9 years ago
parent
commit
1adc6a53d1
4 changed files with 14 additions and 14 deletions
  1. 1 1
      src/editor/edit.c
  2. 2 2
      src/editor/editdraw.c
  3. 9 9
      src/editor/editwidget.c
  4. 2 2
      src/editor/editwidget.h

+ 1 - 1
src/editor/edit.c

@@ -2100,7 +2100,7 @@ edit_init (WEdit * edit, int y, int x, int lines, int cols, const vfs_path_t * f
         edit_save_size (edit);
     }
 
-    edit->drag_state = MCEDIT_DRAG_NORMAL;
+    edit->drag_state = MCEDIT_DRAG_NONE;
 
     edit->stat1.st_mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
     edit->stat1.st_uid = getuid ();

+ 2 - 2
src/editor/editdraw.c

@@ -355,7 +355,7 @@ edit_draw_frame (const WEdit * edit, int color, gboolean active)
     /* draw double frame for active window if skin supports that */
     tty_draw_box (w->y, w->x, w->lines, w->cols, !active);
     /* draw a drag marker */
-    if (edit->drag_state == MCEDIT_DRAG_NORMAL)
+    if (edit->drag_state == MCEDIT_DRAG_NONE)
     {
         tty_setcolor (EDITOR_FRAME_DRAG);
         widget_move (w, w->lines - 1, w->cols - 1);
@@ -1050,7 +1050,7 @@ edit_status (WEdit * edit, gboolean active)
     }
     else
     {
-        color = edit->drag_state != MCEDIT_DRAG_NORMAL ? EDITOR_FRAME_DRAG : active ?
+        color = edit->drag_state != MCEDIT_DRAG_NONE ? EDITOR_FRAME_DRAG : active ?
             EDITOR_FRAME_ACTIVE : EDITOR_FRAME;
         edit_draw_frame (edit, color, active);
         edit_status_window (edit);

+ 9 - 9
src/editor/editwidget.c

@@ -213,7 +213,7 @@ edit_restore_size (WEdit * edit)
 {
     Widget *w = WIDGET (edit);
 
-    edit->drag_state = MCEDIT_DRAG_NORMAL;
+    edit->drag_state = MCEDIT_DRAG_NONE;
     w->Mouse.forced_capture = FALSE;
     widget_set_size (w, edit->y_prev, edit->x_prev, edit->lines_prev, edit->cols_prev);
     dlg_redraw (w->owner);
@@ -444,7 +444,7 @@ edit_dialog_command_execute (WDialog * h, long command)
         {
             Widget *w = WIDGET (h->current->data);
 
-            if (edit_widget_is_editor (w) && ((WEdit *) w)->drag_state != MCEDIT_DRAG_NORMAL)
+            if (edit_widget_is_editor (w) && ((WEdit *) w)->drag_state != MCEDIT_DRAG_NONE)
                 edit_restore_size ((WEdit *) w);
             else if (command == CK_Quit)
                 dlg_stop (h);
@@ -647,7 +647,7 @@ edit_quit (WDialog * h)
         {
             e = (WEdit *) l->data;
 
-            if (e->drag_state != MCEDIT_DRAG_NORMAL)
+            if (e->drag_state != MCEDIT_DRAG_NONE)
             {
                 edit_restore_size (e);
                 return;
@@ -1074,7 +1074,7 @@ edit_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event)
     close_x = (w->cols - 1) - dx - 1;
     toggle_fullscreen_x = close_x - 3;
 
-    if (edit->drag_state != MCEDIT_DRAG_NORMAL)
+    if (edit->drag_state != MCEDIT_DRAG_NONE)
     {
         /* window is being resized/moved */
         edit_mouse_handle_move_resize (w, msg, event);
@@ -1380,14 +1380,14 @@ edit_handle_move_resize (WEdit * edit, long command)
 
     if (edit->fullscreen)
     {
-        edit->drag_state = MCEDIT_DRAG_NORMAL;
+        edit->drag_state = MCEDIT_DRAG_NONE;
         w->Mouse.forced_capture = FALSE;
         return ret;
     }
 
     switch (edit->drag_state)
     {
-    case MCEDIT_DRAG_NORMAL:
+    case MCEDIT_DRAG_NONE:
         /* possible start move/resize */
         switch (command)
         {
@@ -1430,7 +1430,7 @@ edit_handle_move_resize (WEdit * edit, long command)
             break;
         case CK_Enter:
         case CK_WindowMove:
-            edit->drag_state = MCEDIT_DRAG_NORMAL;
+            edit->drag_state = MCEDIT_DRAG_NONE;
             edit_status (edit, TRUE);   /* redraw frame and status */
         default:
             ret = TRUE;
@@ -1454,7 +1454,7 @@ edit_handle_move_resize (WEdit * edit, long command)
             break;
         case CK_Enter:
         case CK_WindowResize:
-            edit->drag_state = MCEDIT_DRAG_NORMAL;
+            edit->drag_state = MCEDIT_DRAG_NONE;
             edit_status (edit, TRUE);   /* redraw frame and status */
         default:
             ret = TRUE;
@@ -1475,7 +1475,7 @@ edit_handle_move_resize (WEdit * edit, long command)
      * "Anywhere" means: inside or outside the window. We make this happen
      * with the 'forced_capture' flag.
      */
-    w->Mouse.forced_capture = (edit->drag_state != MCEDIT_DRAG_NORMAL);
+    w->Mouse.forced_capture = (edit->drag_state != MCEDIT_DRAG_NONE);
 
     return ret;
 }

+ 2 - 2
src/editor/editwidget.h

@@ -50,13 +50,13 @@ struct edit_syntax_rule_t
 
 /*
  * State of WEdit window
- * MCEDIT_DRAG_NORMAL - window is in normal mode
+ * MCEDIT_DRAG_NONE   - window is in normal mode
  * MCEDIT_DRAG_MOVE   - window is being moved
  * MCEDIT_DRAG_RESIZE - window is being resized
  */
 typedef enum
 {
-    MCEDIT_DRAG_NORMAL = 0,
+    MCEDIT_DRAG_NONE = 0,
     MCEDIT_DRAG_MOVE,
     MCEDIT_DRAG_RESIZE
 } mcedit_drag_state_t;