]> git.pld-linux.org Git - packages/vim.git/blob - 7.3.262
- new: 7.3.271
[packages/vim.git] / 7.3.262
1 To: vim_dev@googlegroups.com
2 Subject: Patch 7.3.262
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 7.3.262
11 Problem:    Photon code style doesn't match Vim style.
12 Solution:   Clean up some of it.  (Elias Diem)
13 Files:      src/gui_photon.c
14
15
16 *** ../vim-7.3.261/src/gui_photon.c     2011-01-17 20:08:03.000000000 +0100
17 --- src/gui_photon.c    2011-07-27 14:07:02.000000000 +0200
18 ***************
19 *** 32,40 ****
20   #endif
21   
22   #define ARRAY_LENGTH(a) (sizeof(a) / sizeof(a[0]))
23 ! #define RGB(r,g,b) PgRGB(r,g,b)
24   
25 ! #define EVENT_BUFFER_SIZE sizeof( PhEvent_t ) + 1000
26   
27   /* Some defines for gui_mch_mousehide() */
28   #define MOUSE_HIDE            TRUE
29 --- 32,40 ----
30   #endif
31   
32   #define ARRAY_LENGTH(a) (sizeof(a) / sizeof(a[0]))
33 ! #define RGB(r, g, b) PgRGB(r, g, b)
34   
35 ! #define EVENT_BUFFER_SIZE sizeof(PhEvent_t) + 1000
36   
37   /* Some defines for gui_mch_mousehide() */
38   #define MOUSE_HIDE            TRUE
39 ***************
40 *** 206,258 ****
41   static PtCallbackF_t gui_ph_handle_menu_unrealized;
42   
43   #ifdef USE_PANEL_GROUP
44 ! static void gui_ph_get_panelgroup_margins( short*, short*, short*, short* );
45   #endif
46   
47   #ifdef FEAT_TOOLBAR
48 ! static PhImage_t *gui_ph_toolbar_find_icon( vimmenu_T *menu );
49   #endif
50   
51 ! static void gui_ph_draw_start( void );
52 ! static void gui_ph_draw_end( void );
53   
54   /* Set the text for the balloon */
55 ! static PtWidget_t * gui_ph_show_tooltip( PtWidget_t *window,
56                              PtWidget_t *widget,
57                              int position,
58                              char *text,
59                              char *font,
60                              PgColor_t fill_color,
61 !                            PgColor_t text_color );
62   
63   /****************************************************************************/
64   
65 ! static PtWidget_t * gui_ph_show_tooltip( PtWidget_t *window,
66                              PtWidget_t *widget,
67                              int position,
68                              char *text,
69                              char *font,
70                              PgColor_t fill_color,
71 !                            PgColor_t text_color )
72   {
73       PtArg_t arg;
74       vimmenu_T *menu;
75       char_u  *tooltip;
76   
77 !     PtSetArg( &arg, Pt_ARG_POINTER, &menu, 0 );
78 !     PtGetResources( widget, 1, &arg );
79   
80       /* Override the text and position */
81   
82       tooltip = text;
83 !     if( menu != NULL )
84       {
85         int index = MENU_INDEX_TIP;
86 !       if( menu->strings[ index ] != NULL )
87             tooltip = menu->strings[ index ];
88       }
89   
90 !     return( PtInflateBalloon(
91             window,
92             widget,
93             /* Don't put the balloon at the bottom,
94 --- 206,258 ----
95   static PtCallbackF_t gui_ph_handle_menu_unrealized;
96   
97   #ifdef USE_PANEL_GROUP
98 ! static void gui_ph_get_panelgroup_margins(short*, short*, short*, short*);
99   #endif
100   
101   #ifdef FEAT_TOOLBAR
102 ! static PhImage_t *gui_ph_toolbar_find_icon(vimmenu_T *menu);
103   #endif
104   
105 ! static void gui_ph_draw_start(void);
106 ! static void gui_ph_draw_end(void);
107   
108   /* Set the text for the balloon */
109 ! static PtWidget_t * gui_ph_show_tooltip(PtWidget_t *window,
110                              PtWidget_t *widget,
111                              int position,
112                              char *text,
113                              char *font,
114                              PgColor_t fill_color,
115 !                            PgColor_t text_color);
116   
117   /****************************************************************************/
118   
119 ! static PtWidget_t * gui_ph_show_tooltip(PtWidget_t *window,
120                              PtWidget_t *widget,
121                              int position,
122                              char *text,
123                              char *font,
124                              PgColor_t fill_color,
125 !                            PgColor_t text_color)
126   {
127       PtArg_t arg;
128       vimmenu_T *menu;
129       char_u  *tooltip;
130   
131 !     PtSetArg(&arg, Pt_ARG_POINTER, &menu, 0);
132 !     PtGetResources(widget, 1, &arg);
133   
134       /* Override the text and position */
135   
136       tooltip = text;
137 !     if (menu != NULL)
138       {
139         int index = MENU_INDEX_TIP;
140 !       if (menu->strings[ index ] != NULL)
141             tooltip = menu->strings[ index ];
142       }
143   
144 !     return PtInflateBalloon(
145             window,
146             widget,
147             /* Don't put the balloon at the bottom,
148 ***************
149 *** 261,285 ****
150             tooltip,
151             font,
152             fill_color,
153 !           text_color ) );
154   }
155   
156       static void
157 ! gui_ph_resize_container( void )
158   {
159       PhArea_t area;
160   
161 !     PtWidgetArea( gui.vimWindow, &area );
162 !     PtWidgetPos ( gui.vimContainer, &area.pos );
163   
164 !     PtSetResource( gui.vimContainer, Pt_ARG_AREA, &area, 0 );
165   }
166   
167       static int
168   gui_ph_handle_menu_resize(
169         PtWidget_t *widget,
170         void *other,
171 !       PtCallbackInfo_t *info )
172   {
173       PtContainerCallback_t *sizes = info->cbdata;
174       PtWidget_t                *container;
175 --- 261,285 ----
176             tooltip,
177             font,
178             fill_color,
179 !           text_color);
180   }
181   
182       static void
183 ! gui_ph_resize_container(void)
184   {
185       PhArea_t area;
186   
187 !     PtWidgetArea(gui.vimWindow, &area);
188 !     PtWidgetPos (gui.vimContainer, &area.pos);
189   
190 !     PtSetResource(gui.vimContainer, Pt_ARG_AREA, &area, 0);
191   }
192   
193       static int
194   gui_ph_handle_menu_resize(
195         PtWidget_t *widget,
196         void *other,
197 !       PtCallbackInfo_t *info)
198   {
199       PtContainerCallback_t *sizes = info->cbdata;
200       PtWidget_t                *container;
201 ***************
202 *** 291,297 ****
203       /* Because vim treats the toolbar and menubar separately,
204        * and here they're lumped together into a PtToolbarGroup,
205        * we only need either menu_height or toolbar_height set at once */
206 !     if( gui.menu_is_active )
207       {
208         gui.menu_height = height;
209         gui.toolbar_height = 0;
210 --- 291,297 ----
211       /* Because vim treats the toolbar and menubar separately,
212        * and here they're lumped together into a PtToolbarGroup,
213        * we only need either menu_height or toolbar_height set at once */
214 !     if (gui.menu_is_active)
215       {
216         gui.menu_height = height;
217         gui.toolbar_height = 0;
218 ***************
219 *** 310,325 ****
220       container = gui.vimContainer;
221   #endif
222   
223 !     PtSetResource( container, Pt_ARG_POS, &below_menu, 0 );
224   
225       gui_ph_resize_container();
226   
227   #ifdef USE_PANEL_GROUP
228       gui_ph_get_panelgroup_margins(
229             &pg_margin_top, &pg_margin_bottom,
230 !           &pg_margin_left, &pg_margin_right );
231   #endif
232 !     return( Pt_CONTINUE );
233   }
234   
235   /*
236 --- 310,325 ----
237       container = gui.vimContainer;
238   #endif
239   
240 !     PtSetResource(container, Pt_ARG_POS, &below_menu, 0);
241   
242       gui_ph_resize_container();
243   
244   #ifdef USE_PANEL_GROUP
245       gui_ph_get_panelgroup_margins(
246             &pg_margin_top, &pg_margin_bottom,
247 !           &pg_margin_left, &pg_margin_right);
248   #endif
249 !     return Pt_CONTINUE;
250   }
251   
252   /*
253 ***************
254 *** 330,352 ****
255   gui_ph_handle_timer_cursor(
256         PtWidget_t *widget,
257         void *data,
258 !       PtCallbackInfo_t *info )
259   {
260 !     if( blink_state == BLINK_ON )
261       {
262         gui_undraw_cursor();
263         blink_state = BLINK_OFF;
264 !       PtSetResource( gui_ph_timer_cursor, Pt_ARG_TIMER_INITIAL,
265 !               blink_offtime, 0 );
266       }
267       else
268       {
269         gui_update_cursor(TRUE, FALSE);
270         blink_state = BLINK_ON;
271 !       PtSetResource( gui_ph_timer_cursor, Pt_ARG_TIMER_INITIAL,
272 !               blink_ontime, 0 );
273       }
274 !     return( Pt_CONTINUE );
275   }
276   
277       static int
278 --- 330,352 ----
279   gui_ph_handle_timer_cursor(
280         PtWidget_t *widget,
281         void *data,
282 !       PtCallbackInfo_t *info)
283   {
284 !     if (blink_state == BLINK_ON)
285       {
286         gui_undraw_cursor();
287         blink_state = BLINK_OFF;
288 !       PtSetResource(gui_ph_timer_cursor, Pt_ARG_TIMER_INITIAL,
289 !               blink_offtime, 0);
290       }
291       else
292       {
293         gui_update_cursor(TRUE, FALSE);
294         blink_state = BLINK_ON;
295 !       PtSetResource(gui_ph_timer_cursor, Pt_ARG_TIMER_INITIAL,
296 !               blink_ontime, 0);
297       }
298 !     return Pt_CONTINUE;
299   }
300   
301       static int
302 ***************
303 *** 354,360 ****
304   {
305       is_timeout = TRUE;
306   
307 !     return( Pt_CONTINUE );
308   }
309   
310       static int
311 --- 354,360 ----
312   {
313       is_timeout = TRUE;
314   
315 !     return Pt_CONTINUE;
316   }
317   
318       static int
319 ***************
320 *** 402,408 ****
321             break;
322       }
323   
324 !     return( Pt_CONTINUE );
325   }
326   
327       static int
328 --- 402,408 ----
329             break;
330       }
331   
332 !     return Pt_CONTINUE;
333   }
334   
335       static int
336 ***************
337 *** 426,438 ****
338   
339             case Pt_SCROLL_SET:
340                 /* FIXME: return straight away here? */
341 !               return( Pt_CONTINUE );
342                 break;
343         }
344   
345         gui_drag_scrollbar(sb, value, dragging);
346       }
347 !     return( Pt_CONTINUE );
348   }
349   
350       static int
351 --- 426,438 ----
352   
353             case Pt_SCROLL_SET:
354                 /* FIXME: return straight away here? */
355 !               return Pt_CONTINUE;
356                 break;
357         }
358   
359         gui_drag_scrollbar(sb, value, dragging);
360       }
361 !     return Pt_CONTINUE;
362   }
363   
364       static int
365 ***************
366 *** 453,459 ****
367       /* We're a good lil photon program, aren't we? yes we are, yeess wee arrr */
368       if( key->key_flags & Pk_KF_Compose )
369       {
370 !       return( Pt_CONTINUE );
371       }
372   
373       if( (key->key_flags & Pk_KF_Cap_Valid) &&
374 --- 453,459 ----
375       /* We're a good lil photon program, aren't we? yes we are, yeess wee arrr */
376       if( key->key_flags & Pk_KF_Compose )
377       {
378 !       return Pt_CONTINUE;
379       }
380   
381       if( (key->key_flags & Pk_KF_Cap_Valid) &&
382 ***************
383 *** 473,479 ****
384                 gui_is_menu_shortcut( key->key_cap ) ) ) )
385         {
386             /* Fallthrough and let photon look for the hotkey */
387 !           return( Pt_CONTINUE );
388         }
389   #endif
390   
391 --- 473,479 ----
392                 gui_is_menu_shortcut( key->key_cap ) ) ) )
393         {
394             /* Fallthrough and let photon look for the hotkey */
395 !           return Pt_CONTINUE;
396         }
397   #endif
398   
399 ***************
400 *** 544,550 ****
401                         add_to_input_buf( string, len );
402                     }
403   
404 !                   return( Pt_CONSUME );
405                 }
406                 len = 0;
407   #endif
408 --- 544,550 ----
409                         add_to_input_buf( string, len );
410                     }
411   
412 !                   return Pt_CONSUME;
413                 }
414                 len = 0;
415   #endif
416 ***************
417 *** 579,585 ****
418                 }
419                 else
420                 {
421 !                   return( Pt_CONTINUE );
422                 }
423             }
424             else
425 --- 579,585 ----
426                 }
427                 else
428                 {
429 !                   return Pt_CONTINUE;
430                 }
431             }
432             else
433 ***************
434 *** 622,632 ****
435         if( len > 0 )
436         {
437             add_to_input_buf( string, len );
438 !           return( Pt_CONSUME );
439         }
440       }
441   
442 !     return( Pt_CONTINUE );
443   }
444   
445       static int
446 --- 622,632 ----
447         if( len > 0 )
448         {
449             add_to_input_buf( string, len );
450 !           return Pt_CONSUME;
451         }
452       }
453   
454 !     return Pt_CONTINUE;
455   }
456   
457       static int
458 ***************
459 *** 652,658 ****
460       if( info->event->type == Ph_EV_PTR_MOTION_NOBUTTON )
461       {
462         gui_mouse_moved( mouse_x, mouse_y );
463 !       return( Pt_CONTINUE );
464       }
465   
466       if( pointer->key_mods & Pk_KM_Shift )
467 --- 652,658 ----
468       if( info->event->type == Ph_EV_PTR_MOTION_NOBUTTON )
469       {
470         gui_mouse_moved( mouse_x, mouse_y );
471 !       return Pt_CONTINUE;
472       }
473   
474       if( pointer->key_mods & Pk_KM_Shift )
475 ***************
476 *** 702,708 ****
477         gui_send_mouse_event( button , mouse_x, mouse_y, repeated_click, modifiers );
478       }
479   
480 !     return( Pt_CONTINUE );
481   }
482   
483   /* Handle a focus change of the PtRaw widget */
484 --- 702,708 ----
485         gui_send_mouse_event( button , mouse_x, mouse_y, repeated_click, modifiers );
486       }
487   
488 !     return Pt_CONTINUE;
489   }
490   
491   /* Handle a focus change of the PtRaw widget */
492 ***************
493 *** 721,727 ****
494         PtAddEventHandler( gui.vimTextArea, Ph_EV_PTR_MOTION_NOBUTTON,
495                 gui_ph_handle_mouse, NULL );
496       }
497 !     return( Pt_CONTINUE );
498   }
499   
500       static void
501 --- 721,727 ----
502         PtAddEventHandler( gui.vimTextArea, Ph_EV_PTR_MOTION_NOBUTTON,
503                 gui_ph_handle_mouse, NULL );
504       }
505 !     return Pt_CONTINUE;
506   }
507   
508       static void
509 ***************
510 *** 793,799 ****
511         PtRealizeWidget( menu->submenu_id );
512       }
513   
514 !     return( Pt_CONTINUE );
515   }
516   
517   /* This is used for pulldown/popup menus and also toolbar buttons */
518 --- 793,799 ----
519         PtRealizeWidget( menu->submenu_id );
520       }
521   
522 !     return Pt_CONTINUE;
523   }
524   
525   /* This is used for pulldown/popup menus and also toolbar buttons */
526 ***************
527 *** 805,811 ****
528         vimmenu_T *menu = (vimmenu_T *) data;
529         gui_menu_cb( menu );
530       }
531 !     return( Pt_CONTINUE );
532   }
533   
534   /* Stop focus from disappearing into the menubar... */
535 --- 805,811 ----
536         vimmenu_T *menu = (vimmenu_T *) data;
537         gui_menu_cb( menu );
538       }
539 !     return Pt_CONTINUE;
540   }
541   
542   /* Stop focus from disappearing into the menubar... */
543 ***************
544 *** 816,822 ****
545         PtCallbackInfo_t *info )
546   {
547       PtGiveFocus( gui.vimTextArea, NULL );
548 !     return( Pt_CONTINUE );
549   }
550   
551       static int
552 --- 816,822 ----
553         PtCallbackInfo_t *info )
554   {
555       PtGiveFocus( gui.vimTextArea, NULL );
556 !     return Pt_CONTINUE;
557   }
558   
559       static int
560 ***************
561 *** 826,832 ****
562         PtCallbackInfo_t *info )
563   {
564       gui_set_shellsize( FALSE, TRUE, RESIZE_BOTH );
565 !     return( Pt_CONTINUE );
566   }
567   
568   /****************************************************************************/
569 --- 826,832 ----
570         PtCallbackInfo_t *info )
571   {
572       gui_set_shellsize( FALSE, TRUE, RESIZE_BOTH );
573 !     return Pt_CONTINUE;
574   }
575   
576   /****************************************************************************/
577 ***************
578 *** 878,884 ****
579                 ( STRCMP( items->dname, name ) != 0 ) )
580             items = items->next;
581       }
582 !     return( items );
583   }
584   
585       static void
586 --- 878,884 ----
587                 ( STRCMP( items->dname, name ) != 0 ) )
588             items = items->next;
589       }
590 !     return items;
591   }
592   
593       static void
594 ***************
595 *** 927,933 ****
596                 gui_menu_cb( menu );
597         }
598       }
599 !     return( Pt_CONTINUE );
600   }
601   
602       static void
603 --- 927,933 ----
604                 gui_menu_cb( menu );
605         }
606       }
607 !     return Pt_CONTINUE;
608   }
609   
610       static void
611 ***************
612 *** 974,983 ****
613                 mark++;
614   
615             if( *mark == ')' )
616 !               return( TRUE);
617         }
618       }
619 !     return( FALSE );
620   }
621   
622       static void
623 --- 974,983 ----
624                 mark++;
625   
626             if( *mark == ')' )
627 !               return TRUE;
628         }
629       }
630 !     return FALSE;
631   }
632   
633       static void
634 ***************
635 *** 1057,1063 ****
636         gui_ph_pg_remove_buffer( menu->dname );
637       }
638   
639 !     return( Pt_CONTINUE );
640   }
641   #endif
642   
643 --- 1057,1063 ----
644         gui_ph_pg_remove_buffer( menu->dname );
645       }
646   
647 !     return Pt_CONTINUE;
648   }
649   #endif
650   
651 ***************
652 *** 1071,1077 ****
653         PtContainerHold( gui.vimContainer );
654       }
655   
656 !     return( Pt_CONTINUE );
657   }
658   
659   /****************************************************************************/
660 --- 1071,1077 ----
661         PtContainerHold( gui.vimContainer );
662       }
663   
664 !     return Pt_CONTINUE;
665   }
666   
667   /****************************************************************************/
668 ***************
669 *** 1126,1132 ****
670   
671       gui.event_buffer = (PhEvent_t *) alloc( EVENT_BUFFER_SIZE );
672       if( gui.event_buffer == NULL )
673 !       return( FAIL );
674   
675       /* Get a translation so we can convert from ISO Latin-1 to UTF */
676       charset_translate = PxTranslateSet( NULL, "latin1" );
677 --- 1126,1132 ----
678   
679       gui.event_buffer = (PhEvent_t *) alloc( EVENT_BUFFER_SIZE );
680       if( gui.event_buffer == NULL )
681 !       return FAIL;
682   
683       /* Get a translation so we can convert from ISO Latin-1 to UTF */
684       charset_translate = PxTranslateSet( NULL, "latin1" );
685 ***************
686 *** 1141,1147 ****
687       PtSetArg( &args[ n++ ], Pt_ARG_DIM, &window_size, 0 );
688       gui.vimWindow = PtCreateWidget( PtWindow, NULL, n, args );
689       if( gui.vimWindow == NULL )
690 !       return( FAIL );
691   
692       PtAddCallback( gui.vimWindow, Pt_CB_WINDOW, gui_ph_handle_window_cb, NULL );
693       PtAddCallback( gui.vimWindow, Pt_CB_WINDOW_OPENING,
694 --- 1141,1147 ----
695       PtSetArg( &args[ n++ ], Pt_ARG_DIM, &window_size, 0 );
696       gui.vimWindow = PtCreateWidget( PtWindow, NULL, n, args );
697       if( gui.vimWindow == NULL )
698 !       return FAIL;
699   
700       PtAddCallback( gui.vimWindow, Pt_CB_WINDOW, gui_ph_handle_window_cb, NULL );
701       PtAddCallback( gui.vimWindow, Pt_CB_WINDOW_OPENING,
702 ***************
703 *** 1158,1164 ****
704   
705       gui.vimPanelGroup = PtCreateWidget( PtPanelGroup, gui.vimWindow, n, args );
706       if( gui.vimPanelGroup == NULL )
707 !       return( FAIL );
708   
709       PtAddCallback( gui.vimPanelGroup, Pt_CB_PG_PANEL_SWITCHING,
710             gui_ph_handle_pg_change, NULL );
711 --- 1158,1164 ----
712   
713       gui.vimPanelGroup = PtCreateWidget( PtPanelGroup, gui.vimWindow, n, args );
714       if( gui.vimPanelGroup == NULL )
715 !       return FAIL;
716   
717       PtAddCallback( gui.vimPanelGroup, Pt_CB_PG_PANEL_SWITCHING,
718             gui_ph_handle_pg_change, NULL );
719 ***************
720 *** 1172,1178 ****
721   
722       gui.vimContainer = PtCreateWidget( PtPane, gui.vimWindow, n, args );
723       if( gui.vimContainer == NULL )
724 !       return( FAIL );
725   
726       PtAddCallback( gui.vimContainer, Pt_CB_RESIZE, gui_ph_pane_resize, NULL );
727   #endif
728 --- 1172,1178 ----
729   
730       gui.vimContainer = PtCreateWidget( PtPane, gui.vimWindow, n, args );
731       if( gui.vimContainer == NULL )
732 !       return FAIL;
733   
734       PtAddCallback( gui.vimContainer, Pt_CB_RESIZE, gui_ph_pane_resize, NULL );
735   #endif
736 ***************
737 *** 1195,1201 ****
738   
739       gui.vimTextArea = PtCreateWidget( PtRaw, Pt_DFLT_PARENT, n, args );
740       if( gui.vimTextArea == NULL)
741 !       return( FAIL );
742   
743       /* TODO: use PtAddEventHandlers instead? */
744       /* Not using Ph_EV_BUT_REPEAT because vim wouldn't use it anyway */
745 --- 1195,1201 ----
746   
747       gui.vimTextArea = PtCreateWidget( PtRaw, Pt_DFLT_PARENT, n, args );
748       if( gui.vimTextArea == NULL)
749 !       return FAIL;
750   
751       /* TODO: use PtAddEventHandlers instead? */
752       /* Not using Ph_EV_BUT_REPEAT because vim wouldn't use it anyway */
753 ***************
754 *** 1220,1230 ****
755        */
756       gui_ph_timer_cursor  = PtCreateWidget( PtTimer, gui.vimWindow, 0, NULL );
757       if( gui_ph_timer_cursor == NULL )
758 !       return( FAIL );
759   
760       gui_ph_timer_timeout = PtCreateWidget( PtTimer, gui.vimWindow, 0, NULL );
761       if( gui_ph_timer_timeout == NULL )
762 !       return( FAIL );
763   
764       PtAddCallback( gui_ph_timer_cursor,  Pt_CB_TIMER_ACTIVATE,
765             gui_ph_handle_timer_cursor, NULL);
766 --- 1220,1230 ----
767        */
768       gui_ph_timer_cursor  = PtCreateWidget( PtTimer, gui.vimWindow, 0, NULL );
769       if( gui_ph_timer_cursor == NULL )
770 !       return FAIL;
771   
772       gui_ph_timer_timeout = PtCreateWidget( PtTimer, gui.vimWindow, 0, NULL );
773       if( gui_ph_timer_timeout == NULL )
774 !       return FAIL;
775   
776       PtAddCallback( gui_ph_timer_cursor,  Pt_CB_TIMER_ACTIVATE,
777             gui_ph_handle_timer_cursor, NULL);
778 ***************
779 *** 1239,1245 ****
780       gui.vimToolBarGroup = PtCreateWidget( PtToolbarGroup, gui.vimWindow,
781             n, args );
782       if( gui.vimToolBarGroup == NULL )
783 !       return( FAIL );
784   
785       PtAddCallback( gui.vimToolBarGroup, Pt_CB_RESIZE,
786             gui_ph_handle_menu_resize, NULL );
787 --- 1239,1245 ----
788       gui.vimToolBarGroup = PtCreateWidget( PtToolbarGroup, gui.vimWindow,
789             n, args );
790       if( gui.vimToolBarGroup == NULL )
791 !       return FAIL;
792   
793       PtAddCallback( gui.vimToolBarGroup, Pt_CB_RESIZE,
794             gui_ph_handle_menu_resize, NULL );
795 ***************
796 *** 1254,1260 ****
797       }
798       gui.vimMenuBar = PtCreateWidget( PtMenuBar, gui.vimToolBarGroup, n, args );
799       if( gui.vimMenuBar == NULL )
800 !       return( FAIL );
801   
802   # ifdef FEAT_TOOLBAR
803       n = 0;
804 --- 1254,1260 ----
805       }
806       gui.vimMenuBar = PtCreateWidget( PtMenuBar, gui.vimToolBarGroup, n, args );
807       if( gui.vimMenuBar == NULL )
808 !       return FAIL;
809   
810   # ifdef FEAT_TOOLBAR
811       n = 0;
812 ***************
813 *** 1273,1279 ****
814   
815       gui.vimToolBar = PtCreateWidget( PtToolbar, gui.vimToolBarGroup, n, args );
816       if( gui.vimToolBar == NULL )
817 !       return( FAIL );
818   
819       /*
820        * Size for the toolbar is fetched in gui_mch_show_toolbar, after
821 --- 1273,1279 ----
822   
823       gui.vimToolBar = PtCreateWidget( PtToolbar, gui.vimToolBarGroup, n, args );
824       if( gui.vimToolBar == NULL )
825 !       return FAIL;
826   
827       /*
828        * Size for the toolbar is fetched in gui_mch_show_toolbar, after
829 ***************
830 *** 1284,1296 ****
831   
832   #endif
833   
834 !     return( OK );
835   }
836   
837       int
838   gui_mch_init_check(void)
839   {
840 !     return( (is_photon_available == TRUE) ? OK : FAIL );
841   }
842   
843       int
844 --- 1284,1296 ----
845   
846   #endif
847   
848 !     return OK;
849   }
850   
851       int
852   gui_mch_init_check(void)
853   {
854 !     return (is_photon_available == TRUE) ? OK : FAIL;
855   }
856   
857       int
858 ***************
859 *** 1310,1316 ****
860       if (gui_win_x != -1 && gui_win_y != -1)
861         gui_mch_set_winpos(gui_win_x, gui_win_y);
862   
863 !     return( (PtRealizeWidget( gui.vimWindow ) == 0) ? OK : FAIL );
864   }
865   
866       void
867 --- 1310,1316 ----
868       if (gui_win_x != -1 && gui_win_y != -1)
869         gui_mch_set_winpos(gui_win_x, gui_win_y);
870   
871 !     return (PtRealizeWidget( gui.vimWindow ) == 0) ? OK : FAIL;
872   }
873   
874       void
875 ***************
876 *** 1336,1342 ****
877   exit_gui_mch_update( void *data )
878   {
879       *(int *)data = FALSE;
880 !     return( Pt_END );
881   }
882   
883       void
884 --- 1336,1342 ----
885   exit_gui_mch_update( void *data )
886   {
887       *(int *)data = FALSE;
888 !     return Pt_END;
889   }
890   
891       void
892 ***************
893 *** 1365,1374 ****
894         if( input_available() )
895         {
896             PtSetResource( gui_ph_timer_timeout, Pt_ARG_TIMER_INITIAL, 0, 0 );
897 !           return( OK );
898         }
899         else if( is_timeout == TRUE )
900 !           return( FAIL );
901       }
902   }
903   
904 --- 1365,1374 ----
905         if( input_available() )
906         {
907             PtSetResource( gui_ph_timer_timeout, Pt_ARG_TIMER_INITIAL, 0, 0 );
908 !           return OK;
909         }
910         else if( is_timeout == TRUE )
911 !           return FAIL;
912       }
913   }
914   
915 ***************
916 *** 1446,1454 ****
917         vim_free( default_path );
918   
919         if( file.ret == Pt_FSDIALOG_BTN1 )
920 !           return( vim_strsave( file.path ) );
921       }
922 !     return( NULL );
923   }
924   #endif
925   
926 --- 1446,1454 ----
927         vim_free( default_path );
928   
929         if( file.ret == Pt_FSDIALOG_BTN1 )
930 !           return vim_strsave(file.path);
931       }
932 !     return NULL;
933   }
934   #endif
935   
936 ***************
937 *** 1470,1476 ****
938   
939       PtModalUnblock( modal_ctrl, (void *) button );
940   
941 !     return( Pt_TRUE );
942   }
943   
944       static int
945 --- 1470,1476 ----
946   
947       PtModalUnblock( modal_ctrl, (void *) button );
948   
949 !     return Pt_TRUE;
950   }
951   
952       static int
953 ***************
954 *** 1478,1484 ****
955   {
956       if( info->reason_subtype == Pt_EDIT_ACTIVATE )
957         gui_ph_dialog_close( 1, data );
958 !     return( Pt_CONTINUE );
959   }
960   
961       static int
962 --- 1478,1484 ----
963   {
964       if( info->reason_subtype == Pt_EDIT_ACTIVATE )
965         gui_ph_dialog_close( 1, data );
966 !     return Pt_CONTINUE;
967   }
968   
969       static int
970 ***************
971 *** 1490,1498 ****
972       if( ( key->key_flags & Pk_KF_Cap_Valid ) && ( key->key_cap == Pk_Escape ) )
973       {
974         gui_ph_dialog_close( 0, data );
975 !       return( Pt_CONSUME );
976       }
977 !     return( Pt_PROCESS );
978   }
979   
980       int
981 --- 1490,1498 ----
982       if( ( key->key_flags & Pk_KF_Cap_Valid ) && ( key->key_cap == Pk_Escape ) )
983       {
984         gui_ph_dialog_close( 0, data );
985 !       return Pt_CONSUME;
986       }
987 !     return Pt_PROCESS;
988   }
989   
990       int
991 ***************
992 *** 1519,1525 ****
993       button_count = len = i = 0;
994   
995       if( buttons == NULL || *buttons == NUL )
996 !       return( -1 );
997   
998       /* There is one less separator than buttons, so bump up the button count */
999       button_count = 1;
1000 --- 1519,1525 ----
1001       button_count = len = i = 0;
1002   
1003       if( buttons == NULL || *buttons == NUL )
1004 !       return -1;
1005   
1006       /* There is one less separator than buttons, so bump up the button count */
1007       button_count = 1;
1008 ***************
1009 *** 1637,1643 ****
1010       vim_free( button_array );
1011       vim_free( buttons_copy );
1012   
1013 !     return( dialog_result );
1014   }
1015   #endif
1016   /****************************************************************************/
1017 --- 1637,1643 ----
1018       vim_free( button_array );
1019       vim_free( buttons_copy );
1020   
1021 !     return dialog_result;
1022   }
1023   #endif
1024   /****************************************************************************/
1025 ***************
1026 *** 1653,1659 ****
1027       *x = pos->x;
1028       *y = pos->y;
1029   
1030 !     return( OK );
1031   }
1032   
1033       void
1034 --- 1653,1659 ----
1035       *x = pos->x;
1036       *y = pos->y;
1037   
1038 !     return OK;
1039   }
1040   
1041       void
1042 ***************
1043 *** 1975,1985 ****
1044   hex_digit(int c)
1045   {
1046       if (VIM_ISDIGIT(c))
1047 !       return( c - '0' );
1048       c = TOLOWER_ASC(c);
1049       if (c >= 'a' && c <= 'f')
1050 !       return( c - 'a' + 10 );
1051 !     return( -1000 );
1052   }
1053   
1054   
1055 --- 1975,1985 ----
1056   hex_digit(int c)
1057   {
1058       if (VIM_ISDIGIT(c))
1059 !       return c - '0';
1060       c = TOLOWER_ASC(c);
1061       if (c >= 'a' && c <= 'f')
1062 !       return c - 'a' + 10;
1063 !     return -1000;
1064   }
1065   
1066   
1067 ***************
1068 *** 2065,2077 ****
1069         b = hex_digit( name[5] ) * 16 + hex_digit( name[6] );
1070         if( r < 0 || g < 0 || b < 0 )
1071             return INVALCOLOR;
1072 !       return( RGB( r, g, b ) );
1073       }
1074   
1075       for( i = 0; i < ARRAY_LENGTH( table ); i++ )
1076       {
1077         if( STRICMP( name, table[i].name ) == 0 )
1078 !           return( table[i].colour );
1079       }
1080   
1081       /*
1082 --- 2065,2077 ----
1083         b = hex_digit( name[5] ) * 16 + hex_digit( name[6] );
1084         if( r < 0 || g < 0 || b < 0 )
1085             return INVALCOLOR;
1086 !       return RGB(r, g, b);
1087       }
1088   
1089       for( i = 0; i < ARRAY_LENGTH( table ); i++ )
1090       {
1091         if( STRICMP( name, table[i].name ) == 0 )
1092 !           return table[i].colour;
1093       }
1094   
1095       /*
1096 ***************
1097 *** 2115,2121 ****
1098             if (STRICMP(color, name) == 0)
1099             {
1100                 fclose(fd);
1101 !               return( (guicolor_T) RGB(r,g,b) );
1102             }
1103         }
1104   
1105 --- 2115,2121 ----
1106             if (STRICMP(color, name) == 0)
1107             {
1108                 fclose(fd);
1109 !               return (guicolor_T)RGB(r, g, b);
1110             }
1111         }
1112   
1113 ***************
1114 *** 2451,2458 ****
1115       for (i = 0; special_keys[i].key_sym != 0; i++)
1116         if (name[0] == special_keys[i].vim_code0 &&
1117                  name[1] == special_keys[i].vim_code1)
1118 !           return( OK );
1119 !     return( FAIL );
1120   }
1121   
1122   /****************************************************************************/
1123 --- 2451,2458 ----
1124       for (i = 0; special_keys[i].key_sym != 0; i++)
1125         if (name[0] == special_keys[i].vim_code0 &&
1126                  name[1] == special_keys[i].vim_code1)
1127 !           return OK;
1128 !     return FAIL;
1129   }
1130   
1131   /****************************************************************************/
1132 ***************
1133 *** 2512,2518 ****
1134   
1135         temp_phi = &external_icon;
1136       }
1137 !     return( temp_phi );
1138   }
1139   
1140   /*
1141 --- 2512,2518 ----
1142   
1143         temp_phi = &external_icon;
1144       }
1145 !     return temp_phi;
1146   }
1147   
1148   /*
1149 ***************
1150 *** 2541,2556 ****
1151             icon = gui_ph_toolbar_load_icon( full_pathname );
1152   
1153         if( icon != NULL )
1154 !           return( icon );
1155       }
1156   
1157       if( menu->iconidx >= 0 &&
1158             ( menu->iconidx < ARRAY_LENGTH( gui_ph_toolbar_images ) ) )
1159       {
1160 !       return( gui_ph_toolbar_images[ menu->iconidx ] );
1161       }
1162   
1163 !     return( NULL );
1164   }
1165   #endif
1166   
1167 --- 2541,2556 ----
1168             icon = gui_ph_toolbar_load_icon( full_pathname );
1169   
1170         if( icon != NULL )
1171 !           return icon;
1172       }
1173   
1174       if( menu->iconidx >= 0 &&
1175             ( menu->iconidx < ARRAY_LENGTH( gui_ph_toolbar_images ) ) )
1176       {
1177 !       return gui_ph_toolbar_images[menu->iconidx];
1178       }
1179   
1180 !     return NULL;
1181   }
1182   #endif
1183   
1184 ***************
1185 *** 2895,2905 ****
1186              * at least has the bits we're checking for */
1187             if( font_size == info.size &&
1188                     style == (info.style & style) )
1189 !               return( (GuiFont) font_tag );
1190         }
1191         vim_free( font_tag );
1192       }
1193 !     return( NULL );
1194   }
1195   
1196   /*
1197 --- 2895,2905 ----
1198              * at least has the bits we're checking for */
1199             if( font_size == info.size &&
1200                     style == (info.style & style) )
1201 !               return (GuiFont)font_tag;
1202         }
1203         vim_free( font_tag );
1204       }
1205 !     return NULL;
1206   }
1207   
1208   /*
1209 ***************
1210 *** 2957,2965 ****
1211                 }
1212             }
1213         }
1214 !       return( TRUE );
1215       }
1216 !     return( FALSE );
1217   }
1218   
1219       int
1220 --- 2957,2965 ----
1221                 }
1222             }
1223         }
1224 !       return TRUE;
1225       }
1226 !     return FALSE;
1227   }
1228   
1229       int
1230 ***************
1231 *** 2985,2991 ****
1232                 "pcterm12", -1, PHFONT_FIXED, NULL );
1233   
1234         if( font_tag == NULL )
1235 !           return( FAIL );
1236   
1237         gui_mch_free_font( gui.norm_font );
1238         gui.norm_font = font_tag;
1239 --- 2985,2991 ----
1240                 "pcterm12", -1, PHFONT_FIXED, NULL );
1241   
1242         if( font_tag == NULL )
1243 !           return FAIL;
1244   
1245         gui_mch_free_font( gui.norm_font );
1246         gui.norm_font = font_tag;
1247 ***************
1248 *** 2997,3009 ****
1249       {
1250         if( gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags,
1251                     &font_size ) == FALSE )
1252 !           return( FAIL );
1253   
1254         font_tag = gui_ph_get_font( font_name, font_flags, font_size, 0 );
1255         if( font_tag == NULL )
1256         {
1257             vim_free( font_name );
1258 !           return( FAIL );
1259         }
1260   
1261         gui_mch_free_font( gui.norm_font );
1262 --- 2997,3009 ----
1263       {
1264         if( gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags,
1265                     &font_size ) == FALSE )
1266 !           return FAIL;
1267   
1268         font_tag = gui_ph_get_font( font_name, font_flags, font_size, 0 );
1269         if( font_tag == NULL )
1270         {
1271             vim_free( font_name );
1272 !           return FAIL;
1273         }
1274   
1275         gui_mch_free_font( gui.norm_font );
1276 ***************
1277 *** 3026,3032 ****
1278       gui.char_ascent = - extent.ul.y;
1279   
1280       vim_free( font_name );
1281 !     return( OK );
1282   }
1283   
1284   /*
1285 --- 3026,3032 ----
1286       gui.char_ascent = - extent.ul.y;
1287   
1288       vim_free( font_name );
1289 !     return OK;
1290   }
1291   
1292   /*
1293 ***************
1294 *** 3042,3048 ****
1295       gui.char_height = - info.ascender + info.descender + p_linespace;
1296       gui.char_ascent = - info.ascender + p_linespace / 2;
1297   
1298 !     return( OK );
1299   }
1300   
1301       GuiFont
1302 --- 3042,3048 ----
1303       gui.char_height = - info.ascender + info.descender + p_linespace;
1304       gui.char_ascent = - info.ascender + p_linespace / 2;
1305   
1306 !     return OK;
1307   }
1308   
1309       GuiFont
1310 ***************
1311 *** 3060,3072 ****
1312         vim_free( font_name );
1313   
1314         if( font_tag != NULL )
1315 !           return( (GuiFont) font_tag );
1316       }
1317   
1318       if( report_error )
1319         EMSG2(e_font, vim_font_name );
1320   
1321 !     return( FAIL );
1322   }
1323   
1324   #if defined(FEAT_EVAL) || defined(PROTO)
1325 --- 3060,3072 ----
1326         vim_free( font_name );
1327   
1328         if( font_tag != NULL )
1329 !           return (GuiFont)font_tag;
1330       }
1331   
1332       if( report_error )
1333         EMSG2(e_font, vim_font_name );
1334   
1335 !     return FAIL;
1336   }
1337   
1338   #if defined(FEAT_EVAL) || defined(PROTO)
1339 *** ../vim-7.3.261/src/version.c        2011-07-27 13:59:12.000000000 +0200
1340 --- src/version.c       2011-07-27 14:08:08.000000000 +0200
1341 ***************
1342 *** 711,712 ****
1343 --- 711,714 ----
1344   {   /* Add new patch number below this line */
1345 + /**/
1346 +     262,
1347   /**/
1348
1349 -- 
1350 You know you use Vim too much when you have this alias in your
1351 ~/.bashrc file: alias :e=/bin/vim             (Eljay Love-Jensen)
1352
1353  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
1354 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
1355 \\\  an exciting new programming language -- http://www.Zimbu.org        ///
1356  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.14059 seconds and 3 git commands to generate.