illume avatar illume committed 3b0f4cc

Patches from Marcus for scrap. This gets windows bitmap support working.

Comments (0)

Files changed (7)

 
 
 #--StartConfig
-SDL = -I/usr/include/SDL -D_REENTRANT -lSDL -CW -CWall
+SDL = -I/usr/include/SDL -D_REENTRANT -lSDL
 FONT = -lSDL_ttf
 IMAGE = -lSDL_image
 MIXER = -lSDL_mixer
 PNG = -lpng
 JPEG = -ljpeg
 NUMERIC = -I/usr/include/python2.4/Numeric
-X11 = -lX11
+SCRAP = -lX11
 #--EndConfig
 
 #DEBUG = -C-W -C-Wall
 surfarray src/surfarray.c $(SDL) $(NUMERIC) $(DEBUG)
 sndarray src/sndarray.c $(SDL) $(NUMERIC) $(MIXER) $(DEBUG)
 movie src/movie.c $(SDL) $(SMPEG) $(DEBUG)
-scrap src/scrap.c $(SDL) $(X11) $(DEBUG)
+scrap src/scrap.c $(SDL) $(SCRAP) $(DEBUG)
 
 #experimental new movie movie. requires libavcodec and libavformat.
 #add any necessary compile flags to this line and uncomment.
             return 1
     return 0
 
-
 if sys.platform == 'win32' and not is_msys_mingw():
     print 'Using WINDOWS configuration...\n'
     import config_win
     import config_unix
     CFG = config_unix
 
-
-
-
 def confirm(message):
     "ask a yes/no question, return result"
     reply = raw_input('\n' + message + ' [y/N]:')
         return 1
     return 0
 
-
-
 def prepdep(dep, basepath):
     "add some vars to a dep"
-    if dep.lib:
-        dep.line = dep.name + ' = -l' + dep.lib
+    if dep.libs:
+        dep.line = dep.name + ' ='
+        for lib in dep.libs:
+            dep.line += ' -l' + lib
     else:
         dep.line = dep.name + ' = -I.'
     
     else:
         if dep.inc_dir: inc = ' -I' + dep.inc_dir
         if dep.lib_dir: lid = ' -L' + dep.lib_dir
-    if dep.lib: lib = ' -l'+dep.lib
-    dep.line = dep.name+' =' + inc + lid + ' ' + dep.cflags + lib
-
-
+    libs = ''
+    for lib in dep.libs: 
+        libs += ' -l' + lib
+    dep.line = dep.name+' =' + inc + lid + ' ' + dep.cflags + libs
 
 def writesetupfile(deps, basepath):
     "create a modified copy of Setup.in"
         if useit:
             newsetup.write(line)
 
-
-
-
 def main():
     if os.path.isfile('Setup'):
         if "-auto" in sys.argv or confirm('Backup existing "Setup" file'):
         print """\nThere was an error creating the Setup file, check for errors
 or make a copy of "Setup.in" and edit by hand."""
 
-
-
 if __name__ == '__main__': main()
 
 class Dependency:
     libext = '.a'
-    def __init__(self, name, checkhead, checklib, lib):
+    def __init__(self, name, checkhead, checklib, libs):
         self.name = name
         self.inc_dir = None
         self.lib_dir = None
-        self.lib = lib
+        self.libs = libs
         self.found = 0
         self.checklib = checklib + self.libext
         self.checkhead = checkhead
         BASE_DIRS = '/', os.path.expanduser('~/'), '/System/'
         for n in BASE_DIRS:
             n += 'Library/Frameworks/'
-            fmwk = n + self.lib + '.framework/Versions/Current/'
-            if os.path.isfile(fmwk + self.lib):
-                print 'Framework ' + self.lib + ' found'
+            fmwk = n + self.libs + '.framework/Versions/Current/'
+            if os.path.isfile(fmwk + self.libs):
+                print 'Framework ' + self.libs + ' found'
                 self.found = 1
                 self.inc_dir = fmwk + 'Headers'
                 self.cflags = (
-                    '-Xlinker "-framework" -Xlinker "' + self.lib + '"' +
+                    '-Xlinker "-framework" -Xlinker "' + self.libs + '"' +
                     ' -Xlinker "-F' + n + '"')
