Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure classes match their header filename #25821

Merged
merged 5 commits into from
Feb 13, 2019

Conversation

akien-mga
Copy link
Member

@akien-mga akien-mga commented Feb 12, 2019

Also drop some unused files.

Core

Renamed:

  • core/dvector.h -> pool_vector.h
  • core/io/resource_import.h -> resource_importer.h
  • core/sort.h -> sort_array.h
  • core/string_db.h -> string_name.h

Dropped:

  • core/allocators.h
  • core/os/shell.h
  • core/variant_construct_string.cpp

Drivers, main, servers

Renamed:

  • drivers/alsamidi/alsa_midi.h -> midi_driver_alsamidi.h
    (same for coremidi and winmidi)
  • main/timer_sync.h -> main_timer_sync.h
  • servers/visual/visual_server_global.h -> visual_server_globals.h

Platform

Renamed:

  • platform/iphone/sem_iphone.h -> semaphore_iphone.h
    (same for osx)
  • platform/uwp/gl_context_egl.h -> context_egl_uwp.h
  • in platform/windows: context_gl_win.h, crash_handler_win.h,
    godot_win.cpp, joypad.h and key_mapping_win.h all renamed to
    use windows. Some classes renamed accordingly too.
  • EditorExportAndroid and EditorExportUWP renamed to
    EditorExportPlatformAndroid and EditorExportPlatformUWP
  • power_android and power_osx renamed to PowerAndroid and
    PowerOSX
  • OSUWP renamed to OS_UWP

Dropped:

  • platform/windows/ctxgl_procaddr.h

Scene

Renamed:

  • scene/2d/navigation2d.h -> navigation_2d.h
  • scene/2d/screen_button.h -> touch_screen_button.h
  • scene/3d/scenario_fx.h -> world_environment.h
  • scene/audio/audio_player.h -> audio_stream_player.h
  • scene/resources/bit_mask.h -> bit_map.h
  • scene/resources/color_ramp.h -> gradient.h
  • scene/resources/shape_line_2d.h -> line_shape_2d.h
  • scene/resources/scene_format_text.h -> resource_format_text.h
  • scene/resources/sky_box.h -> sky.h

Dropped:

  • scene/resources/bounds.h

Modules

Renamed:

  • modules/mono/mono_gd/gd_mono_class_member.h -> i_mono_class_member.h
  • modules/upnp/upnpdevice.h -> upnp_device.h
  • modules/websocket/websocket_multiplayer.h -> websocket_multiplayer_peer.h

Might break compat for some thirdparty modules that include e.g. core/dvector.h or core/io/resource_import.h, would be worth mentioning in the changelog @Calinou.

Also drop some unused files.

Renamed:
- `core/dvector.h` -> `pool_vector.h`
- `core/io/resource_import.h` -> `resource_importer.h`
- `core/sort.h` -> `sort_array.h`
- `core/string_db.h` -> `string_name.h`

Dropped:
- `core/allocators.h`
- `core/os/shell.h`
- `core/variant_construct_string.cpp`
@Calinou
Copy link
Member

Calinou commented Feb 12, 2019

@akien-mga Added to my working copy of the changelog 🙂 I guess I'll send another PR before the 3.1 release.

Renamed:
- `drivers/alsamidi/alsa_midi.h` -> `midi_driver_alsamidi.h`
  (same for `coremidi` and `winmidi`)
- `main/timer_sync.h` -> `main_timer_sync.h`
- `servers/visual/visual_server_global.h` -> `visual_server_globals.h`
@akien-mga akien-mga changed the title Core: Ensure classes match their header filename Ensure classes match their header filename Feb 12, 2019
@akien-mga akien-mga force-pushed the sync-class-and-filenames branch 2 times, most recently from c9ae931 to b1b3b59 Compare February 12, 2019 15:55
Also drop some unused files.

Renamed:
- `platform/iphone/sem_iphone.h` -> `semaphore_iphone.h`
  (same for `osx`)
- `platform/uwp/gl_context_egl.h` -> `context_egl_uwp.h`
- in `platform/windows`: `context_gl_win.h`, `crash_handler_win.h`,
  `godot_win.cpp`, `joypad.h` and `key_mapping_win.h` all renamed to
  use `windows`. Some classes renamed accordingly too.
- `EditorExportAndroid` and `EditorExportUWP` renamed to
  `EditorExportPlatformAndroid` and `EditorExportPlatformUWP`
- `power_android` and `power_osx` renamed to `PowerAndroid` and
  `PowerOSX`
- `OSUWP` renamed to `OS_UWP`

Dropped:
- `platform/windows/ctxgl_procaddr.h`
Also drop some unused files.

Renamed:
- `scene/2d/navigation2d.h` -> `navigation_2d.h`
- `scene/2d/screen_button.h` -> `touch_screen_button.h`
- `scene/3d/scenario_fx.h` -> `world_environment.h`
- `scene/audio/audio_player.h` -> `audio_stream_player.h`
- `scene/resources/bit_mask.h` -> `bit_map.h`
- `scene/resources/color_ramp.h` -> `gradient.h`
- `scene/resources/shape_line_2d.h` -> `line_shape_2d.h`
- `scene/resources/scene_format_text.h` -> `resource_format_text.h`
- `scene/resources/sky_box.h` -> `sky.h`

Dropped:
- `scene/resources/bounds.h`
@akien-mga
Copy link
Member Author

akien-mga commented Feb 12, 2019

Only modules/ left to review, and this should be good to merge.

In platform/, there's also OSIPhone that would be good to rename to OS_IPhone for consistency with other platforms, but I didn't want to break #22784 so it will have to wait.

@akien-mga akien-mga requested a review from a team as a code owner February 12, 2019 21:33
@akien-mga
Copy link
Member Author

akien-mga commented Feb 12, 2019

Done modules/ too.

Renamed:
- `modules/mono/mono_gd/gd_mono_class_member.h` -> `i_mono_class_member.h`
- `modules/upnp/upnpdevice.h` -> `upnp_device.h`
- `modules/websocket/websocket_multiplayer.h` -> `websocket_multiplayer_peer.h`
@aaronfranke
Copy link
Member

aaronfranke commented Feb 13, 2019

  • in platform/windows

Might be worth considering "Win32" because UWP is also Windows (10). Though this may be jumping the gun a bit, since I don't think UWP will become the default for at least another decade.

  • EditorExportAndroid and EditorExportUWP renamed to
    EditorExportPlatformAndroid and EditorExportPlatformUWP

Why not ExportPlatformWhatever? grep -RIni ExportPlatform | grep -v EditorExportPlatform gives no results, I don't see why the Editor part is necessary. (where else are you exporting from?)

  • scene/resources/color_ramp.h -> gradient.h

Wow, I've never seen gradients called "color ramp" before :P

@akien-mga akien-mga merged commit 55ca2a7 into godotengine:master Feb 13, 2019
@akien-mga akien-mga deleted the sync-class-and-filenames branch February 13, 2019 07:49
@akien-mga
Copy link
Member Author

Might be worth considering "Win32" because UWP is also Windows (10).

Don't see much use for renaming it this way, and it would be a massive change (and compat breakage for build scripts).

Why not ExportPlatformWhatever?

Most editor classes start with Editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants