Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 28794: /trunk/gtk/ /trunk/gtk/: Make
From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Mon, 22 Jun 2009 00:52:11 -0700

On Jun 21, 2009, at 11:53 PM, Ulf Lamping wrote:

I don't know if main_window_menus.[ch] or simply main_menus.[ch] might
be better (although I would prefer main_menus). But giving up the main_
prefix just as you didn't notice it is, well, a step in the wrong
direction IMHO.

A "main_" prefix could either mean

	1) the main window

or

	2) the main menu

so giving a file for menus the main_ prefix, by itself, is, well, a step in the wrong direction IMHO, especially given that, when I was looking for the file that handled the pop-up menus, I didn't expect them to be in a file named main_menu.c.

So *I* would very strongly prefer main_window_menus.[ch] or main_win_menus.[ch].

However, given that the pop-up menus shouldn't only be in the main window, the code that implements them shouldn't be in a file with main_ in its name at all.

But what are you trying to achieve?

Being able to find files that implement more than "main" things, whether it's the main menu or the main window.

Before I introduced the main_ prefix, I remember several times seaching
for the code displaying the hex dump - searching in a few hundred
variously named files in the gtk dir (proto_draw isn't very intuitive
here). If you guess that it might be somewhere in the main window,
looking for main_ and getting the right file is a matter of seconds.

Protocol trees and hex dumps appear in more than the main window.

The problem with the hex dump pane code is that, for better or worse, hex dump panes (plural) are somewhat tied to protocol tree panes (plural), so the code to implement hex dump panes is in the same file as the code that implements protocol tree panes. Perhaps the fix is to have separate files for them.