-                self.origlib = self.lib
-                self.lib = ''
+                self.origlib = self.libs
+                self.libs = ''
                 return
-        print 'Framework ' + self.lib + ' not found'
+        print 'Framework ' + self.libs + ' not found'
 
 
 class DependencyPython:
         self.name = name
         self.lib_dir = ''
         self.inc_dir = ''
-        self.lib = ''
+        self.libs = []
         self.cflags = ''
         self.found = 0
         self.ver = '0'
     FrameworkDependency('MIXER', 'SDL_mixer.h', 'libSDL_mixer', 'SDL_mixer'),
     FrameworkDependency('SMPEG', 'smpeg.h', 'libsmpeg', 'smpeg'),
     DependencyPython('NUMERIC', 'Numeric', 'Numeric/arrayobject.h'),
-    Dependency('PNG', 'png.h', 'libpng', 'png'),
-    Dependency('JPEG', 'jpeglib.h', 'libjpeg', 'jpeg'),
+    Dependency('PNG', 'png.h', 'libpng', ['png']),
+    Dependency('JPEG', 'jpeglib.h', 'libjpeg', ['jpeg']),
+    Dependency('SCRAP', '','',[])
 ]
 
 
                'include/smpeg' ]
 origlibdirs = ['/lib']
 
-
-
-
 def confirm(message):
     "ask a yes/no question, return result"
     reply = raw_input('\n' + message + ' [Y/n]:')
         return 0
     return 1
 
-
-
-
 class DependencyProg:
-    def __init__(self, name, envname, exename, minver, defaultlib):
+    def __init__(self, name, envname, exename, minver, defaultlibs):
         self.name = name
         command = os.environ.get(envname, exename)
         self.lib_dir = ''
         self.inc_dir = ''
-        self.lib = ''
+        self.libs = []
         self.cflags = ''
         try:
             config = os.popen(command + ' --version --cflags --libs').readlines()
             self.found = 1
             self.cflags = ''
             for f in flags:
-                #if f[:2] == '-L':
-                #    self.lib_dir += f[2:] + ' '
-                #elif f[:2] == 'I':
-                #    self.inc_dir += f[2:] + ' '
                 if f[:2] in ('-l', '-D', '-I', '-L'):
                     self.cflags += f + ' '
                 elif f[:3] == '-Wl':
             print 'WARNING: "%s" failed!' % command    
             self.found = 0
             self.ver = '0'
-            self.lib = defaultlib
+            self.libs = defaultlibs
 
     def configure(self, incdirs, libdir):
         if self.found:
         else:
             print self.name + '        '[len(self.name):] + ': not found'
 
-                    
 class Dependency:
-    def __init__(self, name, checkhead, checklib, lib):
+    def __init__(self, name, checkhead, checklib, libs):
         self.name = name
         self.inc_dir = None
         self.lib_dir = None
-        self.lib = lib
+        self.libs = libs
         self.found = 0
         self.checklib = checklib
         self.checkhead = checkhead
         self.name = name
         self.lib_dir = ''
         self.inc_dir = ''
-        self.lib = ''
+        self.libs = []
         self.cflags = ''
         self.found = 0
         self.ver = '0'
         else:
             print self.name + '        '[len(self.name):] + ': not found'
 
-
-
 sdl_lib_name = 'SDL'
 if sys.platform.find('bsd') != -1:
     sdl_lib_name = 'SDL-1.1'
 
-
 def main():
     print '\nHunting dependencies...'
     DEPS = [
-        DependencyProg('SDL', 'SDL_CONFIG', 'sdl-config', '1.2', 'sdl'),
-        Dependency('FONT', 'SDL_ttf.h', 'libSDL_ttf.so', 'SDL_ttf'),
-        Dependency('IMAGE', 'SDL_image.h', 'libSDL_image.so', 'SDL_image'),
-        Dependency('MIXER', 'SDL_mixer.h', 'libSDL_mixer.so', 'SDL_mixer'),
-        DependencyProg('SMPEG', 'SMPEG_CONFIG', 'smpeg-config', '0.4.3', 'smpeg'),
+        DependencyProg('SDL', 'SDL_CONFIG', 'sdl-config', '1.2', ['sdl']),
+        Dependency('FONT', 'SDL_ttf.h', 'libSDL_ttf.so', ['SDL_ttf']),
+        Dependency('IMAGE', 'SDL_image.h', 'libSDL_image.so', ['SDL_image']),
+        Dependency('MIXER', 'SDL_mixer.h', 'libSDL_mixer.so', ['SDL_mixer']),
+        DependencyProg('SMPEG', 'SMPEG_CONFIG', 'smpeg-config', '0.4.3', ['smpeg']),
         DependencyPython('NUMERIC', 'Numeric', 'Numeric/arrayobject.h')
     ]
 
 
     return DEPS
 
