How to implement a DLNA UPNP control point in Xcode 4.6.3? - xcode4.6

Title says it all. How do I start?
I thought I can get help from Linn (oss.linn.co.uk), but I can not find any link to their source code.

If you want to use Linn's code you'll have to register as a developer with them. See the bottom of the Developer Programme page for details.
Recent and all future Linn UI products will replace their OSS UPnP stack with ohNet however so you'd be better using that. ohNet is available as open source and is liberally licensed so suitable for inclusion in open or closed, commercial projects. It is written in C++ with the option of C bindings for its public APIs so will be much easier to deploy on Mac/iOS than the OSS stack which is written in C#. This would however leave you needing to port their C# app to Objective C...
Disclaimer: I contribute to ohNet so may not be considered entirely unbiased.

Related

Styled cross-platform native widgets and windows [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm looking for a reasonably cross-platform way to render windows and widgets and style them the way I want without losing the ability to interface with the OS-preferred ways of doing things like redrawing or text input. I am also keen on knowing how Photoshop did this on Windows, as a concrete example.
I'm writing a program primarily for myself but I want to leave open a possibility to share it with others afterwards if it would be useful for more people. I want to really customize its look-and-feel but would like to keep it using native GUI libraries, such as windows forms or something more specific than just rendering my inerface to X11 windows. As I have to use it both on Windows and X11 the solution would preferably be cross-platform but I'm ready to implement multiple UI front-ends if needed, too, if it would provide reasonably consistent looks on both systems. OSX support is a plus, but really far from mandatory. I don't see myself porting this to OSX quite yet. I have barely started.
The reason I want theming is simple: I like dark themes because they are very relaxing to my eyes. On Windows, Microsoft Visual Studio and Adobe Photoshop (Photoshop as the only one and VS by default) display a dark theme and I find it enjoyable to work with these pieces of software for the sole rest that my eyes get. However, both of these, as it seems, use Windows' native controls (I can get to individual widgets in these using Hawkeye and they seem to have descriptive class names, consistent with what they represent).
I see this done way more on Windows than on X11 systems (GNOME, KDE, XFCE on GNU/Linux), maybe because Windows' theming is as rigid as it can get and on X11 window managers and GUI toolkits (KDE with Qt comes to my mind) are really flexible at that so apps needn't implement their own styles when the user can choose them DE-wide quite freely.
I didn't really do GUI programming at all before so I feel a little lost. I would like to refrain from drawing all GUI in a window with an OpenGL context, because I like the idea of the OS drawing legible, subpixel-level text for me, according to the users' settings, and handling partial window redraws instead of full ones. I would also like to integrate with the operating system with, for example, text input. As I said, I would like to share the software some day, so it'd be nice if I don't have to make fundamental changes beforehand.
I'm using C for core code as I've grown tired of futile OOP (whose most benefits I fail to understand if I'm the only one working on the project) with C++ and just want to write code, but I see that GUI libraries for C are in deficit, so I'm ready to write the GUI front-end in another language and link it against my C object files.
Bottom line, to focus on a multiplatform example, how does Photoshop go about redrawing native Windows widgets? I see it looks very consistent on Windows and Mac. Supporting X11 would be less of a problem, as I wouldn't force my styling in the X11 version, just proxy all through a standard widget library (Gtk+? Qt?) and let the desktop environment/window managers/whatevs style it for me. Though I don't know enough on how window and widget management works on GNU/Linux desktop environments to make assumptions.
Thanks in advance.
NOTE: This is purely anecdotal and based upon my own assumptions.
Due to Photoshop's age, I would assume it uses its own custom, proprietary GUI toolkit. It may use the underlying OS's native toolkit but more than likely it just mimics the look and feel. I know Sublime Text uses a custom toolkit made by the developer.
I have made simple applications with .NET, GTK (PyGTK), and Qt (PySide). If you want to support multiple platforms I'd really recommend using a cross-platform toolkit instead of writing the GUI specific to each OS because of the amount of work involved.
I liked .NET but it's not really cross-platform (I'm not sure what all is supported by Mono).
GTK2 (via PyGTK) was fairly straight forward to us. It looked good on Linux (Ubuntu) but I could not get some custom styles working properly in Windows (unless Windows 95 looks good). I also found PyGTK's documentation lacking. GTK3 is the way forward, but last I knew it was still under heavy development and isn't stable on Windows (yet).
I will say I liked Qt (PySide) the best. I found its documentation and examples better than GTK's. It supports native OS themeing along with custom styles and themes (I don't have personal experience with this though). By default it looks native on both Windows (XP and 7), and Linux (Ubuntu).
I have no experience with wxWidgets so I have no say on it, but it is cross-platform.
I would recommend looking into using Qt, though you would have to use C++ (or a higher-level language with available bindings).

