Quetions about Writing GUI(Buttons, TextBoxes...)
Posted: Tue Feb 13, 2007 10:15 am
I'm writing the GUI these days, but I still have a big program!!
I don't know whether I should put it in Kernel or not. My first idea is put it in User mode, when I click the mouse on a button, the kernel receive the mouse message, and calculate out the window from the mouse position, and send the message to a process, which is the owner of the window. Then, the process receive the message in MessageProcedure(), and it will call DefaultMessageProcedure(), DefaultMessageProcedure is a function in user.dll that the program loaded it. In this function, it will do sth like Blit or Pixel(in gdi.dll) . You see, the attribute data and the bitmap data are all in User Space.
But there are many programs in my idea. I cannot share the bitmap data. They are in user space, kernel can only access them when the process is running.
If I write GUI in OS kernel, then I don't know where I can alloc the memory, in user space, or kernel space, or share space????
I don't know whether I should put it in Kernel or not. My first idea is put it in User mode, when I click the mouse on a button, the kernel receive the mouse message, and calculate out the window from the mouse position, and send the message to a process, which is the owner of the window. Then, the process receive the message in MessageProcedure(), and it will call DefaultMessageProcedure(), DefaultMessageProcedure is a function in user.dll that the program loaded it. In this function, it will do sth like Blit or Pixel(in gdi.dll) . You see, the attribute data and the bitmap data are all in User Space.
But there are many programs in my idea. I cannot share the bitmap data. They are in user space, kernel can only access them when the process is running.
If I write GUI in OS kernel, then I don't know where I can alloc the memory, in user space, or kernel space, or share space????