-    
 if __name__ == '__main__':
     print """This is the configuration subscript for Unix.
 Please run "config.py" for full configuration."""
 #these get prefixes with '/usr' and '/usr/local' or the $LOCALBASE
 origincdirs = ['/include', '/include/SDL', '/include/SDL',
                '/include/smpeg' ]
-origlibdirs = ['/lib','/lib64']
-
-
+origlibdirs = ['/lib','/lib64','/X11R6/lib']
 
 def confirm(message):
     "ask a yes/no question, return result"
         return 0
     return 1
 
-
-
-
 class DependencyProg:
-    def __init__(self, name, envname, exename, minver, defaultlib):
+    def __init__(self, name, envname, exename, minver, defaultlibs):
         self.name = name
         command = os.environ.get(envname, exename)
         self.lib_dir = ''
         self.inc_dir = ''
-        self.lib = ''
+        self.libs = []
         self.cflags = ''
         try:
             config = os.popen(command + ' --version --cflags --libs').readlines()
             self.found = 1
             self.cflags = ''
             for f in flags:
-                #if f[:2] == '-L':
-                #    self.lib_dir += f[2:] + ' '
-                #elif f[:2] == 'I':
-                #    self.inc_dir += f[2:] + ' '
                 if f[:2] in ('-l', '-D', '-I', '-L'):
                     self.cflags += f + ' '
                 elif f[:3] == '-Wl':
             print 'WARNING: "%s" failed!' % command    
             self.found = 0
             self.ver = '0'
-            self.lib = defaultlib
+            self.libs = defaultlibs
 
     def configure(self, incdirs, libdir):
         if self.found:
         else:
             print self.name + '        '[len(self.name):] + ': not found'
 
-                    
 class Dependency:
-    def __init__(self, name, checkhead, checklib, lib):
+    def __init__(self, name, checkhead, checklib, libs):
         self.name = name
         self.inc_dir = None
         self.lib_dir = None
-        self.lib = lib
+        self.libs = libs
         self.found = 0
         self.checklib = checklib
         self.checkhead = checkhead
                 path = os.path.join(dir, name)
                 if filter(os.path.isfile, glob(path+'*')):
                     self.lib_dir = dir
-        
 
-        
         if (incname and self.lib_dir and self.inc_dir) or (not incname and self.lib_dir):
             print self.name + '        '[len(self.name):] + ': found'
             self.found = 1
         self.name = name
         self.lib_dir = ''
         self.inc_dir = ''
-        self.lib = ''
+        self.libs = []
         self.cflags = ''
         self.found = 0
         self.ver = '0'
         else:
             print self.name + '        '[len(self.name):] + ': not found'
 
-
-
 sdl_lib_name = 'SDL'
