import bpy

class gp_render_prefs(bpy.types.AddonPreferences):
    bl_idname = __name__.split('.')[0]

    # resample_otf : bpy.props.BoolProperty(
    #     name='Resample on the fly',
    #     description="Allow smoother stroke when using pinch\nnote that stroke using textured materials will not be resampled",
    #     default=True)

    advanced : bpy.props.BoolProperty(
        name='Advanced Options', # Reproject On Guessed Plane
        description="Display advanced options",
        default=False)

    def draw(self, context):
        layout = self.layout
        layout.prop(self, "advanced")

def get_addon_prefs():
    '''
    function to read current addon preferences properties
    access with : get_addon_prefs().super_special_option
    '''
    import os
    addon_name = os.path.splitext(__name__)[0]
    preferences = bpy.context.preferences
    addon_prefs = preferences.addons[addon_name].preferences
    return (addon_prefs)


classes=(
gp_render_prefs,
)

def register():
    for cls in classes:
        bpy.utils.register_class(cls)

def unregister():
    for cls in reversed(classes):
        bpy.utils.unregister_class(cls)
