Things are getting cool. I did a back merge from my branche to trunk
Code:
------------------------------------------------------------------------
r1176 | rainwoodman | 2008-08-11 00:22:47 -0400 (Mon, 11 Aug 2008) | 33 lines
Merge changes in branches/0.5-yu
* Not really ready to begin working on applets with this trunk yet.
* several componets has to be renamed.
* the GMarkup pseudo xml language is not completeely defined yet.
* Central controlled blocked-ipc on top of X11.
* Support transaction: useless and perhaps buggy.
* 'Client calls SERVER' and 'Client calls client' (forwarded by the server).
* 'Client calls itself' will deadlock. No way to solve. and useless.
* Emitting Events. (Useful for the Client to announce eg 'My menubar's 2nd item has been changed',
not strongly tested recently, perhaps buggy)
* uiless, autospawned gnomenu-server
* IPC interface:
* BindMenu = bind a toplevel window with one(or more) gnomenu's native object.(usually should be a Menu)
* UnbindMenu = undo BindMenu
* ListClients = get some information of all the alive clients. (CID, toplevel windows and their menu bars)
* LookupWindow = get some information about the given window's owner. (same as above); /*BAD, either the name or behaviour shall be modified*/
* gnomenu-call as a command-line interface to access IPC interfaces exposed by SERVER and clients(identified with CID, integer from 1000+)
* gnomenu-call -t TARGET -c command -p parameter -v parameter's_value -p .... -v ....
* gnomenu-call -e is perhaps broken.
* gnomenu-call -b is definately broken. (batch mode, use a transaction to send all commands together)
* Gtk binding of gnomenu(menu.[ch], need to be renamed)
* Simple introspection of GtkMenuShell.
* gnomenu_wrap_widget and gnomenu_unwrap_widget.
* IPC interface:
* QueryMenu = query the content of a menu.
* ActivateItem = activate an item (call gtk_menu_item_activate)
* GTK patch:
* load libgnomenu and try to start it at gtkmain. Just after the gdk connection to the display is initialized. (two places)
* GtkMenuShell, GtkMenuItem: Wrap the widget with a Gnomenu GTK Binding object when created. (so that we can uniquely locate the widget with CID + objectname);
* GtkMenuBar: Call BindMenu and Unbind Menu when a menu bar is attached to a toplevel window.
------------------------------------------------------------------------
No applet is done at all. The menus are accessible via the command line interface 'gnomenu-call'.
If brave hearts want to do some testing, Please follow this guideline:
Code:
(
#to build gtk+-aqd;
cd gtk+-aqd; make prepare; make patch; cd gtk+-aqd; make
)
Code:
# Start a sample application with our patched GTK. (gedit)
# replace the absolute directories with your own directories.
[rainwoodman@x gtk] env GNOMENU_SERVER=$PWD/../../../libgnomenu/gnomenu-server LD_LIBRARY_PATH=/home/rainwoodman/Projects/svn/branches/0.5-yu/gtk+-aqd/gtk+-aqd/gtk/.libs:/home/rainwoodman/Projects/svn/branches/0.5-yu/libgnomenu/.libs gdb gedit run
# type run to start it
Now use gnomenu-call
Code:
[rainwoodman@x libgnomenu]$ ./gnomenu-call -t SERVER -c ListClients
<IPCClient>::Server Found at = 0x4600003
<IPCClient>::CID obtained: 1006
<IPCClient>::calling <command name="ListClients" from="1006" to="SERVER"></command>
<client cid="1006">
</client>
<client cid="1001">
<toplevel window="79691805">
<menu name="Widget101"/>
</toplevel>
</client>
# Widget101 is the menu of window 79691805, so
[rainwoodman@x libgnomenu]$ ./gnomenu-call -t 1001 -c QueryMenu -p menu -v Widget101
<IPCClient>::Server Found at = 0x4600003
<IPCClient>::CID obtained: 1007
<IPCClient>::calling <command name="QueryMenu" from="1007" to="1001"><p name="menu">Widget101</p></command>
<menu name="Widget101">
<item name="Widget105"><p name="title">File</p><p name="submenu">Widget102</p></item>
<item name="Widget139"><p name="title">Edit</p><p name="submenu">Widget136</p></item>
<item name="Widget169"><p name="title">View</p><p name="submenu">Widget166</p></item>
<item name="Widget264"><p name="title">Search</p><p name="submenu">Widget261</p></item>
<item name="Widget298"><p name="title">Tools</p><p name="submenu">Widget295</p></item>
<item name="Widget318"><p name="title">Documents</p><p name="submenu">Widget315</p></item>
<item name="Widget339"><p name="title">Help</p><p name="submenu">Widget336</p></item>
</menu>
# To find an action menu item, has to QueryMenu(menu=Widget102) and I found Widget109 is 'Open', so
[rainwoodman@x libgnomenu]$ ./gnomenu-call -t 1001 -c ActivateItem -p item -v Widget109
<IPCClient>::Server Found at = 0x4600003
<IPCClient>::CID obtained: 1010
<IPCClient>::calling <command name="ActivateItem" from="1010" to="1001"><p name="item">Widget109</p></command>
OK
# Then an 'Open File' dialog pops up from gedit window.
Bookmarks