-if sys.platform.find('bsd') != -1:
-    sdl_lib_name = 'SDL-1.1'
-
 
 def main():
     print '\nHunting dependencies...'
     DEPS = [
-        DependencyProg('SDL', 'SDL_CONFIG', 'sdl-config', '1.2', 'sdl'),
-        Dependency('FONT', 'SDL_ttf.h', 'libSDL_ttf.so', 'SDL_ttf'),
-        Dependency('IMAGE', 'SDL_image.h', 'libSDL_image.so', 'SDL_image'),
-        Dependency('MIXER', 'SDL_mixer.h', 'libSDL_mixer.so', 'SDL_mixer'),
-        DependencyProg('SMPEG', 'SMPEG_CONFIG', 'smpeg-config', '0.4.3', 'smpeg'),
+        DependencyProg('SDL', 'SDL_CONFIG', 'sdl-config', '1.2', ['sdl']),
+        Dependency('FONT', 'SDL_ttf.h', 'libSDL_ttf.so', ['SDL_ttf']),
+        Dependency('IMAGE', 'SDL_image.h', 'libSDL_image.so', ['SDL_image']),
+        Dependency('MIXER', 'SDL_mixer.h', 'libSDL_mixer.so', ['SDL_mixer']),
+        DependencyProg('SMPEG', 'SMPEG_CONFIG', 'smpeg-config', '0.4.3', ['smpeg']),
         DependencyPython('NUMERIC', 'Numeric', 'Numeric/arrayobject.h'),
-        Dependency('PNG', 'png.h', 'libpng', 'png'),
-        Dependency('JPEG', 'jpeglib.h', 'libjpeg', 'jpeg'),
-        Dependency('X11', '', 'libX11', 'X11'),
+        Dependency('PNG', 'png.h', 'libpng', ['png']),
+        Dependency('JPEG', 'jpeglib.h', 'libjpeg', ['jpeg']),
+        Dependency('SCRAP', '', 'libX11', ['X11']),
     ]
 
     if not DEPS[0].found:
     incdirs += ["/usr/local"+d for d in origincdirs]
     libdirs += ["/usr/local"+d for d in origlibdirs]
 
-    # some stuff for X11 on freebsd.
-    incdirs += ["/usr/X11R6"+d for d in origincdirs]
-    libdirs += ["/usr/X11R6"+d for d in origlibdirs]
-
     for arg in string.split(DEPS[0].cflags):
         if arg[:2] == '-I':
             incdirs.append(arg[2:])
     for d in DEPS:
         d.configure(incdirs, libdirs)
 
