home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.0.202 < prev    next >
Encoding:
Internet Message Format  |  2002-02-06  |  3.3 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.202
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.0.202
  11. Problem:    The "icon=" argument for the menu command to define a toolbar icon
  12.         with a file didn't work for GTK. (Christian J. Robinson)
  13.         For Motif and Athena a full path was required.
  14. Solution:   Search the icon file using the specified path.  Expand environment
  15.         variables in the file name.
  16. Files:        src/gui_gtk.c, src/gui_x11.c
  17.  
  18.  
  19. *** ../vim60.201/src/gui_gtk.c    Sun Feb  3 15:27:26 2002
  20. --- src/gui_gtk.c    Thu Feb  7 22:37:33 2002
  21. ***************
  22. *** 400,405 ****
  23. --- 400,422 ----
  24.           &gui.mainwin->style->bg[GTK_STATE_NORMAL],
  25.           (const char *)full_pathname);
  26.   }
  27. + /*
  28. +  * Creates a pixmap by using the pixmap "file".
  29. +  */
  30. +     static void
  31. + pixmap_create_from_file(char_u *file, GdkPixmap **pixmap, GdkBitmap **mask)
  32. + {
  33. +     char_u full_pathname[MAXPATHL + 1];
  34. +     expand_env(file, full_pathname, MAXPATHL);
  35. +     *pixmap = gdk_pixmap_colormap_create_from_xpm(
  36. +         NULL,
  37. +         gtk_widget_get_colormap(gui.mainwin),
  38. +         mask,
  39. +         &gui.mainwin->style->bg[GTK_STATE_NORMAL],
  40. +         (const char *)full_pathname);
  41. + }
  42.   #endif
  43.   
  44.   /*ARGSUSED*/
  45. ***************
  46. *** 421,427 ****
  47.           GdkBitmap *mask = NULL;
  48.   
  49.           /* First try user specified bitmap, then builtin, the a blank. */
  50. !         if (!menu->icon_builtin)
  51.           pixmap_create_by_dir(menu->name, &pixmap, &mask);
  52.           if (pixmap == NULL && menu->iconidx >= 0)
  53.           pixmap_create_by_num(menu->iconidx, &pixmap, &mask);
  54. --- 438,446 ----
  55.           GdkBitmap *mask = NULL;
  56.   
  57.           /* First try user specified bitmap, then builtin, the a blank. */
  58. !         if (menu->iconfile != NULL)
  59. !         pixmap_create_from_file(menu->iconfile, &pixmap, &mask);
  60. !         if (pixmap == NULL && !menu->icon_builtin)
  61.           pixmap_create_by_dir(menu->name, &pixmap, &mask);
  62.           if (pixmap == NULL && menu->iconidx >= 0)
  63.           pixmap_create_by_num(menu->iconidx, &pixmap, &mask);
  64. *** ../vim60.201/src/gui_x11.c    Tue Feb  5 21:59:55 2002
  65. --- src/gui_x11.c    Thu Feb  7 22:45:44 2002
  66. ***************
  67. *** 3450,3456 ****
  68.       {
  69.       /* Use the file argument: first as an absolute path (with extension),
  70.        * then as a file name (without extension). */
  71. !     createXpmImages(menu->iconfile, NULL, sen, insen);
  72.       if (*sen == (Pixmap)0
  73.           && gui_find_bitmap(menu->name, buf, "xpm") == OK
  74.           && buf[0] != NUL)
  75. --- 3450,3457 ----
  76.       {
  77.       /* Use the file argument: first as an absolute path (with extension),
  78.        * then as a file name (without extension). */
  79. !     expand_env(menu->iconfile, buf, MAXPATHL);
  80. !     createXpmImages(buf, NULL, sen, insen);
  81.       if (*sen == (Pixmap)0
  82.           && gui_find_bitmap(menu->name, buf, "xpm") == OK
  83.           && buf[0] != NUL)
  84. *** ../vim60.201/src/version.c    Thu Feb  7 22:18:19 2002
  85. --- src/version.c    Thu Feb  7 22:40:35 2002
  86. ***************
  87. *** 608,609 ****
  88. --- 608,611 ----
  89.   {   /* Add new patch number below this line */
  90. + /**/
  91. +     202,
  92.   /**/
  93.  
  94. -- 
  95. Life would be so much easier if we could just look at the source code.
  96.  
  97.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  98. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  99.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  100.