1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Source code not in Vim style.
12 Solution: Adjust the style. (Elias Diem)
13 Files: src/gui_photon.c
16 *** ../vim-7.3.298/src/gui_photon.c 2011-09-07 18:58:24.000000000 +0200
17 --- src/gui_photon.c 2011-09-07 19:02:59.000000000 +0200
25 ! add_to_input_buf( buf, dst_made );
29 ! add_to_input_buf( string, len );
39 ! add_to_input_buf(buf, dst_made);
43 ! add_to_input_buf(string, len);
54 /* FIXME: is this the right thing to do? */
55 ! if( modifiers & MOD_MASK_CTRL )
57 modifiers &= ~MOD_MASK_CTRL;
59 ! if( ( ch >= 'a' && ch <= 'z' ) ||
63 ! ch = Ctrl_chr( ch );
64 ! else if( ch == '2' )
66 ! else if( ch == '6' )
68 ! else if( ch == '-' )
71 modifiers |= MOD_MASK_CTRL;
74 ! if( modifiers & MOD_MASK_ALT )
77 modifiers &= ~MOD_MASK_ALT;
86 /* FIXME: is this the right thing to do? */
87 ! if (modifiers & MOD_MASK_CTRL)
89 modifiers &= ~MOD_MASK_CTRL;
91 ! if ((ch >= 'a' && ch <= 'z') ||
100 ! else if (ch == '-')
103 modifiers |= MOD_MASK_CTRL;
106 ! if (modifiers & MOD_MASK_ALT)
109 modifiers &= ~MOD_MASK_ALT;
114 modifiers &= ~MOD_MASK_SHIFT;
117 ! ch = simplify_key( ch, &modifiers );
120 string[ len++ ] = CSI;
121 string[ len++ ] = KS_MODIFIER;
122 string[ len++ ] = modifiers;
125 ! if( IS_SPECIAL( ch ) )
127 string[ len++ ] = CSI;
128 ! string[ len++ ] = K_SECOND( ch );
129 ! string[ len++ ] = K_THIRD( ch );
134 modifiers &= ~MOD_MASK_SHIFT;
137 ! ch = simplify_key(ch, &modifiers);
140 string[ len++ ] = CSI;
141 string[ len++ ] = KS_MODIFIER;
142 string[ len++ ] = modifiers;
145 ! if (IS_SPECIAL(ch))
147 string[ len++ ] = CSI;
148 ! string[ len++ ] = K_SECOND(ch);
149 ! string[ len++ ] = K_THIRD(ch);
155 string[ len++ ] = KE_CSI;
160 ! add_to_input_buf( string, len );
165 string[ len++ ] = KE_CSI;
170 ! add_to_input_buf(string, len);
179 ! gui_ph_handle_mouse( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
181 PhPointerEvent_t *pointer;
183 int button = 0, repeated_click, modifiers = 0x0;
184 short mouse_x, mouse_y;
186 ! pointer = PhGetData( info->event );
187 ! pos = PhGetRects( info->event );
189 ! gui_mch_mousehide( MOUSE_SHOW );
192 * Coordinates need to be relative to the base window,
197 ! gui_ph_handle_mouse(PtWidget_t *widget, void *data, PtCallbackInfo_t *info)
199 PhPointerEvent_t *pointer;
201 int button = 0, repeated_click, modifiers = 0x0;
202 short mouse_x, mouse_y;
204 ! pointer = PhGetData(info->event);
205 ! pos = PhGetRects(info->event);
207 ! gui_mch_mousehide(MOUSE_SHOW);
210 * Coordinates need to be relative to the base window,
213 mouse_x = pos->ul.x + gui.border_width;
214 mouse_y = pos->ul.y + gui.border_width;
216 ! if( info->event->type == Ph_EV_PTR_MOTION_NOBUTTON )
218 ! gui_mouse_moved( mouse_x, mouse_y );
222 ! if( pointer->key_mods & Pk_KM_Shift )
223 modifiers |= MOUSE_SHIFT;
224 ! if( pointer->key_mods & Pk_KM_Ctrl )
225 modifiers |= MOUSE_CTRL;
226 ! if( pointer->key_mods & Pk_KM_Alt )
227 modifiers |= MOUSE_ALT;
230 * FIXME More than one button may be involved, but for
231 * now just deal with one
233 ! if( pointer->buttons & Ph_BUTTON_SELECT )
236 ! if( pointer->buttons & Ph_BUTTON_MENU )
238 button = MOUSE_RIGHT;
239 /* Need the absolute coordinates for the popup menu */
241 mouse_x = pos->ul.x + gui.border_width;
242 mouse_y = pos->ul.y + gui.border_width;
244 ! if (info->event->type == Ph_EV_PTR_MOTION_NOBUTTON)
246 ! gui_mouse_moved(mouse_x, mouse_y);
250 ! if (pointer->key_mods & Pk_KM_Shift)
251 modifiers |= MOUSE_SHIFT;
252 ! if (pointer->key_mods & Pk_KM_Ctrl)
253 modifiers |= MOUSE_CTRL;
254 ! if (pointer->key_mods & Pk_KM_Alt)
255 modifiers |= MOUSE_ALT;
258 * FIXME More than one button may be involved, but for
259 * now just deal with one
261 ! if (pointer->buttons & Ph_BUTTON_SELECT)
264 ! if (pointer->buttons & Ph_BUTTON_MENU)
266 button = MOUSE_RIGHT;
267 /* Need the absolute coordinates for the popup menu */
270 abs_mouse.y = pointer->pos.y;
273 ! if( pointer->buttons & Ph_BUTTON_ADJUST )
274 button = MOUSE_MIDDLE;
276 /* Catch a real release (not phantom or other releases */
277 ! if( info->event->type == Ph_EV_BUT_RELEASE )
278 button = MOUSE_RELEASE;
280 ! if( info->event->type & Ph_EV_PTR_MOTION_BUTTON )
284 /* Vim doesn't use button repeats */
285 ! if( info->event->type & Ph_EV_BUT_REPEAT )
289 /* Don't do anything if it is one of the phantom mouse release events */
290 ! if( ( button != MOUSE_RELEASE ) ||
291 ! ( info->event->subtype == Ph_EV_RELEASE_REAL ) )
293 repeated_click = (pointer->click_count >= 2) ? TRUE : FALSE;
295 ! gui_send_mouse_event( button , mouse_x, mouse_y, repeated_click, modifiers );
300 abs_mouse.y = pointer->pos.y;
303 ! if (pointer->buttons & Ph_BUTTON_ADJUST)
304 button = MOUSE_MIDDLE;
306 /* Catch a real release (not phantom or other releases */
307 ! if (info->event->type == Ph_EV_BUT_RELEASE)
308 button = MOUSE_RELEASE;
310 ! if (info->event->type & Ph_EV_PTR_MOTION_BUTTON)
314 /* Vim doesn't use button repeats */
315 ! if (info->event->type & Ph_EV_BUT_REPEAT)
319 /* Don't do anything if it is one of the phantom mouse release events */
320 ! if ((button != MOUSE_RELEASE) ||
321 ! (info->event->subtype == Ph_EV_RELEASE_REAL))
323 repeated_click = (pointer->click_count >= 2) ? TRUE : FALSE;
325 ! gui_send_mouse_event(button , mouse_x, mouse_y, repeated_click, modifiers);
332 /* Handle a focus change of the PtRaw widget */
334 ! gui_ph_handle_focus( PtWidget_t *widget, void *data, PtCallbackInfo_t *info )
336 ! if( info->reason == Pt_CB_LOST_FOCUS )
338 ! PtRemoveEventHandler( gui.vimTextArea, Ph_EV_PTR_MOTION_NOBUTTON,
339 ! gui_ph_handle_mouse, NULL );
341 ! gui_mch_mousehide( MOUSE_SHOW );
345 ! PtAddEventHandler( gui.vimTextArea, Ph_EV_PTR_MOTION_NOBUTTON,
346 ! gui_ph_handle_mouse, NULL );
352 ! gui_ph_handle_raw_draw( PtWidget_t *widget, PhTile_t *damage )
356 PhPoint_t translation;
358 ! if( is_ignore_draw == TRUE )
361 ! PtSuperClassDraw( PtBasic, widget, damage );
362 ! PgGetTranslation( &translation );
363 PgClearTranslation();
368 /* Handle a focus change of the PtRaw widget */
370 ! gui_ph_handle_focus(PtWidget_t *widget, void *data, PtCallbackInfo_t *info)
372 ! if (info->reason == Pt_CB_LOST_FOCUS)
374 ! PtRemoveEventHandler(gui.vimTextArea, Ph_EV_PTR_MOTION_NOBUTTON,
375 ! gui_ph_handle_mouse, NULL);
377 ! gui_mch_mousehide(MOUSE_SHOW);
381 ! PtAddEventHandler(gui.vimTextArea, Ph_EV_PTR_MOTION_NOBUTTON,
382 ! gui_ph_handle_mouse, NULL);
388 ! gui_ph_handle_raw_draw(PtWidget_t *widget, PhTile_t *damage)
392 PhPoint_t translation;
394 ! if (is_ignore_draw == TRUE)
397 ! PtSuperClassDraw(PtBasic, widget, damage);
398 ! PgGetTranslation(&translation);
399 PgClearTranslation();
407 ! PtWidgetOffset( widget, &offset );
408 ! PhTranslatePoint( &offset, PtWidgetPos( gui.vimTextArea, NULL ) );
411 /* Redraw individual damage regions */
412 ! if( damage->next != NULL )
413 damage = damage->next;
415 ! while( damage != NULL )
419 r->ul.x - offset.x, r->ul.y - offset.y,
420 r->lr.x - r->ul.x + 1,
421 ! r->lr.y - r->ul.y + 1 );
422 damage = damage->next;
429 ! PtWidgetOffset(widget, &offset);
430 ! PhTranslatePoint(&offset, PtWidgetPos(gui.vimTextArea, NULL));
433 /* Redraw individual damage regions */
434 ! if (damage->next != NULL)
435 damage = damage->next;
437 ! while(damage != NULL)
441 r->ul.x - offset.x, r->ul.y - offset.y,
442 r->lr.x - r->ul.x + 1,
443 ! r->lr.y - r->ul.y + 1);
444 damage = damage->next;
450 r->ul.x - offset.x, r->ul.y - offset.y,
451 r->lr.x - r->ul.x + 1,
452 ! r->lr.y - r->ul.y + 1 );
455 ! PgSetTranslation( &translation, 0 );
459 gui_ph_handle_pulldown_menu(
462 ! PtCallbackInfo_t *info )
466 vimmenu_T *menu = (vimmenu_T *) data;
468 ! PtPositionMenu( menu->submenu_id, NULL );
469 ! PtRealizeWidget( menu->submenu_id );
475 r->ul.x - offset.x, r->ul.y - offset.y,
476 r->lr.x - r->ul.x + 1,
477 ! r->lr.y - r->ul.y + 1);
480 ! PgSetTranslation(&translation, 0);
484 gui_ph_handle_pulldown_menu(
487 ! PtCallbackInfo_t *info)
491 vimmenu_T *menu = (vimmenu_T *) data;
493 ! PtPositionMenu(menu->submenu_id, NULL);
494 ! PtRealizeWidget(menu->submenu_id);
498 *** ../vim-7.3.298/src/version.c 2011-09-07 18:58:24.000000000 +0200
499 --- src/version.c 2011-09-07 19:01:17.000000000 +0200
503 { /* Add new patch number below this line */
509 The only way the average employee can speak to an executive is by taking a
510 second job as a golf caddie.
511 (Scott Adams - The Dilbert principle)
513 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
514 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
515 \\\ an exciting new programming language -- http://www.Zimbu.org ///
516 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///