-
     for d in DEPS[1:]:
         if not d.found:
             if not confirm("""
 
     return DEPS
 
-    
 if __name__ == '__main__':
     print """This is the configuration subscript for Unix.
 Please run "config.py" for full configuration."""
 
 huntpaths = ['..', '..\\..', '..\\*', '..\\..\\*']
 
-
 class Dependency:
     inc_hunt = ['include']
     lib_hunt = ['VisualC\\SDL\\Release', 'VisualC\\Release', 'Release', 'lib']
-    def __init__(self, name, wildcard, lib, required = 0):
+    def __init__(self, name, wildcards, libs, required = 0):
         self.name = name
-        self.wildcard = wildcard
+        self.wildcards = wildcards
         self.required = required
         self.paths = []
         self.path = None
         self.inc_dir = None
         self.lib_dir = None
-        self.lib = lib
+        self.libs = libs
         self.found = 0
         self.cflags = ''
                  
     def hunt(self):
         parent = os.path.abspath('..')
         for p in huntpaths:
-            found = glob(os.path.join(p, self.wildcard))
-            found.sort() or found.reverse()  #reverse sort
-            for f in found:
-                if f[:5] == '..'+os.sep+'..' and os.path.abspath(f)[:len(parent)] == parent:
-                    continue
-                if os.path.isdir(f):
-                    self.paths.append(f)
+            for w in self.wildcards:
+                found = glob(os.path.join(p, w))
+                found.sort() or found.reverse()  #reverse sort
+                for f in found:
+                    if f[:5] == '..'+os.sep+'..' and \
+                        os.path.abspath(f)[:len(parent)] == parent:
+                        continue
+                    if os.path.isdir(f):
+                        self.paths.append(f)
 
     def choosepath(self):
         if not self.paths:
             self.inc_dir = self.findhunt(self.path, Dependency.inc_hunt)
             self.lib_dir = self.findhunt(self.path, Dependency.lib_hunt)
 
-
 class DependencyPython:
     def __init__(self, name, module, header):
         self.name = name
         self.lib_dir = ''
         self.inc_dir = ''
-        self.lib = ''
+        self.libs = []
         self.cflags = ''
         self.found = 0
         self.ver = '0'
         else:
             print self.name + '        '[len(self.name):] + ': not found'
 
-
-
 DEPS = [
-    Dependency('SDL', 'SDL-[0-9].*', 'SDL', 1),
-    Dependency('FONT', 'SDL_ttf-[0-9].*', 'SDL_ttf'),
-    Dependency('IMAGE', 'SDL_image-[0-9].*', 'SDL_image'),
-    Dependency('MIXER', 'SDL_mixer-[0-9].*', 'SDL_mixer'),
-    Dependency('SMPEG', 'smpeg-[0-9].*', 'smpeg'),
+    Dependency('SDL', ['SDL-[0-9].*'], ['SDL'], 1),
+    Dependency('FONT', ['SDL_ttf-[0-9].*'], ['SDL_ttf']),
+    Dependency('IMAGE', ['SDL_image-[0-9].*'], ['SDL_image']),
+    Dependency('MIXER', ['SDL_mixer-[0-9].*'], ['SDL_mixer']),
+    Dependency('SMPEG', ['smpeg-[0-9].*'], ['smpeg']),
+    Dependency('SCRAP', ['user32.*', 'gdi32.*'], ['user32', 'gdi32']),
     DependencyPython('NUMERIC', 'Numeric', 'Numeric/arrayobject.h'),
 ]
 
-
 def setup_prebuilt():
     setup = open('Setup', 'w')
     for line in open('Setup.in').readlines():
         if line[:3] == '#--': continue
         if line[:6] == 'SDL = ':
             line = 'SDL = -Iprebuilt/include -Lprebuilt/lib -lSDL\n'
+        if line[:8] == 'SCRAP = ':
+            line = 'SCRAP = -luser32 -lgdi32\n'
         setup.write(line)
 
 
 
     return DEPS    
 
-
-
-
 if __name__ == '__main__':
     print """This is the configuration subscript for Windows.
 Please run "config.py" for full configuration."""
     if (strcmp (type, "image/tiff") == 0)
         return CF_TIFF;
     if (strcmp (type, PYGAME_SCRAP_BMP) == 0)
-        return CF_BITMAP;
+        return CF_DIB;
     if (strcmp (type, "audio/wav") == 0)
         return CF_WAVE;
     return -1;
         len = 10;
         cpy = "image/tiff";
         break;
-    case CF_BITMAP:
+    case CF_DIB:
         len = strlen (PYGAME_SCRAP_BMP);
         cpy = PYGAME_SCRAP_BMP;
         break;
         len = GetClipboardFormatName (format, buf, size);
         return len;
     }
-    if (len != 0 )
+    if (len != 0)
         memcpy (buf, cpy, len);
     return len;
 }
 
+/**
+ * \brief Creates a BMP character buffer with all headers from a DIB
+ *        HANDLE. The caller has to free the returned buffer.
+ * \param data The DIB handle data.
+ * \param count The size of the DIB handle.
+ * \return The character buffer containing the BMP information.
+ */
+static char*
+_create_dib_buffer (char* data, unsigned long *count)
+{
+    BITMAPFILEHEADER hdr;
+    LPBITMAPINFOHEADER bihdr;
+    char *buf;
+
+    if (!data)
+        return NULL;
+    bihdr = (LPBITMAPINFOHEADER) data;
+
+    /* Create the BMP header. */
+    hdr.bfType = 'M' << 8 | 'B'; /* Specs say, it is always BM */
+	hdr.bfReserved1 = 0;
+	hdr.bfReserved2 = 0;
+	hdr.bfSize = (DWORD) (sizeof (BITMAPFILEHEADER) + bihdr->biSize
+                             + bihdr->biClrUsed * sizeof (RGBQUAD)
+                             + bihdr->biSizeImage);
+    hdr.bfOffBits = (DWORD) (sizeof (BITMAPFILEHEADER) + bihdr->biSize
+                             + bihdr->biClrUsed * sizeof (RGBQUAD));
+
+    /* Copy both to the buffer. */
+    buf = malloc (sizeof (hdr) + (*count));
+    if (!buf)
+        return NULL;
+    memcpy (buf, &hdr, sizeof (hdr));
+    memcpy (buf + sizeof (BITMAPFILEHEADER), data, *count);
+
+    /* Increase count for the correct size. */
+    *count += sizeof (hdr);
+    return buf;
+}
+
 int
 pygame_scrap_init (void)
 {
     if (retval)
         _scrapinitialized = 1;
     
-    _format_MIME_PLAIN = RegisterClipboardFormat ("text/plain");
+    _format_MIME_PLAIN = RegisterClipboardFormat (PYGAME_SCRAP_TEXT);
     return retval;
 }
 
         return 0;
     }
 
-    format = _convert_format (type);
+    format = _convert_internal_type (type);
+    if (format == -1)
+        format = _convert_format (type);
 
     if (!OpenClipboard (SDL_Window))
         return 0; /* Could not open the clipboard. */
     
+    if (format == CF_DIB || format == CF_DIBV5)
+        nulledlen -= sizeof (BITMAPFILEHEADER); /* We won't copy the header */
+    
     hMem = GlobalAlloc ((GMEM_MOVEABLE | GMEM_DDESHARE), nulledlen);
     if (hMem)
     {
         char *dst = GlobalLock (hMem);
 
         memset (dst, 0, nulledlen);
-        memcpy (dst, src, srclen);
+        if (format == CF_DIB || format == CF_DIBV5)
+            memcpy (dst, src + sizeof (BITMAPFILEHEADER), nulledlen - 1);
+        else
+            memcpy (dst, src, srclen);
 
         GlobalUnlock (hMem);
         EmptyClipboard ();
             /* Setting SCRAP_TEXT, also set CF_TEXT. */
             SetClipboardData (CF_TEXT, hMem);
         }
-        CloseClipboard ();
     }
     else
     {
         CloseClipboard ();
         return 0;
     }
-
+    
+    CloseClipboard ();
     return 1;
 }
 
+
+
 char*
 pygame_scrap_get (char *type, unsigned long *count)
 {
         /* The format was not found - was it a mapped type? */
         format = _convert_internal_type (type);
         if (format == -1)
+        {
+            CloseClipboard ();
             return NULL;
+        }
     }
 
     if (IsClipboardFormatAvailable (format))
         if (hMem)
         {
             *count = 0;
+
+            /* CF_BITMAP is not a global, so do not lock it. */
+            if (format != CF_BITMAP)
+            {
+                src = GlobalLock (hMem);
+                if (!src)
+                {
+                    CloseClipboard ();
+                    return NULL;
+                }
+                *count = GlobalSize (hMem);
+            }
             
-            /* TODO: Is there any mechanism to detect the amount of bytes
-             * in the HANDLE? strlen() won't work as supposed, if the
-             * sequence contains NUL bytes. Can this even happen in the 
-             * Win32 clipboard or is NUL the usual delimiter?
-             */
-            src = GlobalLock (hMem);
-            *count = strlen (src) + 1;
-            
-            retval = malloc (*count);
-            if (retval)
+            if (format == CF_DIB || format == CF_DIBV5)
             {
-                memset (retval, 0, *count);
-                memcpy (retval, src, *count);
+                /* Count will be increased accordingly in
+                 * _create_dib_buffer.
+                 */
+                src = _create_dib_buffer (src, count);
+                GlobalUnlock (hMem);
+                CloseClipboard ();
+                return src;
+            }
+            else  if (*count != 0)
+            {
+                retval = malloc (*count);
+                if (retval)
+                {
+                    memset (retval, 0, *count);
+                    memcpy (retval, src, *count);
+                }
             }
             GlobalUnlock (hMem);
         }
-        CloseClipboard ();
     }
-    
+
+    CloseClipboard ();
     return retval;
 }
 
 
     if (!OpenClipboard (SDL_Window))
         return NULL;
+
     size = CountClipboardFormats ();
     if (size == 0)
+    {
+        CloseClipboard ();
         return NULL; /* No clipboard data. */
+    }
 
-    //types = malloc (sizeof (char *) * (size + 1));
     for (i = 0; i < size; i++)
     {
         format = EnumClipboardFormats (format);
             while (i > 0)
                 free (types[i]);
             free (types);
+            CloseClipboard ();
             return NULL;
-            break;
         }
 
         /* No predefined name, get the (truncated) name. */
                 count--;
             }
             free (types);
+            CloseClipboard ();
             return NULL;
         }
         types = tmptypes;
                 count--;
             }
             free (types);
+            CloseClipboard ();
             return NULL;
         }
 
         memset (types[count], 0, len + 1);
         memcpy (types[count], tmp, len);
     }
+
     tmptypes = realloc (types, sizeof (char *) * (count + 1));
     if (!tmptypes)
     {
             count--;
         }
         free (types);
+        CloseClipboard ();
         return NULL;
     }
     types = tmptypes;
     types[count] = NULL;
+    CloseClipboard ();
     return types;
 }
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.