what is the best way to protect .net source code from decompiling

iam developing WPF product. I want to protect my .net source code from reverse enginering
Please advice me
You would use an obfuscator. There are a lot of them on the market, just google.
For example, Visual Studio used to ship with the Dotfuscator Community Edition. I never used it, so I can't say anything about its quality.
This blog post shows the possible ways to try to prevent reverse engineering: http://blogs.msdn.com/b/ericgu/archive/2004/02/24/79236.aspx
In the end it will always be possible to reverse engineer the code. Obfuscation can help but your code will never completely be protected.
The only way to fully protect the code is by not deploying it but instead keeping it on a server.
Obfuscating your assemblies will ensure that it is difficult (if not impossible) to reverse-engineer your compiled assemblies. Obfuscators use techniques like symbol renaming, string encryption, control flow obfuscation to try to obfuscate the meaning of the original code. In some cases, it is even possible to totally hide the code from decompilers (however, decompilers are constantly evolving to overcome this).
Take a look at Crypto Obfuscator.
DISCLAIMER: I work for LogicNP, the developer of Crypto Obfuscator.
You can use FxProtect obfuscator. It successfully supports WPF and Silverlight obfuscation.
You can try it... .NET Obfuscator

Mono with C# - Converting a WinForms interface over to Cocoa? (or whatever the default OS X interface is)

I have a C# app that I've managed to get working with Mono and running on OS X. The application itself runs just fine, but it doesn't really look all that good when run on OS X. The button fonts look jagged, and many of the default features that are there for the Windows 7 version aren't present. To me it sort of looks like a Win98 application with an OS X top border taped to it.
I'm looking into possibly learning Objective-C so that I can write 'proper' OS X apps, but for the moment I'd like to be able to get my projects working on an Apple without having them look Frankensteined together.
Is it possible to convert a WinForms app over to Cocoa? Is Cocoa the correct interface to use?
If possible, what's the best way to go about it, and do any of you know of a good tutorial/writeup on the process to get me started? It'd be nice to see something that actually shows the process being done. I learn far more from example code along with a short explanation than I do from a generic article.
Thanks again!
If you want to create a native looking OSX application, you are correct that you want to use Cocoa. If you still want to use C#, you can use MonoMac.
MonoMac allows you to build your GUI natively on OSX (in fact, using the Interface Builder shipped by Apple), but allows you to write your app in .Net/C#. This way you can continue to use your existing application logic and only have to change the GUI code.
It's pretty much universally true that a ported app will always look like a ported app. Even large companies with huge budgets can't pull off anything better (I cite Adobe - what a mess).
Slapping a Mac face on a Windows app port will show its seams. If you want the application to behave like a native application (and take advantage of the performance-related goodies the platform offers), the absolute best approach is to use the architectural documentation, specs, and requirements I know you have - conscientious developer that you are - to adapt the design to the native platform. That's the Cocoa Frameworks (the API), which are written in Objective-C (the language).
There's quite simply no other path that doesn't end with a crappy-looking port that's riddled with bugs and behavioral problems born of the porter's insufficient familiarity with the target platform. This isn't just limited to Mono/C#-to-Cocoa/Obj-C. The opposite is just as true. Even Java-for-PlatformA-to-Java-for-PlatformB ports of desktop apps suffer these problems. Start with a solid architecture and build for the platform if you want the best user experience.
That said, you're already a step ahead by realizing this and wanting to do better. Bravo! :-) Though I don't know of any tutorials for this path, I'd suggest even that's not the correct approach since you indicated you're looking for quality. Avail yourself of the many Cocoa books and many more online communities (like this one) and learn the platform before committing to your Cocoa-adapted architecture and code base.
Update based on comment debate
To be clear: I'm not saying there's no way or that there's no tool out there that makes it possible. There're actually plenty I've seen but don't recall and won't bother googling. My point remains: the OP is concerned with quality of native appearance (and I assume behavior and possibly performance) and porting tools / translation layers don't achieve this due to inherent differences in the platform's architecture and user experience idioms. The OP suspects it might be best to learn the platform and build specifically for it and I'm agreeing. Your opinion may vary. Have at it.

