From 036c7c12e66dbca81e85e7e145a8126063fa9db0 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 4 Mar 2018 13:52:33 -0500 Subject: [PATCH] Updated CONTRIBUTING.md and moved the old OS X draw text stuff out of the way. --- CONTRIBUTING.md | 6 ++++-- darwin/{_appkit_drawtext.m => OLD__appkit_drawtext.m} | 0 darwin/{_appkit_fontmatch.m => OLD__appkit_fontmatch.m} | 0 darwin/{_old_drawtext.m => OLD__old_drawtext.m} | 0 darwin/{aat.m => OLD_aat.m} | 0 darwin/{attrstr.m => OLD_attrstr.m} | 0 darwin/{drawtext.m => OLD_drawtext.m} | 0 darwin/{fontbutton.m => OLD_fontbutton.m} | 0 darwin/{fontmatch.m => OLD_fontmatch.m} | 0 darwin/{fontstyle.h => OLD_fontstyle.h} | 0 darwin/{fonttraits.m => OLD_fonttraits.m} | 0 darwin/{fontvariation.m => OLD_fontvariation.m} | 0 darwin/{graphemes.m => OLD_graphemes.m} | 0 darwin/{opentype.m => OLD_opentype.m} | 0 14 files changed, 4 insertions(+), 2 deletions(-) rename darwin/{_appkit_drawtext.m => OLD__appkit_drawtext.m} (100%) rename darwin/{_appkit_fontmatch.m => OLD__appkit_fontmatch.m} (100%) rename darwin/{_old_drawtext.m => OLD__old_drawtext.m} (100%) rename darwin/{aat.m => OLD_aat.m} (100%) rename darwin/{attrstr.m => OLD_attrstr.m} (100%) rename darwin/{drawtext.m => OLD_drawtext.m} (100%) rename darwin/{fontbutton.m => OLD_fontbutton.m} (100%) rename darwin/{fontmatch.m => OLD_fontmatch.m} (100%) rename darwin/{fontstyle.h => OLD_fontstyle.h} (100%) rename darwin/{fonttraits.m => OLD_fonttraits.m} (100%) rename darwin/{fontvariation.m => OLD_fontvariation.m} (100%) rename darwin/{graphemes.m => OLD_graphemes.m} (100%) rename darwin/{opentype.m => OLD_opentype.m} (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7147ff4e..94bd199b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,9 +30,11 @@ In the event you are unsure of something, refer to existing libui code for examp libui uses camel-case for naming, with a handful of very specific exceptions (namely GObject method names, where GObject itself enforces the naming convention). -All public API names should begin with `ui` and followed by a capital letter. All public struct names should begin with a capital letter. This is identical to the visibiilty rules of Go, assuming a package name of `ui`. +All public API names should begin with `ui` and followed by a capital letter. All public struct field names should begin with a capital letter. This is identical to the visibiilty rules of Go, assuming a package name of `ui`. -No private API name should begin with `ui` followed by a capital letter; in fact, I would ideally like to be able to get away with lax naming for private functions. I may have to change that if it becomes technically difficult to do in the case of static linking later on down the road. (`uiMalloc()`, `uiRealloc()`, and `uiFree()` are grandfathered-in exceptions.) +Private API names — specifcally those used by more than one source file — should begin with `uipriv` and be followed by a capital letter. This avoids namespace collisions in static libraries. + +Static functions and static objects do not have naming restrictions. Acronyms should **NOT** be mixed-case. `http` for the first word in a camel-case name, `HTTP` for all else, but **NEVER** `Http`. This is possibly the only aspect of the controversial nature of code style that I consider indefensibly stupid. diff --git a/darwin/_appkit_drawtext.m b/darwin/OLD__appkit_drawtext.m similarity index 100% rename from darwin/_appkit_drawtext.m rename to darwin/OLD__appkit_drawtext.m diff --git a/darwin/_appkit_fontmatch.m b/darwin/OLD__appkit_fontmatch.m similarity index 100% rename from darwin/_appkit_fontmatch.m rename to darwin/OLD__appkit_fontmatch.m diff --git a/darwin/_old_drawtext.m b/darwin/OLD__old_drawtext.m similarity index 100% rename from darwin/_old_drawtext.m rename to darwin/OLD__old_drawtext.m diff --git a/darwin/aat.m b/darwin/OLD_aat.m similarity index 100% rename from darwin/aat.m rename to darwin/OLD_aat.m diff --git a/darwin/attrstr.m b/darwin/OLD_attrstr.m similarity index 100% rename from darwin/attrstr.m rename to darwin/OLD_attrstr.m diff --git a/darwin/drawtext.m b/darwin/OLD_drawtext.m similarity index 100% rename from darwin/drawtext.m rename to darwin/OLD_drawtext.m diff --git a/darwin/fontbutton.m b/darwin/OLD_fontbutton.m similarity index 100% rename from darwin/fontbutton.m rename to darwin/OLD_fontbutton.m diff --git a/darwin/fontmatch.m b/darwin/OLD_fontmatch.m similarity index 100% rename from darwin/fontmatch.m rename to darwin/OLD_fontmatch.m diff --git a/darwin/fontstyle.h b/darwin/OLD_fontstyle.h similarity index 100% rename from darwin/fontstyle.h rename to darwin/OLD_fontstyle.h diff --git a/darwin/fonttraits.m b/darwin/OLD_fonttraits.m similarity index 100% rename from darwin/fonttraits.m rename to darwin/OLD_fonttraits.m diff --git a/darwin/fontvariation.m b/darwin/OLD_fontvariation.m similarity index 100% rename from darwin/fontvariation.m rename to darwin/OLD_fontvariation.m diff --git a/darwin/graphemes.m b/darwin/OLD_graphemes.m similarity index 100% rename from darwin/graphemes.m rename to darwin/OLD_graphemes.m diff --git a/darwin/opentype.m b/darwin/OLD_opentype.m similarity index 100% rename from darwin/opentype.m rename to darwin/OLD_opentype.m