Bug 14732 - [gtk] Rename *Gdk to *Gtk
Summary: [gtk] Rename *Gdk to *Gtk
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
: 14497 (view as bug list)
Depends on:
Blocks: 14725
  Show dependency treegraph
 
Reported: 2007-07-23 12:06 PDT by Holger Freyther
Modified: 2007-09-23 14:52 PDT (History)
3 users (show)

See Also:


Attachments
Rename files from *Gdk to *Gtk (first part) (296.98 KB, patch)
2007-08-13 10:26 PDT, Juan A. Suarez
no flags Details | Formatted Diff | Diff
Rename files from *Gdk to *Gtk (first part). (5.13 KB, patch)
2007-08-17 08:05 PDT, Juan A. Suarez
aroben: review-
Details | Formatted Diff | Diff
Rename files from *Gdk to *Gtk (first part) (290.98 KB, patch)
2007-08-21 09:43 PDT, Juan A. Suarez
no flags Details | Formatted Diff | Diff
Hash files renamed (1.52 KB, patch)
2007-08-21 09:44 PDT, Juan A. Suarez
aroben: review+
Details | Formatted Diff | Diff
The used hash for the renames (1.94 KB, patch)
2007-09-23 07:25 PDT, Holger Freyther
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Freyther 2007-07-23 12:06:55 PDT
Rename the WebKit/Gdk port to WebKit/Gtk. This should involve renaming the library and the files currently named *Gdk.
The question is what to do with the WebKitGtk namespace as WebKitGtk::FrameLoaderClientGtk looks redundant. Proposal would be to remove the Gtk from the namespace once we do the renaming.

Someone should prepare a script to do the renaming as svn-create-patch could be error prone.
Comment 1 Adam Roben (:aroben) 2007-07-23 13:01:19 PDT
(In reply to comment #0)
> Rename the WebKit/Gdk port to WebKit/Gtk. This should involve renaming the
> library and the files currently named *Gdk.
> The question is what to do with the WebKitGtk namespace as
> WebKitGtk::FrameLoaderClientGtk looks redundant. Proposal would be to remove
> the Gtk from the namespace once we do the renaming.

   I think removing Gtk from both the namespace and the class names is good. WebKit::FrameLoaderClient is all you need.

> Someone should prepare a script to do the renaming as svn-create-patch could be
> error prone.

You should use WebKitTools/Scripts/do-{webcore,file}-rename to accomplish this. It's been used a few times before for tasks like this.
Comment 2 Holger Freyther 2007-07-23 13:14:39 PDT
Add the Gtk keyword, even to the curl bugs.
Comment 3 Juan A. Suarez 2007-08-13 10:26:38 PDT
Created attachment 15953 [details]
Rename files from *Gdk to *Gtk (first part)

This is the first part of the patch to fix this bug.

It renames files from *Gdk* to *Gtk*. Unfortunately, some directories couldn't be renamed, as subversion warns me that first it requires to do a commit first with the changes done.

This patch doesn't changes the API at all, but changes the Launcher, which now is called GtkLauncher. Anyway, both the launcher and the build system could still be called using '--gdk' option.

In the future I pretend upload to new patches.

  1) A patch that definitely changes all references from gdk to gtk (in the names of files and directories). This requires to commit the present patch.

  2) A patch that changes the gdk references in the API code. This will be done following the comments.
Comment 4 Juan A. Suarez 2007-08-17 08:05:25 PDT
Created attachment 16008 [details]
Rename files from *Gdk to *Gtk (first part).

This patch changes the previous patch by adding a script to do the task.

At now, it renames all *Gdk files to *Gtk files, and updates the references in the  source code.

Besides this, the new library is WebKitGtk (instead of WebKitGdk), and the launcher becomes GtkLauncher.

Two changes are not done yet in this patch:

   * The scripts still uses "--gdk" option instead of "--gtk" option.
   * The directories were not renamed. This is due because we can't rename both the directories and its contents at the same time. So this script only renames the files inside the directories. ASAP they will be commited in the trunk, a patch to rename the directories will be uploaded.
   * The functions were not renamed. So we have, as example, "RenderThemeGdk" object instead of "RenderTheme". This task will be done in future.