How to Write a Windows Application? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm very new to programming, and I'd like to write a Windows Application. So far I've read Teach Yourself C in 24 Hours, what should I do (tutorial to read) next to accomplish my goal? Thanks
When I first started developing applications for Windows (about 15 years ago) I recall reading some very useful stuff by Charles Petzold. His more recent books are about C#, but his older books are still relevant because the Win32 API has not changed that much when it comes to the basics.
Hello, World!
Write the famous "Hello, World" program (Google it if unsure):
To output text to the console.
To output text to a dialog window.
To make the dialog appear after selecting a menu item.
Then, if you are still keen:
Write a program that allows a person to type in text into a text field. Display that text in a dialog window after clicking a button.
Save the text to a file.
Write a program to read the file and display its contents in a window.
That should get you started learning the fundamentals of what is happening when writing a Windows application.
Also, read all the links that people recommend you read, in this thread and others.
Old vs. New
Advice for learning .NET, C#, and C++ is great. Those technologies hide a lot of the boring "grunt" work for you. I still feel it is good to have an understanding of what is happening at a lower level for various reasons, including:
Learning C is applicable to more than Windows-based applications (some would argue .NET and C# are portable, which is true in theory, whereas ANSI C and Java are portable in practice).
Understanding what is hidden will allow you to avoid technical blunders and diagnose deep technical issues.
At this point it really depends on your goals. If all you want to do is write a Windows application, then use modern technologies that are better suited to such a task. If you want to write a Windows application with an understanding of how to write applications in general (not necessarily just for Windows), then keep pursuing the C path for now, and branch into other technologies as you expand your knowledge.
Depends on the application. But what you need now is to familiarize yourself with an API. APIs are basically premade functions that you use as tools to do... whatever it is the API was designed to help you do. You're looking for a graphical user interface API. Windows has its own but I recommend you use something crossplatform so your application will work on multiple platforms.
Look these up on wikipedia:
GTK+
Trolltech's QT4
They can pretty much do anything the windows API can do with the added benefit of working on multiple platforms like windows, linux, mac, etc.
http://winprog.org/tutorial/
These are pretty good for learning Win32. Charles Petzold is good resource if you can get your hands on a copy but The Forger's are free and you can have them in your hot little hands right now.
In general though you should spend some time just writting C/C++ apps that use the standard libraries first. Opening files, writing output, writing files, reading/writing stdio and get a good handle on the basics of the language first.
Looking up books on data structures, and analysis of algorithms are fundemental to any type of programming you want to do as well.
Read this.
Are you suggesting that you'd like to write a Windows desktop app in C? That's reaching back a long way. You're back in 2002, according to this.
Most people writing on Windows are using .NET, which means C++ or C#.
If you need some GUI or complex features,
You need some oriented object programming skills...
You can read some of this book serie : Head first... from O'Reilly
Head first Object-Oriented Analysis and Design
Head First Software Development
Head first C# or Java (It doesn't matter which language...)
Trolltech Qt4, it's a must, too ! Thanks CptAJ
They are very nice books for beginners... and advanced programmers too ;-)
Nice reading !
I disagree with a lot of the answers here... learning from the ground up is not a bad thing.
I wouldn't go out and make a whole app in C, but certainly making a little app in C is a good way to both learn the language and to appreciate (or more likely, detest) the win32 API.
Besides, you can't really appreciate what the newer languages/frameworks do for you if you don't experience the old painful way of doing things.
That said, recognize that there are newer languages and frameworks out there and learn them as well; particularly if you're trying to land a job.
I highly recommend theForger's Win32 API Programming Tutorial. It's very concise and easy to follow, and it's free.
While I won't say you've wasted your time learning some C, I'm guessing it's not where you're going to end up either.
If you really want to get rolling, without too much trouble, I'd highly suggest getting:
Visual Studio C# Express (it's free, and it's a great development environment)
A book on C#...Petzold is great, so a book like Programming Microsoft Windows with C# is perfect.
This should get you pretty much exactly what you want. You'll have everything you need, and Petzold starts you out very simply, and ramps you up to making interesting apps without losing you.
(You may wonder why I, and many other people are directing you to C# or other languages after you specifically said that you've already read and learned about C. This is because programming in windows using the old Win32 API is much more tedious. It is easy to quickly become overwhelmed by the sheer amount of extra chaff that has to go into it.)
At Microsoft, we have been working hard to come up with some great resources for simply creating Windows applications. Our page, Start Programming with Windows 7, will be sourced with tons of new resources for intermediate and advanced programmers.
There are two really important new learning series that we have been working on:
The Hilo Project: An application built from the ground up to show how you can develop programs that are specifically taylored to Windows 7 features using the most modern programming and application design methodologies.
The Learn to Program for Windows Module: An introduction to Windows programming written by a developer education expert at Microsoft. This module sounds more like what you are looking for, I recommend you check it out.
We're working on ways to surface learning resources as best we can on the Windows Developer Center - a collection of developer learning resources for people new to developing Windows or new to developing using the latest Windows features.
Additional guidance is coming through the new Home and Hub resources for client / Desktop applications on the MSDN homepage.
Try Ramp Up's Developer Basics, a microsoft learning road that shows stpe by stpe how to start windows programming. You can use the Visual C# Express version of Visual Studio as a development enviroment.
Read this book, Learn to Program with C#.
Then, make small projects in WPF; the best WPF book is Windows Presentation Foundation Unleashed; try that after reading the C# / beginning-programming book.
C#, the .NET Framework and WPF were created to move beyond the C Win32 API, to make it easier to create Windows applications.
If you want to make a standard Windows application, follow that path.
I would suggest using VB rather than C#. The syntax is a little friendlier, and it has all equivalent features and performance.
Why not follow the MSDN tutorials? If you don't like them try googling "VB tutorial".
http://msdn.microsoft.com/en-ca/library/hewcw458.aspx
Either VB or C# has a zillion examples of everything that can be googled. I would stick to either of these languages, if only for the "google support" alone.

What is the best IDE for C Development / Why use Emacs over an IDE? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
so as per one of my previous questions, I'm brushing up on my C skills.
My question is, what do people use for developing C?
Lots of people use Emacs, and have done so for years, but is it better to learn emacs than just use an IDE such as Geany or KDevelop?
Would also be interested to hear from those still using emacs, and why they use it over other apps?
Please note that I'm only really interested in the free IDEs / editors.
EDIT:
Thanks for posting links which answer some of my questions, but I guess what I'm really wondering about is:
Whether learning to edit using emacs / vim and compiling / debugging using the gcc-toolchain is worth it instead of just using an IDE, and why?
What are peoples reasons for not migrating to an IDE?
Has anyone moved from terminal-centric development to IDE development, and why did they move?
I started off by using IDEs, Microsoft or not. Then, while working on QNX some long time ago, I was forced to do with a text editor + compiler/linker. Now I prefer this simple combination––a syntax highlighting editor + C compiler and linker cli + make––to any IDEs, even if environment allows for them.
The reasons are, for me:
it's everywhere. If you program in C, you do have the compiler, and usually you can get yourself an editor. The first thing I do––I get myself nedit on Linux or Notepad++ on Windows. I would go with vi, but GUI editors provide for a better fonts, and that is important when you look at code all day
you can program remotely, via ssh, when you need to. And it does help a lot sometimes to be able to ssh into the target and do some quick things there
it keeps me close to CLI, preferably UNIX/Linux CLI. So all the commands are on my fingertips, and when I need them I don't have to go read a reference book. And UNIX CLI can do things IDEs often can't––because their developers didn't think you'd need them
most importantly, it is very much like seeing the Matrix in raw code. I operate files, so I'm forced to keep them manageable. I'm finding things in my code manually, which makes me keep it simple and organized. I do Config Management explicitly, so I know when I'm synced and how. I know my Makefiles because I write them, and they only do what I tell them to
(if you wonder if that works in "really big projects"––it does work, and the bigger the project the more performance it gains me)
when people ask me to look at their code, I don't have to learn the IDE they use
I've moved from a terminal text-editor+make environment to Eclipse for most of my projects. Spanning from C and C++, to Java and Python to name few languages I am currently working with.
The reason was simply productivity. I could not afford spending time and effort on keeping all projects "in my head" as other things got more important.
There are benefits of using the "hardcore" approach (terminal) - such as that you have a much thinner layer between yourself and the code which allows you to be a bit more productive when you're all "inside" the project and everything is on the top of your head. But I don't think it is possible to defend that way of working just for it's own sake when your mind is needed elsewhere.
Usually when you work with command line tools you will frequently have to solve a lot of boilerplate problems that will keep you from being productive. You will need to know the tools in detail to fully leverage their potentials. Also maintaining a project will take a lot more effort. Refactoring will lead to updates in make-files, etc.
To summarize: If you only work on one or two projects, preferably full-time without too much distractions, "terminal based coding" can be more productive than a full blown IDE. However, if you need to spend your thinking energy on something more important an IDE is definitely the way to go in order to keep productivity.
Make your choice accordingly.
Emacs is an IDE.
edit: OK, I'll elaborate. What is an IDE?
As a starting point, let's expand the acronym: Integrated Development Environment. To analyze this, I start from the end.
An environment is, generally speaking, the part of the world that surrounds the point of view. In this case, it is what we see on our monitor (perhaps hear from our speakers) and manipulate through our keyboard (and perhaps a mouse).
Development is what we want to do in this environment, its purpose, if you want. We use the environment to develop software. This defines what subparts we need: an editor, an interface to the REPL, resp. the compiler, an interface to the debugger, and access to online documentation (this list may not be exhaustive).
Integrated means that all parts of the environment are somehow under a uniform surface. In an IDE, we can access and use the different subparts with a minimum of switching; we don't have to leave our defined environment. This integration lets the different subparts interact better. For example, the editor can know about what language we write in, and give us symbol autocompletion, jump-to-definition, auto-indentation, syntax highlighting, etc.. It can get information from the compiler, automatically jump to errors, and highlight them. In most, if not all IDEs, the editor is naturally at the heart of the development process.
Emacs does all this, it does it with a wide range of languages and tasks, and it does it with excellence, since it is seamlessly expandable by the user wherever he misses anything.
Counterexample: you could develop using something like Notepad, access documentation through Firefox and XPdf, and steer the compiler and debugger from a shell. This would be a Development Environment, but it would not be integrated.
I have used Eclipse with the CDT plug in quite successfully.
Emacs would be better if it had a text editor in it... :-)
Use Code::Blocks. It has everything you need and a very clean GUI.
Netbeans has great C and C++ support. Some people complain that it's bloated and slow, but I've been using it almost exclusively for personal projects and love it. The code assistance feature is one of the best I've seen.
How come nobody mentions Bloodshed Devc++? Havent used it in a while, but i learnt c/c++ on it. very similar to MS Visual c++.
If you are looking for a free, nice looking, cross-platform editor, try Komodo Edit. It is not as powerful as Komodo IDE, however that isn't free. See feature chart.
Another free, extensible editor is jEdit. Crossplatform as it is 100% pure Java. Not the fastest IDE on earth, but for Java actually very fast, very flexible, not that nice looking though.
Both have very sophisticated code folding, syntax highlighting (for all languages you can think of!) and are very flexible regarding configuring it for you personal needs. jEdit is BTW very easy to extend to add whatever feature you may need there (it has an ultra simple scripting language, that looks like Java, but is actually "scripted").
If you're on Windows then it's a total no-brainer: Get Visual C++ Express.

Resources