If you invent a warp drive you will be awarded a patent over the implementation of it, that was never explained in ST for obvious reasons. So if you invent a real one, built to look exactly like the Star Trek one with an "interface" very similar to the one in the serie, and try to patent it's design and "interface", then Star Trek's warp drive will be prior art (for the design and interface, not the way it works).
See, not all patents are of the exact same kind, and there's a lot of things to patent about any thing. That's the problem... nowadays things that shouldn't be patented, like designs and user interfaces (even algorithms), are.