Comment 5 Adam Roben (:aroben) 2007-08-17 10:08:56 PDT
Comment on attachment 16008 [details]
Rename files from *Gdk to *Gtk (first part).

I think it would be better to use the do-webcore-rename script for this purpose. It has been used before and should work as desired.
Comment 6 Holger Freyther 2007-08-17 10:59:13 PDT
Do we have any examples for do-webcore-rename? The script itself has no documentation and a grep didn't expose any examples.
Comment 7 Adam Roben (:aroben) 2007-08-17 11:03:41 PDT
(In reply to comment #6)
> Do we have any examples for do-webcore-rename? The script itself has no
> documentation and a grep didn't expose any examples.

All you have to do is modify the %renames hash (some examples are included in the script):

my %renames = ( 
    "xxx" => "yyy",
    #"KURL" => "PlatformURL",
    #"KURLMac" => "PlatformURLMac",
    #"KURL_H_" => "PlatformURL_h",
);
Comment 8 Juan A. Suarez 2007-08-21 07:10:04 PDT
(In reply to comment #5)
> (From update of attachment 16008 [details] [edit])
> I think it would be better to use the do-webcore-rename script for this
> purpose. It has been used before and should work as desired.
> 

So, how should I do the patch? Modifying the script itself, or creating a new copy from it?
Comment 9 Adam Roben (:aroben) 2007-08-21 09:22:52 PDT
(In reply to comment #8)
> (In reply to comment #5)
> > (From update of attachment 16008 [details] [edit] [edit])
> > I think it would be better to use the do-webcore-rename script for this
> > purpose. It has been used before and should work as desired.
> > 
> 
> So, how should I do the patch? Modifying the script itself, or creating a new
> copy from it?

   Probably the best thing to do would be to modify the script locally to do the renames that you want, run the script, ensure everything builds and runs, then make a diff of the result and post it here as a patch. When you upload the patch, you can also paste into Bugzilla your %renames hash from the script that you used.
Comment 10 Juan A. Suarez 2007-08-21 09:43:08 PDT
Created attachment 16054 [details]
Rename files from *Gdk to *Gtk (first part)

This patch is the result of using do-webcore-rename to do the rename from *Gdk to *Gtk.

This patch only renames the files.
Comment 11 Juan A. Suarez 2007-08-21 09:44:31 PDT
Created attachment 16055 [details]
Hash files renamed

Here is a patch with the files renamed to be applied to do-webcore-rename.
Comment 12 Adam Roben (:aroben) 2007-09-22 13:41:06 PDT
Comment on attachment 16055 [details]
Hash files renamed

This looks good to me. A committer should apply this patch, run the script, and commit the result with your ChangeLog from attachment 16054 [details]. I think also that some new *Gdk files have been added since this patch was uploaded -- perhaps the person running the script can add those as well.
Comment 13 Adam Roben (:aroben) 2007-09-22 13:41:22 PDT
Comment on attachment 16054 [details]
Rename files from *Gdk to *Gtk (first part)

Clearing review flag since we'll want someone to run the script rather than commit this directly.
Comment 14 Holger Freyther 2007-09-22 14:26:09 PDT
I have http://page.mi.fu-berlin.de/freyther/webkit/webkit-gdk-to-gtk-renaming-r0.patch (http://page.mi.fu-berlin.de/freyther/webkit/webkit-gdk-to-gtk-renaming.diff which includes the change to the hash as well) applied in my working copy and I'm ready to do a commit.

Additionally to the script I'm also changing the cmd line options and defines from gdk to gtk and rename the directories. I can do these things in two different commits but have waited for alp to spare a comment.
Comment 15 Holger Freyther 2007-09-23 07:25:56 PDT
Created attachment 16361 [details]
The used hash for the renames

Just for reference.
Comment 16 Holger Freyther 2007-09-23 07:26:45 PDT
Landed in r25703.
Comment 17 Holger Freyther 2007-09-23 14:52:40 PDT
*** Bug 14497 has been marked as a duplicate of this bug. ***