C_DEPS +=
-SYSROOT := $(SBI_SYSROOT)
+USES_EFL = yes
+USES_USR_INC = yes
-ROOTSTRAP_INCS := $(addprefix -I $(SYSROOT)/,$(PLATFORM_INCS_EX))
-EFL_INCS :=
+SYSROOT = $(SBI_SYSROOT)
+
+USR_INCS := $(addprefix -I $(SYSROOT),$(PLATFORM_INCS_EX))
+EFL_INCS =
+
+ifeq ($(strip $(PLATFORM_LIB_PATHS)),)
+RS_LIB_PATHS := "$(SYSROOT)/usr/lib"
+else
+RS_LIB_PATHS := $(addprefix -L$(SYSROOT),$(PLATFORM_LIB_PATHS))
+endif
RS_LIBRARIES := $(addprefix -l,$(RS_LIBRARIES_EX))
-PLATFORM_INCS := $(ROOTSTRAP_INCS) $(EFL_INCS) \
- -I"$(SDK_PATH)/library"
+PLATFORM_INCS = $(USR_INCS) $(EFL_INCS) \
+ -I"$(SDK_PATH)/library"
+OS_NAME := $(shell $(UNAME))
--- /dev/null
+# C/C++ build script
+
+
+_FUNC_EXT2O = $(patsubst %.$(3),$(1)/%.o,$(2))
+_FUNC_C2O = $(call _FUNC_EXT2O,$(1),$(2),c)
+_FUNC_CPP2O = $(call _FUNC_EXT2O,$(1),$(2),cpp)
+
+
+# parameter :
+# $(1) - C/C++ soruce file
+# $(2) - output path
+# $(3) - .ext
+CONVERT_ESC_EXT_TO_O = $(addprefix $(2)/,$(call CONVERT_4MAKE_TO_OUT,$(patsubst %.$(3),%.o,$(1))))
+
+CONVERT_ESC_C_TO_O = $(call CONVERT_ESC_EXT_TO_O,$(1),$(2),c)
+CONVERT_ESC_CPP_TO_O = $(call CONVERT_ESC_EXT_TO_O,$(1),$(2),cpp)
+
+
+# parameter :
+# $(1) - encoded one C/C++ soruce file
+# $(2) - output path
+# $(3) - ext title (C/C++)
+# $(4) - ext (c/cpp)
+# $(5) - compiler ($(CC)/$(CXX))
+# $(6) - build opt
+# $(7) - build opt file
+# output :
+# $(8) - output files list
+define C_BUILD_PROC_RAW
+$(call CONVERT_ESC_EXT_TO_O,$(1),$(2),$(4)) : $(call DECODE_4MAKE,$(1)) $(7)
+ @echo ' Building file: $$<'
+ @echo ' Invoking: $(3) Compiler'
+ $$(call MAKEDIRS,$$(@D))
+ $(5) -c "$$<" -o "$$@" $(6) @$(7)
+ @echo ' Finished building: $$<'
+$(8) += $(call CONVERT_ESC_EXT_TO_O,$(1),$(2),$(4))
+endef
+
+
+# parameter :
+# $(1) - output paths
+# $(2) - src paths
+# $(3) - inc paths
+# $(4) - inc files
+# $(5) - Defs
+# $(6) - UnDefs
+# $(7) - compiler opt
+# $(8) - compiler opt file
+# $(9) - ext title (C/C++)
+# $(10) - ext (c/cpp)
+# $(11) - compiler ($(CC)/$(CXX))
+# output :
+# $(12) - OBJS
+# return :
+# none
+define C_PROC_RAW
+
+_OUTPUT_DIR := $$(strip $(1))#
+_SRCS := $(2)#
+_INCS := $(3)#
+_INC_FILES := $(4)#
+_DEFS := $(5)#
+_UNDEFS := $(6)#
+
+_OPT := $(7)
+_OPT_FILE := $(8)
+
+_EXT_TITLE := $(9)
+_EXT := $(10)
+_COMPILER := $(11)
+
+#_OUTPUT_FILES := $(12)
+
+_ENC_SRCS := $$(call ENCODE_4MAKE,$$(_SRCS))
+_ENC_SRCS := $$(filter %.$$(_EXT),$$(_ENC_SRCS))
+
+ifneq ($$(strip $$(_SRCS)),)
+
+_NORMAL_SRCS := $$(filter-out %*.$$(_EXT),$$(_ENC_SRCS))
+_WIDLCARD_SRCS := $$(filter %*.$$(_EXT),$$(_ENC_SRCS))
+
+_ALL_SRCS := $$(call DECODE_4MAKE,$$(_NORMAL_SRCS)) \
+ $$(foreach var,$$(_WIDLCARD_SRCS),$$(call FIND_FILES_4MAKE,$$(call DECODE_4MAKE,$$(var))))
+
+ifneq ($$(strip $$(_ALL_SRCS)),)
+
+_ENC_SRCS := $$(call ENCODE_4MAKE,$$(_ALL_SRCS))
+
+_CDEFS := $$(CDEFS)
+_CDEFS += $$(addprefix -D,$$(_DEFS))
+_CDEFS += $$(addprefix -U,$$(_UNDEFS))
+
+_ENC_C_INCS := $$(call ENCODE_4MAKE,$$(_INCS))
+_ENC_C_INCS := $$(addprefix -I,$$(_ENC_C_INCS))
+
+_ENC_INC_FILES := $$(call ENCODE_4MAKE,$$(_INC_FILES))
+_ENC_INC_FILES += $$(addprefix -include,$$(_ENC_INC_FILES))
+
+_C_INCS := $$(call DECODE_4MAKE,$$(_ENC_C_INCS) $$(_ENC_C_INC_FILES))
+
+_DEFS := $$(_CDEFS) $$(_C_INCS) -I"pch" $$(_OPT)
+
+$$(foreach var,$$(_ENC_SRCS),$$(eval $$(call C_BUILD_PROC_RAW,$$(var),$$(_OUTPUT_DIR),$$(_EXT_TITLE),$$(_EXT),$$(_COMPILER),$$(_DEFS),$$(_OPT_FILE),$(12))))
+
+endif # (_(strip _(_ALL_SRCS)),)
+
+endif # (_(strip _(_SRCS)),)
+
+
+endef
--- /dev/null
+# EDC build script
+
+
+FUNC_EDC2EDJ = $(patsubst %.edc,$(2)/%.edj,$(1))
+
+# parameter :
+# $(1) - C/C++ soruce file
+# $(2) - output path
+CONVERT_ESC_EDC_TO_EDJ = $(call CONVERT_4MAKE_TO_OUT,$(call FUNC_EDC2EDJ,$(1),$(2)))
+
+
+# parameter :
+# $(1) - encoded one C/C++ soruce file
+# $(2) - output path
+# $(3) - build opt
+# output :
+# $(4) - output files list
+define EDJ_BUILD_PROC_RAW
+$(call CONVERT_ESC_EDC_TO_EDJ,$(1),$(2)) : $(call DECODE_4MAKE,$(1))
+ @echo ' Building file: $$<'
+ @echo ' Invoking: EDC Resource Compiler'
+ $$(call MAKEDIRS,$$(@D))
+ $$(EDJE_CC) $(3) "$$<" "$$@"
+ @echo ' Finished building: $$<'
+$(4) += $(call CONVERT_ESC_EDC_TO_EDJ,$(1),$(2))
+endef
+
+
+# parameter :
+# $(1) - output paths
+# $(2) - src paths
+# $(3) - image inc paths
+# $(4) - sound inc paths
+# $(5) - font inc paths
+# output :
+# $(6) - OBJS
+# return :
+# none
+define EDJ_PROC_RAW
+
+_OUTPUT_DIR := $$(strip $(1))#
+_SRCS := $(2)#
+_IMAGE_DIRS := $(3)#
+_SOUND_DIRS := $(4)#
+_FONT_DIRS := $(5)#
+
+ifneq ($$(strip $$(_SRCS)),)
+
+_ENC_SRCS := $$(call ENCODE_4MAKE,$$(_SRCS))
+
+_NORMAL_SRCS := $$(filter-out %*.edc,$$(_ENC_SRCS))
+_WIDLCARD_SRCS := $$(filter %*.edc,$$(_ENC_SRCS))
+
+_ALL_SRCS := $$(call DECODE_4MAKE,$$(_NORMAL_SRCS)) \
+ $$(foreach var,$$(_WIDLCARD_SRCS),$$(call FIND_FILES_4MAKE,$$(call DECODE_4MAKE,$$(var))))
+
+ifneq ($$(strip $$(_ALL_SRCS)),)
+
+_ENC_SRCS := $$(call ENCODE_4MAKE,$$(_ALL_SRCS))
+
+_COMPILER_FLAGS := -id "$$(SDK_TOOLPATH)/enventor/share/enventor/images"
+_COMPILER_FLAGS += -sd "$$(SDK_TOOLPATH)/enventor/share/enventor/sounds"
+_COMPILER_FLAGS += -fd "$$(SDK_TOOLPATH)/enventor/share/enventor/fonts"
+
+ifneq ($$(strip $$(_IMAGE_DIRS)),)
+_COMPILER_FLAGS += $$(addprefix -id ,$$(_IMAGE_DIRS))
+endif
+ifneq ($$(strip $$(_SOUND_DIRS)),)
+_COMPILER_FLAGS += $$(addprefix -sd ,$$(_SOUND_DIRS))
+endif
+ifneq ($$(strip $$(_FONT_DIRS)),)
+_COMPILER_FLAGS += $$(addprefix -fd ,$$(_FONT_DIRS))
+endif
+
+$$(foreach var,$$(_ENC_SRCS),$$(eval $$(call EDJ_BUILD_PROC_RAW,$$(var),$$(_OUTPUT_DIR),$$(_COMPILER_FLAGS),$(6))))
+
+endif # (_(strip _(_ALL_SRCS)),)
+
+endif # (_(strip _(_SRCS)),)
+
+endef
--- /dev/null
+# PO build script
+
+
+_FUNC_PO2MO = $(patsubst %.po,$(2)/res/locale/%/LC_MESSAGES/$(3).mo,$(notdir $(1)))
+
+
+# parameter :
+# $(1) - C/C++ soruce file
+# $(2) - output path
+# $(3) - app name
+CONVERT_ESC_PO_TO_MO = $(call CONVERT_4MAKE_TO_OUT,$(call _FUNC_PO2MO,$(1),$(2),$(3)))
+
+
+# parameter :
+# $(1) - encoded one C/C++ soruce file
+# $(2) - output path
+# $(3) - app name
+# output :
+# $(4) - output files list
+define MO_BUILD_PROC_RAW
+$(call CONVERT_ESC_PO_TO_MO,$(1),$(2),$(3)) : $(call DECODE_4MAKE,$(1))
+ @echo ' Building file: $$<'
+ @echo ' Invoking: msgfmt String Formatter'
+ $$(call MAKEDIRS,$$(@D))
+ $$(MSGFMT) -o "$$@" "$$<"
+ @echo ' Finished building: $$<'
+$(4) += $(call CONVERT_ESC_PO_TO_MO,$(1),$(2),$(3))
+endef
+
+
+# parameter :
+# $(1) - output dir
+# $(2) - src paths
+# $(3) - app name
+# output :
+# $(4) - OBJS
+
+define MO_PROC_RAW
+
+_PROJ_ROOT := $(1)
+_SRCS := $(2)
+_APPNAME := $(3)
+
+ifneq ($$(strip $$(_SRCS)),)
+
+_ENC_SRCS := $$(call ENCODE_4MAKE,$$(_SRCS))
+
+_NORMAL_SRCS := $$(filter-out %*.po,$$(_ENC_SRCS))
+_WIDLCARD_SRCS := $$(filter %*.po,$$(_ENC_SRCS))
+
+_ALL_SRCS := $$(call DECODE_4MAKE,$$(_NORMAL_SRCS)) \
+ $$(foreach var,$$(_WIDLCARD_SRCS),$$(call FIND_FILES_4MAKE,$$(call DECODE_4MAKE,$$(var))))
+
+ifneq ($$(strip $$(_ALL_SRCS)),)
+
+_ENC_SRCS := $$(call ENCODE_4MAKE,$$(_ALL_SRCS))
+
+$$(foreach var,$$(_ENC_SRCS),$$(eval $$(call MO_BUILD_PROC_RAW,$$(var),$$(_OUTPUT_DIR),$$(_APPNAME),$(4))))
+
+endif # (_(strip _(_ALL_SRCS)),)
+
+endif # (_(strip _(_SRCS)),)
+
+endef
--- /dev/null
+
+BSLASH := \\#
+NULL_CHAR := #
+SPACE := \ #
+COLON := :#
+DOTDOT := ..#
+SPACE_ESC := &sp;#
+COLON_ESC := &co;#
+SPACE_OUT := ~sp~#
+COLON_OUT := ~co~#
+DOTDOT_OUT := ~dtdt~#
+
+BSLASH2SLASH = $(subst $(BSLASH),/,$(1))
+
+REMOVE_TAIL = $(patsubst %/,%,$(1))
+
+#LOWER_CASE = $(shell echo translit($(1),[A-Z],[a-z])|$(M4))
+LOWER_CASE = $(shell echo $(1)|$(TR) [A-Z] [a-z])
+
+#ifneq ($(findstring Windows,$(OS)),)
+# ...
+#endif
+
+FIND_FILES = $(shell $(FIND) $(1)/$(2) | $(SED) 's/^$(subst /,$(BSLASH)/,$(1))$(BSLASH)///')
+FIND_FILES_ESC = $(shell $(FIND) $(1)/$(2) | $(SED) 's/^$(subst /,$(BSLASH)/,$(1))$(BSLASH)///' -e 's/:/$(BSLASH)&co;/g' -e 's/$(BSLASH) /$(BSLASH)&sp;/g')
+FIND_FILES_4MAKE = $(shell $(FIND) $(1)/$(2) | $(SED) 's/^$(subst /,$(BSLASH)/,$(1))$(BSLASH)///')
+
+FIND_FILES_ABS = $(shell $(FIND) $(1))
+FIND_FILES_ABS_4MAKE = $(shell $(FIND) $(1) -e 's/$(BSLASH) /$(BSLASH)&sp;/g')
+FIND_FILES_ABS_ESC = $(shell $(FIND) $(1) -e 's/:/$(BSLASH)&co;/g' -e 's/$(BSLASH) /$(BSLASH)&sp;/g')
+
+FIND_FILES_4MAKE = $(shell $(FIND) $(1) | $(SED) 's/ /\\\ /g')
+
+#ENCODE_ESC = $(shell echo $(1) | $(SED) -e 's/:/$(BSLASH)&co;/g' -e 's/$(BSLASH) /$(BSLASH)&sp;/g')
+#DECODE_ESC = $(shell echo $(1) | $(SED) -e 's/$(BSLASH)&co;/:/g' -e 's/$(BSLASH)&sp;/$(BSLASH) / g')
+ENCODE_ESC = $(subst $(SPACE),$(SPACE_ESC),$(subst $(COLON),$(COLON_ESC),$(1)))
+DECODE_ESC = $(subst $(COLON_ESC),$(COLON),$(subst $(SPACE_ESC),$(SPACE),$(1)))
+ENCODE_4MAKE = $(subst $(SPACE),$(SPACE_ESC),$(1))
+DECODE_4MAKE = $(subst $(SPACE_ESC),$(SPACE),$(1))
+
+CONVERT_TO_OUT = $(subst $(DOTDOT),$(DOTDOT_OUT),$(subst $(COLON),$(COLON_OUT),$(subst $(SPACE),$(SPACE_OUT),$(1))))
+CONVERT_ESC_TO_OUT = $(subst $(DOTDOT),$(DOTDOT_OUT),$(subst $(COLON_ESC),$(COLON_OUT),$(subst $(SPACE_ESC),$(SPACE_OUT),$(1))))
+CONVERT_4MAKE_TO_OUT = $(subst $(DOTDOT),$(DOTDOT_OUT),$(subst $(COLON),$(COLON_OUT),$(subst $(SPACE_ESC),$(SPACE_OUT),$(1))))
+
+PROC_NO_EXIST = $(if $(wildcard $(1)),,$(call $(2),$(1)))
+define MAKEDIRS0
+ @echo ' Building directory: $(1)'
+ @$(MKDIR) $(MKDIR_OP) $(subst $(BSLASH),/,$(1))
+endef
+MAKEDIRS = $(call PROC_NO_EXIST,$(1),MAKEDIRS0)
-BUILD_SCRIPT_VERSION := 1.0.7
+#
+# Usege : make -f <proj_root>/Build/makefile -C <proj_root>
+#
+
+BUILD_SCRIPT_VERSION := 1.1.0
-all : app_build
-
-clean : app_clean
-
-version : make_version
-
-
-BSLASH := \\#
-BSLASH2SLASH = $(subst $(BSLASH),/,$(1))
-REMOVE_TAIL = $(patsubst %/,%,$(1))
-
-PROJ_ROOT := $(call BSLASH2SLASH,$(PROJPATH))
-
--include $(PROJ_ROOT)/project_def.prop
--include basedef.mk
--include tooldef.mk
--include flags.mk
-# deprecated. use build_def.prop file instead
-#-include prepost.mk
-
-APPTYPE := $(type)
-
-OBJ_OUTPUT := $(call BSLASH2SLASH,$(OUTPUT_DIR)/objs)
-
-OS_NAME = $(shell $(UNAME))
-
-#LOWER_APPNAME := $(shell echo translit($(APPNAME),[A-Z],[a-z])|$(M4))
-LOWER_APPNAME := $(shell echo $(APPNAME)|$(TR) [A-Z] [a-z])
-
-ifeq ($(strip $(APPTYPE)),app)
-APPFILE := $(OUTPUT_DIR)/$(LOWER_APPNAME)
-endif
-ifeq ($(strip $(APPTYPE)),staticLib)
-APPFILE := $(OUTPUT_DIR)/lib$(LOWER_APPNAME).a
-endif
-ifeq ($(strip $(APPTYPE)),sharedLib)
-APPFILE := $(OUTPUT_DIR)/lib$(LOWER_APPNAME).so
-endif
-
-ifneq ($(strip $(PLATFORM_INCS)),)
-PLATFORM_INCS_FILE := $(OBJ_OUTPUT)/platform_incs_file.inc
-endif
-
-FIND_FILES = $(shell $(FIND) $(PROJ_ROOT)/$(dir $(1)) -type f -name $(notdir $(1)) -printf '$(dir $(1))%P ')
-
-NORMAL_SRCS := $(filter-out %*.c %*.cpp %*.cxx %*.cc %*.c++ %*.C,$(USER_SRCS))
-WIDLCARD_SRCS := $(filter %*.c %*.cpp %*.cxx %*.cc %*.c++ %*.C,$(USER_SRCS))
-ALL_SRCS := $(NORMAL_SRCS) $(foreach var,$(WIDLCARD_SRCS),$(call FIND_FILES,$(var)))
-
-C_SRCS := $(filter %.c,$(ALL_SRCS))
-CPP_SRCS := $(filter %.cpp,$(ALL_SRCS))
-CXX_SRCS := $(filter %.cxx,$(ALL_SRCS))
-CC_SRCS := $(filter %.cc,$(ALL_SRCS))
-CPLUSPLUS_SRCS := $(filter %.c++,$(ALL_SRCS))
-CPRIME_SRCS := $(filter %.C,$(ALL_SRCS))
-
-USER_EDCS := $(subst $(BSLASH),/,$(USER_EDCS))
-NORMAL_EDCS := $(filter-out %*.edc,$(USER_EDCS))
-WIDLCARD_EDCS := $(filter %*.edc,$(USER_EDCS))
-EDCS := $(NORMAL_EDCS) $(foreach var,$(WIDLCARD_EDCS),$(call FIND_FILES,$(var)))
-
-NORMAL_POS := $(filter-out %*.po,$(USER_POS))
-WIDLCARD_POS := $(filter %*.po,$(USER_POS))
-POS := $(NORMAL_POS) $(foreach var,$(WIDLCARD_POS),$(call FIND_FILES,$(var)))
-
-LIBPATHS := $(addprefix -L$(PROJ_ROOT)/,$(USER_LIB_DIRS)) \
- $(addprefix -L,$(USER_LIB_DIRS_ABS))
-LIBS += $(addprefix -l,$(USER_LIBS))
-UOBJS := $(addprefix $(PROJ_ROOT)/,$(USER_OBJS)) \
- $(USER_OBJS_ABS)
+.PHONY : app_version app_build app_clean build_version
-M_OPT = -MMD -MP -MF"$(@:%.o=%.d)"
-FUNC_C2O = $(patsubst %.c,$(OBJ_OUTPUT)/%.o,$(1))
-FUNC_CPP2O = $(patsubst %.cpp,$(OBJ_OUTPUT)/%.o,$(1))
-FUNC_CXX2O = $(patsubst %.cxx,$(OBJ_OUTPUT)/%.o,$(1))
-FUNC_CC2O = $(patsubst %.cc,$(OBJ_OUTPUT)/%.o,$(1))
-FUNC_CPLUSPLUS2O = $(patsubst %.c++,$(OBJ_OUTPUT)/%.o,$(1))
-FUNC_CPRIME2O = $(patsubst %.C,$(OBJ_OUTPUT)/%.o,$(1))
-FUNC_EDC2EDJ = $(patsubst %.edc,$(OUTPUT_DIR)/%.edj,$(1))
-FUNC_PO2MO = $(patsubst %.po,$(OUTPUT_DIR)/res/locale/%/LC_MESSAGES/$(subst $(basename $(APPID)).,,$(APPID)).mo,$(notdir $(1)))
-
-
-C_OBJS := $(call FUNC_C2O,$(C_SRCS))
-CPP_OBJS := $(call FUNC_CPP2O,$(CPP_SRCS))
-CXX_OBJS := $(call FUNC_CXX2O,$(CXX_SRCS))
-CC_OBJS := $(call FUNC_CC2O,$(CC_SRCS))
-CPLUSPLUS_OBJS := $(call FUNC_CPLUSPLUS2O,$(CPLUSPLUS_SRCS))
-CPRIME_OBJS := $(call FUNC_CPRIME2O,$(CPRIME_SRCS))
-OBJS := $(C_OBJS) $(CPP_OBJS) $(CXX_OBJS) $(CC_OBJS) $(CPLUSPLUS_OBJS) $(CPRIME_OBJS)
-EDJ_FILES := $(call FUNC_EDC2EDJ,$(EDCS))
-MO_FILES := $(call FUNC_PO2MO,$(POS))
-DEPS := $(OBJS:.o=.d)
-
-
-ifneq ($(strip $(DEPS)),)
--include $(DEPS)
-endif
-
-ifeq ($(strip $(APPTYPE)),app)
-$(APPFILE) : $(OBJS) $(UOBJS)
- @echo ' Building target: $@'
- @echo ' Invoking: C/C++ Linker'
- @$(MKDIR) $(MKDIR_OP) $(subst $(BSLASH),/,$(@D))
- $(CXX) -o "$(APPFILE)" $(OBJS) $(UOBJS) $(LIBPATHS) -Xlinker --as-needed $(LIBS) $(LINK_FLAGS) $(TC_LINKER_MISC) $(RS_LINKER_MISC) -pie -lpthread -Xlinker -rpath="/home/developer/sdk_tools/lib" --sysroot="$(SYSROOT)" -Xlinker --version-script="$(PROJ_PATH)/.exportMap" -L"$(SBI_SYSROOT)/usr/lib" $(RS_LIBRARIES) -Xlinker -rpath="/opt/usr/apps/$(APPID)/lib" -Werror-implicit-function-declaration
- @echo ' Finished building target: $@'
-endif
-ifeq ($(strip $(APPTYPE)),staticLib)
-$(APPFILE) : $(OBJS) $(UOBJS)
- @echo ' Building target: $@'
- @echo ' Invoking: Archive utility'
- @$(MKDIR) $(MKDIR_OP) $(subst $(BSLASH),/,$(@D))
- $(AR) -r "$(APPFILE)" $(OBJS) $(UOBJS) $(AR_FLAGS)
- @echo ' Finished building target: $@'
-endif
-ifeq ($(strip $(APPTYPE)),sharedLib)
-$(APPFILE) : $(OBJS) $(UOBJS)
- @echo ' Building target: $@'
- @echo ' Invoking: C/C++ Linker'
- @$(MKDIR) $(MKDIR_OP) $(subst $(BSLASH),/,$(@D))
- $(CXX) -o "$(APPFILE)" $(OBJS) $(UOBJS) $(LIBPATHS) -Xlinker --as-needed $(LIBS) $(LINK_FLAGS) $(TC_LINKER_MISC) $(RS_LINKER_MISC) -shared -lpthread --sysroot="$(SYSROOT)" -L"$(SYSROOT)/usr/lib" $(RS_LIBRARIES)
- @echo ' Finished building target: $@'
-endif
-
-
-ifneq ($(strip $(C_SRCS)),)
-CDEFS += $(addprefix -D,$(USER_DEFS))
-CDEFS += $(addprefix -U,$(USER_UNDEFS))
-
-INCS := $(addprefix -I$(PROJ_ROOT)/,$(USER_INC_DIRS)) \
- $(addprefix -I,$(USER_INC_DIRS_ABS)) \
- $(addprefix -include$(PROJ_ROOT)/,$(USER_INC_FILES)) \
- $(addprefix -include,$(USER_INC_FILES_ABS))
-
-$(C_OBJS) : $(OBJ_OUTPUT)/%.o : $(PROJ_ROOT)/%.c $(PLATFORM_INCS_FILE)
- @echo ' Building file: $<'
- @echo ' Invoking: C Compiler'
- @$(MKDIR) $(MKDIR_OP) $(subst $(BSLASH),/,$(@D))
-ifeq ($(strip $(APPTYPE)),sharedLib)
- $(CC) -c $< -o $@ $(CDEFS) $(INCS) -I"pch" $(COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) -fPIC --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT) @$(PLATFORM_INCS_FILE)
-else
- $(CC) -c $< -o $@ $(CDEFS) $(INCS) -I"pch" $(COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) -fPIE --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT) @$(PLATFORM_INCS_FILE)
-endif
- @echo ' Finished building: $<'
-endif
-
-ifneq ($(strip $(CPP_SRCS) $(CXX_SRCS) $(CC_SRCS) $(CPLUSPLUS_SRCS) $(CPRIME_SRCS)),)
-CPPDEFS += $(addprefix -D,$(USER_CPP_DEFS))
-CPPDEFS += $(addprefix -U,$(USER_CPP_UNDEFS))
-
-CPP_INCS := $(addprefix -I$(PROJ_ROOT)/,$(USER_CPP_INC_DIRS)) \
- $(addprefix -I,$(USER_CPP_INC_DIRS_ABS)) \
- $(addprefix -include$(PROJ_ROOT)/,$(USER_CPP_INC_FILES)) \
- $(addprefix -include,$(USER_CPP_INC_FILES_ABS))
-
-ifneq ($(strip $(CPP_SRCS)),)
-$(CPP_OBJS) : $(OBJ_OUTPUT)/%.o : $(PROJ_ROOT)/%.cpp $(PLATFORM_INCS_FILE)
- @echo ' Building file: $<'
- @echo ' Invoking: C++ Compiler'
- @$(MKDIR) $(MKDIR_OP) $(subst $(BSLASH),/,$(@D))
-ifeq ($(strip $(APPTYPE)),sharedLib)
- $(CXX) -c $< -o $@ $(CPPDEFS) $(CPP_INCS) -I"pch" $(CPP_COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) -fPIC --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT) @$(PLATFORM_INCS_FILE)
-else
- $(CXX) -c $< -o $@ $(CPPDEFS) $(CPP_INCS) -I"pch" $(CPP_COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) -fPIE --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT) @$(PLATFORM_INCS_FILE)
-endif
- @echo ' Finished building: $<'
-endif
-
-ifneq ($(strip $(CXX_SRCS)),)
-$(CXX_OBJS) : $(OBJ_OUTPUT)/%.o : $(PROJ_ROOT)/%.cxx $(PLATFORM_INCS_FILE)
- @echo ' Building file: $<'
- @echo ' Invoking: C++ Compiler'
- @$(MKDIR) $(MKDIR_OP) $(subst $(BSLASH),/,$(@D))
-ifeq ($(strip $(APPTYPE)),sharedLib)
- $(CXX) -c $< -o $@ $(CPPDEFS) $(CPP_INCS) -I"pch" $(CPP_COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) -fPIC --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT) @$(PLATFORM_INCS_FILE)
-else
- $(CXX) -c $< -o $@ $(CPPDEFS) $(CPP_INCS) -I"pch" $(CPP_COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) -fPIE --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT) @$(PLATFORM_INCS_FILE)
-endif
- @echo ' Finished building: $<'
-endif
-
-ifneq ($(strip $(CC_SRCS)),)
-$(CC_OBJS) : $(OBJ_OUTPUT)/%.o : $(PROJ_ROOT)/%.cc $(PLATFORM_INCS_FILE)
- @echo ' Building file: $<'
- @echo ' Invoking: C++ Compiler'
- @$(MKDIR) $(MKDIR_OP) $(subst $(BSLASH),/,$(@D))
-ifeq ($(strip $(APPTYPE)),sharedLib)
- $(CXX) -c $< -o $@ $(CPPDEFS) $(CPP_INCS) -I"pch" $(CPP_COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) -fPIC --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT) @$(PLATFORM_INCS_FILE)
-else
- $(CXX) -c $< -o $@ $(CPPDEFS) $(CPP_INCS) -I"pch" $(CPP_COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) -fPIE --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT) @$(PLATFORM_INCS_FILE)
-endif
- @echo ' Finished building: $<'
-endif
-
-ifneq ($(strip $(CPLUSPLUS_SRCS)),)
-$(CPLUSPLUS_OBJS) : $(OBJ_OUTPUT)/%.o : $(PROJ_ROOT)/%.c++ $(PLATFORM_INCS_FILE)
- @echo ' Building file: $<'
- @echo ' Invoking: C++ Compiler'
- @$(MKDIR) $(MKDIR_OP) $(subst $(BSLASH),/,$(@D))
-ifeq ($(strip $(APPTYPE)),sharedLib)
- $(CXX) -c $< -o $@ $(CPPDEFS) $(CPP_INCS) -I"pch" $(CPP_COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) -fPIC --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT) @$(PLATFORM_INCS_FILE)
-else
- $(CXX) -c $< -o $@ $(CPPDEFS) $(CPP_INCS) -I"pch" $(CPP_COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) -fPIE --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT) @$(PLATFORM_INCS_FILE)
-endif
- @echo ' Finished building: $<'
-endif
-
-ifneq ($(strip $(CPRIME_SRCS)),)
-$(CPRIME_OBJS) : $(OBJ_OUTPUT)/%.o : $(PROJ_ROOT)/%.C $(PLATFORM_INCS_FILE)
- @echo ' Building file: $<'
- @echo ' Invoking: C++ Compiler'
- @$(MKDIR) $(MKDIR_OP) $(subst $(BSLASH),/,$(@D))
-ifeq ($(strip $(APPTYPE)),sharedLib)
- $(CXX) -c $< -o $@ $(CPPDEFS) $(CPP_INCS) -I"pch" $(CPP_COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) -fPIC --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT) @$(PLATFORM_INCS_FILE)
-else
- $(CXX) -c $< -o $@ $(CPPDEFS) $(CPP_INCS) -I"pch" $(CPP_COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) -fPIE --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT) @$(PLATFORM_INCS_FILE)
-endif
- @echo ' Finished building: $<'
-endif
-
-endif
-
-
-$(OBJ_OUTPUT) :
- @echo ' Building directory: $@'
- @$(MKDIR) $(MKDIR_OP) $(OBJ_OUTPUT)
-
-preproc : $(OBJ_OUTPUT)
-ifneq ($(strip $(PREBUILD_COMMAND)),)
-ifneq ($(strip $(PREBUILD_DESC)),)
- @echo $(PREBUILD_DESC)
-endif
- @echo $(shell $(PREBUILD_COMMAND))
-endif
-
-
-postproc :
-ifneq ($(strip $(POSTBUILD_COMMAND)),)
-ifneq ($(strip $(POSTBUILD_DESC)),)
- @echo $(POSTBUILD_DESC)
-endif
- @echo $(shell $(POSTBUILD_COMMAND))
-endif
-
-ifneq ($(strip $(PLATFORM_INCS)),)
-$(PLATFORM_INCS_FILE) : $(OBJ_OUTPUT)
- @echo ' Building inc file: $@'
-ifneq ($(findstring Linux,$(OS_NAME)),)
- @echo $(PLATFORM_INCS) > $@
-else
-ifneq ($(findstring 3.82,$(MAKE_VERSION)),)
- $(file > $@,$(PLATFORM_INCS))
-else
- @echo $(PLATFORM_INCS) > $@
-endif
-endif
-endif
-
-ALL_EDJ_FILES :=
-
-define EDJ_PROC
-ALL_EDCS := $$(subst $(BSLASH),/,$$($(2)))
-NORMAL_EDCS := $$(filter-out %*.edc,$$(ALL_EDCS))
-WIDLCARD_EDCS := $$(filter %*.edc,$$(ALL_EDCS))
-EDCS := $$(NORMAL_EDCS) $$(foreach var_edc,$$(WIDLCARD_EDCS),$$(call FIND_FILES,$$(var_edc)))
-
-ifneq ($$(strip $$(EDCS)),)
-EDJ_FILES := $$(call FUNC_EDC2EDJ,$$(EDCS))
-
-ALL_EDJ_FILES += $$(EDJ_FILES)
-
-EDC_$(1)_COMPILER_FLAGS := -id "$$(SDK_TOOLPATH)/enventor/share/enventor/images"
-EDC_$(1)_COMPILER_FLAGS += -sd "$$(SDK_TOOLPATH)/enventor/share/enventor/sounds"
-EDC_$(1)_COMPILER_FLAGS += -fd "$$(SDK_TOOLPATH)/enventor/share/enventor/fonts"
+all : app_build
-ifneq ($$(strip $(3)),)
-EDC_$(1)_COMPILER_FLAGS += $$(addprefix -id $$(PROJ_PATH)/,$$($(3)))
-endif
-ifneq ($$(strip $(4)),)
-EDC_$(1)_COMPILER_FLAGS += $$(addprefix -id ,$$($(4)))
-endif
-ifneq ($$(strip $(5)),)
-EDC_$(1)_COMPILER_FLAGS += $$(addprefix -sd $$(PROJ_PATH)/,$$($(5)))
-endif
-ifneq ($$(strip $(6)),)
-EDC_$(1)_COMPILER_FLAGS += $$(addprefix -sd ,$$($(6)))
-endif
-ifneq ($$(strip $(7)),)
-EDC_$(1)_COMPILER_FLAGS += $$(addprefix -fd $$(PROJ_PATH)/,$$($(7)))
-endif
-ifneq ($$(strip $(8)),)
-EDC_$(1)_COMPILER_FLAGS += $$(addprefix -fd ,$$($(8)))
-endif
+clean : app_clean
-$$(EDJ_FILES) : $$(OUTPUT_DIR)/%.edj : $$(PROJ_ROOT)/%.edc
- @echo ' Building file: $$<'
- @echo ' Invoking: EDC Resource Compiler'
- @$$(MKDIR) $$(MKDIR_OP) $$(subst $$(BSLASH),/,$$(@D))
- $$(EDJE_CC) $$(EDC_$(1)_COMPILER_FLAGS) $$(CDEFS) "$$<" "$$@"
- @echo ' Finished building: $$<'
-endif
-endef
+version : build_version
-# Global EDCs
-ifneq ($(strip $(USER_EDCS)),)
-$(eval $(call EDJ_PROC,,USER_EDCS,USER_EDCS_IMAGE_DIRS,USER_EDCS_IMAGE_DIRS_ABS,USER_EDCS_SOUND_DIRS,USER_EDCS_SOUND_DIRS_ABS,USER_EDCS_FONT_DIRS,USER_EDCS_FONT_DIRS_ABS))
-endif
+#PROJ_ROOT = .
+BUILD_ROOT := $(PROJ_PATH)/Build#
-# Individual EDCs
-ifneq ($(strip $(USER_EXT_EDC_KEYS)),)
-$(foreach var,$(USER_EXT_EDC_KEYS),$(eval $(call EDJ_PROC,$(var),USER_EXT_$(var)_EDCS,USER_EXT_$(var)_EDCS_IMAGE_DIRS,USER_EXT_$(var)_EDCS_IMAGE_DIRS_ABS,USER_EXT_$(var)_EDCS_SOUND_DIRS,USER_EXT_$(var)_EDCS_SOUND_DIRS_ABS,USER_EXT_$(var)_EDCS_FONT_DIRS,USER_EXT_$(var)_EDCS_FONT_DIRS_ABS)))
+ifeq ($(MAKE_NAME),mingw32-make)
+ifneq ($(SHELL),)
+OPTIONS += --eval="SHELL=$(SHELL)"
endif
-
-
-ifneq ($(strip $(POS)),)
-define MO_RULE
-$(call FUNC_PO2MO,$(1)) : $(PROJ_ROOT)/$(1)
- @echo ' Building file: $$<'
- @echo ' Invoking: msgfmt String Formatter'
- @$$(MKDIR) $$(MKDIR_OP) $$(subst $$(BSLASH),/,$$(@D))
- $$(MSGFMT) -o $$@ $$<
- @echo ' Finished building: $$<'
-endef
-
-$(foreach var,$(POS),$(eval $(call MO_RULE,$(var))))
endif
-
-secondary-outputs : $(ALL_EDJ_FILES) $(MO_FILES)
-
--include appendix.mk
-
-
-app_build : preproc $(APPFILE) secondary-outputs postproc
+app_build :
+ @echo $(MAKE) -f "$(BUILD_ROOT)/makefile.mk"
+ @$(MAKE) -f "$(BUILD_ROOT)/makefile.mk" -C "$(PROJ_PATH)" $(OPTIONS)
app_clean :
- rm -f "$(APPFILE)"
- rm -rf "$(OUTPUT_DIR)"
+ @$(MAKE) -f "$(BUILD_ROOT)/makefile.mk" -C "$(PROJ_PATH)" $(OPTIONS) clean
-make_version :
- @echo $(BUILD_SCRIPT_VERSION)
+build_version :
+ @echo makefile : $(BUILD_SCRIPT_VERSION)
+ @$(MAKE) -f "$(BUILD_ROOT)/makefile.mk" -C "$(PROJ_PATH)" $(OPTIONS) version
--- /dev/null
+#
+# Usege : make -f <proj_root>/Build/makefile -C <proj_root>
+#
+
+BUILD_SCRIPT_VERSION := 1.2.0
+
+.PHONY : app_version app_clean build_version
+
+
+all : app_build
+
+clean : app_clean
+
+version : build_version
+
+
+#PROJ_ROOT := $(call BSLASH2SLASH,$(PROJPATH))
+PROJ_ROOT := .
+BUILD_ROOT := $(PROJ_ROOT)/Build
+
+include $(PROJ_ROOT)/project_def.prop
+-include $(PROJ_ROOT)/build_def.prop
+
+include $(BUILD_ROOT)/funcs.mk
+
+-include $(BUILD_ROOT)/basedef.mk
+-include $(BUILD_ROOT)/tooldef.mk
+-include $(BUILD_ROOT)/flags.mk
+
+
+APPTYPE := $(type)
+
+OUTPUT_DIR := $(PROJ_ROOT)/$(BUILD_CONFIG)
+OBJ_OUTPUT := $(OUTPUT_DIR)/objs
+
+LOWER_APPNAME := $(call LOWER_CASE,$(APPNAME))
+APPID2 := $(subst $(basename $(APPID)).,,$(APPID))
+
+ifeq ($(strip $(APPTYPE)),app)
+APPFILE := $(OUTPUT_DIR)/$(LOWER_APPNAME)
+endif
+ifeq ($(strip $(APPTYPE)),staticLib)
+APPFILE := $(OUTPUT_DIR)/lib$(LOWER_APPNAME).a
+endif
+ifeq ($(strip $(APPTYPE)),sharedLib)
+APPFILE := $(OUTPUT_DIR)/lib$(LOWER_APPNAME).so
+endif
+
+ifneq ($(strip $(PLATFORM_INCS)),)
+PLATFORM_INCS_FILE := $(OBJ_OUTPUT)/platform_incs_file.inc
+endif
+
+include $(BUILD_ROOT)/build_c.mk
+
+
+ifeq ($(strip $(APPTYPE)),app)
+EXT_OP := -fPIE
+endif
+ifeq ($(strip $(APPTYPE)),staticLib)
+EXT_OP := -fPIE
+endif
+ifeq ($(strip $(APPTYPE)),sharedLib)
+EXT_OP := -fPIC
+endif
+
+C_OPT := $(C_COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) $(EXT_OP) --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT)
+CPP_OPT := $(CPP_COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) $(EXT_OP) --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT)
+C_OPT_FILE := $(PLATFORM_INCS_FILE)
+
+OBJS := #
+
+# Global C/C++
+ifeq ($(strip $(USER_ROOT)),)
+USER_ROOT := $(PROJ_ROOT)
+endif
+$(eval $(call C_PROC_RAW,$(OBJ_OUTPUT),$(USER_SRCS),$(USER_INC_DIRS),$(USER_INC_FILES),$(USER_DEFS),$(USER_UNDEFS),$(C_OPT),$(C_OPT_FILE),C,c,$(CC),OBJS))
+$(foreach ext,cpp cxx cc c++ C,$(eval $(call C_PROC_RAW,$(OBJ_OUTPUT),$(USER_SRCS),$(USER_INC_DIRS),$(USER_CPP_INC_FILES),$(USER_CPP_DEFS),$(USER_CPP_UNDEFS),$(CPP_OPT),$(C_OPT_FILE),C++,$(ext),$(CXX),OBJS)))
+
+# Individual C/C++
+ifneq ($(strip $(USER_EXT_C_KEYS)),)
+$(foreach var,$(USER_EXT_C_KEYS),$(eval $(call C_PROC_RAW,$(OBJ_OUTPUT),$(USER_EXT_$(var)_SRCS),$(USER_EXT_$(var)_INC_DIRS),$(USER_EXT_$(var)_INC_FILES),$(USER_EXT_$(var)_DEFS),$(USER_EXT_$(var)_UNDEFS),$(C_OPT),$(C_OPT_FILE),C,c,$(CC),OBJS)))
+$(foreach ext,cpp cxx cc c++ C,$(foreach var,$(USER_EXT_C_KEYS),$(eval $(call C_PROC_RAW,$(OBJ_OUTPUT),$(USER_EXT_$(var)_SRCS),$(USER_EXT_$(var)_INC_DIRS),$(USER_EXT_$(var)_CPP_INC_FILES),$(USER_EXT_$(var)_CPP_DEFS),$(USER_EXT_$(var)_CPP_UNDEFS),$(C_OPT),$(C_OPT_FILE),C++,$(ext),$(CXX),OBJS))))
+endif
+
+
+ifneq ($(strip $(USER_LIB_DIRS)),)
+_ENC_USER_LIB_DIRS := $(call ENCODE_4MAKE,$(USER_LIB_DIRS))
+_ENC_USER_LIB_DIRS := $(addprefix -L,$(call $(_ENC_USER_LIB_DIRS))
+LIBPATHS := $(call DECODE_4MAKE,$(_ENC_USER_LIB_DIRS))
+endif
+
+LIBS += $(addprefix -l,$(USER_LIBS))
+
+UOBJS += $(USER_OBJS)
+
+M_OPT = -MMD -MP -MF"$(@:%.o=%.d)"
+
+DEPS := $(OBJS:.o=.d)
+
+ifneq ($(strip $(DEPS)),)
+-include $(PROJ_ROOT)/Build/$(DEPS)
+endif
+
+
+ifeq ($(strip $(APPTYPE)),app)
+$(APPFILE) : $(OBJS) $(UOBJS)
+ @echo ' Building target: $@'
+ @echo ' Invoking: C/C++ Linker'
+ $(call MAKEDIRS,$(@D))
+ $(CXX) -o $(APPFILE) $(OBJS) $(UOBJS) $(LIBPATHS) -Xlinker --as-needed $(LIBS) $(LINK_FLAGS) $(TC_LINKER_MISC) $(RS_LINKER_MISC) -pie -lpthread -Xlinker -rpath="/home/developer/sdk_tools/lib" --sysroot="$(SYSROOT)" -Xlinker --version-script="$(PROJ_ROOT)/.exportMap" $(RS_LIB_PATHS) $(RS_LIBRARIES) -Xlinker -rpath="/opt/usr/apps/$(APPID)/lib" -Werror-implicit-function-declaration
+ @echo ' Finished building target: $@'
+endif
+ifeq ($(strip $(APPTYPE)),staticLib)
+$(APPFILE) : $(OBJS) $(UOBJS)
+ @echo ' Building target: $@'
+ @echo ' Invoking: Archive utility'
+ $(call MAKEDIRS,$(@D))
+ $(AR) -r $(APPFILE) $(OBJS) $(UOBJS) $(AR_FLAGS)
+ @echo ' Finished building target: $@'
+endif
+ifeq ($(strip $(APPTYPE)),sharedLib)
+$(APPFILE) : $(OBJS) $(UOBJS)
+ @echo ' Building target: $@'
+ @echo ' Invoking: C/C++ Linker'
+ $(call MAKEDIRS,$(@D))
+ $(CXX) -o $(APPFILE) $(OBJS) $(UOBJS) $(LIBPATHS) -Xlinker --as-needed $(LIBS) $(LINK_FLAGS) $(TC_LINKER_MISC) $(RS_LINKER_MISC) -shared -lpthread --sysroot="$(SYSROOT)" $(RS_LIB_PATHS) $(RS_LIBRARIES)
+ @echo ' Finished building target: $@'
+endif
+
+
+$(OBJ_OUTPUT) :
+ $(call MAKEDIRS,$@)
+
+$(OUTPUT_DIR) :
+ $(call MAKEDIRS,$@)
+
+
+ifneq ($(strip $(PLATFORM_INCS)),)
+$(PLATFORM_INCS_FILE) : $(OBJ_OUTPUT)
+ @echo ' Building inc file: $@'
+ifneq ($(findstring Windows,$(OS)),)
+ifneq ($(findstring 3.82,$(MAKE_VERSION)),)
+ $(file > $@,$(PLATFORM_INCS))
+else
+ @echo $(PLATFORM_INCS) > $@
+endif
+else
+ @echo $(PLATFORM_INCS) > $@
+endif
+endif
+
+
+include $(BUILD_ROOT)/build_edc.mk
+
+EDJ_FILES :=
+
+# Global EDCs
+ifneq ($(strip $(USER_EDCS)),)
+$(eval $(call EDJ_PROC_RAW,$(OUTPUT_DIR),$(USER_EDCS),$(USER_EDCS_IMAGE_DIRS),$(USER_EDCS_SOUND_DIRS),$(USER_EDCS_FONT_DIRS),EDJ_FILES))
+endif
+
+# Individual EDCs
+ifneq ($(strip $(USER_EXT_EDC_KEYS)),)
+$(foreach var,$(USER_EXT_EDC_KEYS),$(eval $(call EDJ_PROC_RAW,$(OUTPUT_DIR),$(USER_EXT_$(var)_EDCS),$(USER_EXT_$(var)_EDCS_IMAGE_DIRS),$(USER_EXT_$(var)_EDCS_SOUND_DIRS),$(USER_EXT_$(var)_EDCS_FONT_DIRS),EDJ_FILES)))
+endif
+
+
+include $(BUILD_ROOT)/build_po.mk
+
+MO_FILES :=
+
+# Global POs
+ifneq ($(strip $(USER_POS)),)
+$(eval $(call MO_PROC_RAW,$(OUTPUT_DIR),$(USER_POS),$(APPID2),MO_FILES))
+endif
+
+
+secondary-outputs : $(EDJ_FILES) $(MO_FILES)
+
+-include appendix.mk
+
+app_build : $(OUTPUT_DIR) $(APPFILE) secondary-outputs
+ @echo ========= done =========
+
+
+app_clean :
+ rm -f $(APPFILE)
+ rm -rf $(OUTPUT_DIR)
+
+build_version :
+ @echo makefile.mk : $(BUILD_SCRIPT_VERSION)
BUILD_CONFIG = Debug
endif
+ifneq ($(strip $(PROJROOT)),)
+PROJPATH := $(PROJROOT)
+endif
+
ifeq ($(strip $(OUTPUT_DIR)),)
OUTPUT_DIR := $(PROJPATH)/$(BUILD_CONFIG)
endif
+ifneq ($(strip $(SHELL_BIN)),)
+SHELL = $(SHELL_BIN)
+else
+SHELL = sh
+endif
ifneq ($(strip $(MKDIR_BIN)),)
MKDIR = $(MKDIR_BIN)
FIND = find
endif
+ifneq ($(strip $(SED_BIN)),)
+SED = $(SED_BIN)
+else
+SED = sed
+endif
+
ifneq ($(strip $(GREP_BIN)),)
GREP = $(GREP_BIN)
else
#include <unistd.h>
#include <dlog.h>
+#include <dlog-internal.h>
#undef LOG_TAG
#define LOG_TAG "NOTI-SETTING"
#define HAPI __attribute__((visibility("hidden")))
+#define NOTISET_TRACE_BEGIN \
+ LOG(LOG_DEBUG, LOG_TAG, "[ENTER]\n");
+
#if !defined(FREEIF)
#define FREEIF(p) ({if (p) {free(p); p = NULL; }})
#endif
--- /dev/null
+/*
+ * Copyright (c) 2009 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+
+#ifndef __SET_SCHEDULE_INFO_H__
+#define __SET_SCHEDULE_INFO_H__
+
+#include <Evas.h>
+
+#include <Elementary.h>
+#include "log.h"
+#include "common-efl.h"
+
+void gl_set_schedule_selected(ug_data *data);
+bool get_schedule();
+Evas_Object *start_end_time_item(Evas_Object* parent);
+
+#endif //__SET_SCHEDULE_INFO_H__
profile = mobile-3.0
# C Sources
-USER_SRCS = src/excepted-apps-efl.c src/pkgmgr-setting-info.c src/notification-setting-info.c src/main.c src/do-not-disturb-efl.c src/common-efl.c
+USER_SRCS = src/common-efl.c src/do-not-disturb-efl.c src/notification-setting-info.c src/excepted-apps-efl.c src/main.c src/pkgmgr-setting-info.c src/set-schedule-info.c
USER_SRCS_ABS =
# EDC Sources
USER_EDCS =
# PO Sources
-USER_POS = res/po/is.po res/po/ja_JP.po res/po/bg.po res/po/gl.po res/po/pt_PT.po res/po/pl.po res/po/mk.po res/po/es_US.po res/po/ar.po res/po/uk.po res/po/fi.po res/po/lt.po res/po/ko_KR.po res/po/en.po res/po/et.po res/po/hr.po res/po/en_US.po res/po/ru_RU.po res/po/el_GR.po res/po/it_IT.po res/po/nl.po res/po/hu.po res/po/zh_TW.po res/po/kk.po res/po/eu.po res/po/ca.po res/po/cs.po res/po/fr_CA.po res/po/az.po res/po/fr.po res/po/ro.po res/po/sv.po res/po/ga.po res/po/ka.po res/po/sl.po res/po/pt_BR.po res/po/uz.po res/po/zh_HK.po res/po/hi.po res/po/tr_TR.po res/po/en_PH.po res/po/sk.po res/po/lv.po res/po/sr.po res/po/es_ES.po res/po/zh_CN.po res/po/hy.po res/po/nb.po res/po/da.po res/po/de.po
+USER_POS = res/po/fr.po res/po/it_IT.po res/po/et.po res/po/sr.po res/po/hy.po res/po/ca.po res/po/is.po res/po/hi.po res/po/az.po res/po/en_US.po res/po/hr.po res/po/ka.po res/po/zh_HK.po res/po/pl.po res/po/el_GR.po res/po/ko_KR.po res/po/lt.po res/po/sl.po res/po/uz.po res/po/sv.po res/po/fi.po res/po/fr_CA.po res/po/eu.po res/po/bg.po res/po/ja_JP.po res/po/en_PH.po res/po/nl.po res/po/gl.po res/po/uk.po res/po/de.po res/po/tr_TR.po res/po/zh_TW.po res/po/en.po res/po/lv.po res/po/nb.po res/po/pt_PT.po res/po/ru_RU.po res/po/da.po res/po/ro.po res/po/es_ES.po res/po/mk.po res/po/ga.po res/po/sk.po res/po/kk.po res/po/cs.po res/po/pt_BR.po res/po/hu.po res/po/zh_CN.po res/po/ar.po res/po/es_US.po
# User Defines
USER_DEFS =
# EDC Flags
USER_EXT_EDC_KEYS = EDC0
-USER_EXT_EDC0_EDCS = res/edje/setting_notification.edc
+USER_EXT_EDC0_EDCS = res/edje/repeat_weekly_item.edc res/edje/setting_notification.edc res/edje/time_button_layout.edc
USER_EXT_EDC0_EDCS_IMAGE_DIRS = edje/images
USER_EXT_EDC0_EDCS_IMAGE_DIRS_ABS =
USER_EXT_EDC0_EDCS_SOUND_DIRS = edje/sounds
--- /dev/null
+/*
+* Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+collections {
+ base_scale: 2.6;
+ group { name: "weekly_item";
+ parts {
+ part { name: "base";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ align: 0.0 0.0;
+ fixed: 0 0;
+ min: 0 240;
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 1.0;
+ }
+ }
+ part { name: "left_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 32 0;
+ max: 32 -1;
+ align: 0.0 0.0;
+ rel1 {
+ to: "base";
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ to: "base";
+ relative: 0.0 1.0;
+ }
+ }
+ }
+ part { name: "right_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 32 0;
+ max: 32 -1;
+ align: 1.0 0.0;
+ rel1 {
+ to: "base";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to: "base";
+ relative: 1.0 1.0;
+ }
+ }
+ }
+ part { name: "top_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 24;
+ align: 0.5 0.0;
+ rel1 {
+ to_x: "left_padding";
+ to_y: "base";
+ relative: 1.0 0.0;
+ }
+ rel2 {
+ to_x: "right_padding";
+ to_y: "base";
+ relative: 0.0 0.0;
+ }
+ }
+ }
+ part { name: "elm.swallow.text";
+ type: SWALLOW;
+ scale: 1;
+ mouse_events: 0;
+ description { state: "default" 0.0;
+ min: 0 54;
+ max: -1 54;
+ align: 0.5 0.0;
+ rel1 {
+ to: "top_padding";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to: "top_padding";
+ relative: 1.0 1.0;
+ }
+ }
+ }
+ part { name: "text_content_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 10;
+ align: 0.0 0.0;
+ rel1 {
+ to: "elm.swallow.text";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to: "elm.swallow.text";
+ relative: 1.0 1.0;
+ }
+ }
+ }
+ part { name: "elm.box.content";
+ type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ align: 0.5 0.0;
+ min: 0 120;
+ rel1 {
+ to: "text_content_padding";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to: "text_content_padding";
+ relative: 1.0 1.0;
+ }
+ }
+ }
+ part { name: "bottom_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 24;
+ max: -1 24;
+ align: 0.5 0.0;
+ rel1 {
+ to: "elm.box.content";
+ relative: 0.0 1.0;
+ }
+ rel2 {
+ to: "elm.box.content";
+ relative: 1.0 1.0;
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+collections {
+ base_scale: 2.6;
+ group { name: "button_layout";
+ parts {
+ part { name: "base";
+ type: RECT;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 300 78;
+ color: 250 250 250 255;
+ }
+ }
+ part { name: "elm.swallow.content";
+ type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ rel1.to: "base";
+ rel2.to: "base";
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
SET(SRCS
common-efl.c
+ do-not-disturb-efl.c
excepted-apps-efl.c
main.c
notification-setting-info.c
pkgmgr-setting-info.c
- do-not-disturb-efl.c
+ set-schedule-info.c
)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/inc/)
#include "pkgmgr-setting-info.h"
#include "common-efl.h"
-
+#include "set-scedule-info.h"
#define ICON_SIZE 82
elm_check_state_set(check, !elm_check_state_get(check));
evas_object_smart_callback_call(check, "changed", NULL);
}
+
+ if(data && !strcmp(data, "set-schedule-multiline")) {
+ gl_set_schedule_selected(&g_ug_data);
+ }
}
void gl_contracted_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
itc->func.del = gl_del_cb;
- elm_genlist_item_append(genlist, /* genlist object */
+ elm_genlist_item_append(genlist, /* genlist object */
itc, /* item class */
strdup(text), /* item class user data */
NULL, /* parent item */
ELM_GENLIST_ITEM_NONE, /* item type */
gl_selected_cb, /* select smart callback */
- NULL); /* smart callback user data */
+ NULL); /* smart callback user data */
elm_genlist_item_class_free(itc);
static void _excepted_check_changed_cb(void *data, Evas_Object *obj, void *event_info)
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
item_info_s *data_list = data;
ret_if(!data_list);
static void _do_not_disturb_check_changed_cb(void *data, Evas_Object *obj, void *event_info)
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
Eina_Bool state = elm_check_state_get(obj);
set_do_not_disturb(state);
NOTISET_DBG("do_not_disturb check value = %s", state==false ? "FALSE":"TRUE");
}
+static void _set_schedule_check_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ NOTISET_TRACE_BEGIN;
+ //TODO: Will be done, after receiving API
+}
+
static void _app_notif_allow_all_check_changed_cb(void *data, Evas_Object *obj, void *event_info)
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
Eina_Bool state = elm_check_state_get(obj);
NOTISET_DBG("allow_all check value = %s", state==false ? "FALSE":"TRUE");
static void _allow_to_nofity_check_changed_cb(void *data, Evas_Object *obj, void *event_info)
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
item_info_s *data_list = data;
ret_if(!data_list);
}
void append_gl_item_list(Evas_Object *genlist, Eina_List* list, int style) {
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
ret_if(!itc);
if (!strcmp(part, "elm.text")) {
return strdup(APP_STRING("IDS_ST_HEADER_DO_NOT_DISTURB_ABB"));
}
+ } else if(!strcmp(data, "set-schedule-multiline")) {
+ if (!strcmp("elm.text", part)) {
+ return strdup(APP_STRING("IDS_ST_MBODY_SET_SCHEDULE_M_TIME"));
+ }
+ if (!strcmp("elm.text.multiline", part)) {
+ snprintf(buf, sizeof(buf), "<font_size=30>%s<br/>%s</font_size>", "M T W T F S S", "10:00 p.m. ~ 7:00 a.m."); //TODO:
+ return strdup(buf);
+ }
+ } else if(!strcmp(data, "set-schedule")) {
+ if (!strcmp("elm.text", part)) {
+ return strdup(APP_STRING("IDS_ST_MBODY_SET_SCHEDULE_M_TIME"));
+ }
+ } else if(!strcmp(data, "start-time") && !strcmp("elm.text", part)) {
+ return strdup(APP_STRING("IDS_ST_BODY_START_TIME"));
+ } else if(!strcmp(data, "end-time") && !strcmp("elm.text", part)) {
+ return strdup(APP_STRING("IDS_ST_BODY_END_TIME"));
}
-
+
return NULL;
}
-
-
static Evas_Object* _gl_option_content_get_cb(void *data, Evas_Object *obj, const char *part)
{
retv_if(!data, NULL);
- if (!strcmp(data, "do-not-disturb") &&!strcmp(part, "elm.swallow.end") ) {
- Evas_Object *check = NULL;
- check = elm_check_add(obj);
- elm_object_style_set(check, "on&off");
- elm_check_state_set(check, get_do_not_disturb());
- evas_object_show(check);
- evas_object_pass_events_set(check, 1);
- evas_object_smart_callback_add(check, "changed", _do_not_disturb_check_changed_cb, NULL);
- evas_object_propagate_events_set(check, 0);
- return check;
+ if (!strcmp(data, "set-schedule") && !strcmp("elm.swallow.end", part)) {
+ Evas_Object *check = elm_check_add(obj);
+ elm_object_style_set(check, "on&off");
+ elm_check_state_set(check, get_schedule());
+ evas_object_show(check);
+ evas_object_pass_events_set(check, 1);
+ evas_object_propagate_events_set(check, 0);
+ evas_object_smart_callback_add(check, "changed", _set_schedule_check_changed_cb, NULL);
+ return check;
}
+
+ if(!strcmp(data, "start-time") && !strcmp("elm.swallow.end", part))
+ {
+ return start_end_time_item(obj);
+ }
+
+ if(!strcmp(data, "end-time") && !strcmp("elm.swallow.end", part))
+ {
+ return start_end_time_item(obj);
+ }
+
+ if(!strcmp(part, "elm.swallow.end") && !strcmp(data, "do-not-disturb")) {
+ Evas_Object *check = elm_check_add(obj);
+ elm_object_style_set(check, "on&off");
+ elm_check_state_set(check, get_schedule());
+ evas_object_show(check);
+ evas_object_pass_events_set(check, 1);
+ evas_object_propagate_events_set(check, 0);
+ evas_object_smart_callback_add(check, "changed", _do_not_disturb_check_changed_cb, NULL);
+ return check;
+ }
return NULL;
}
Elm_Widget_Item *append_gl_allow_all(Evas_Object *genlist)
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
if (!itc)
}
void append_gl_start_option(Evas_Object *genlist, char *style, char *ugName) {
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
Elm_Genlist_Item_Class *itc = elm_genlist_item_class_new();
ret_if(!itc);
itc->func.text_get = _gl_option_text_get_cb;
itc->func.content_get = _gl_option_content_get_cb;
itc->func.del = gl_del_cb;
-
- elm_genlist_item_append(genlist, /* genlist object */
- itc, /* item class */
- ugName, /* item class user data */
- NULL, /* parent item */
- ELM_GENLIST_ITEM_NONE, /* item type */
- gl_selected_cb, /* select smart callback */
- NULL); /* smart callback user data */
+
+ elm_genlist_item_append(genlist, /* genlist object */
+ itc, /* item class */
+ ugName, /* item class user data */
+ NULL, /* parent item */
+ ELM_GENLIST_ITEM_NONE, /* item type */
+ gl_selected_cb, /* select smart callback */
+ ugName); /* smart callback user data */
elm_genlist_item_class_free(itc);
}
itc->func.content_get = _gl_full_content_get_cb;
itc->func.del = _gl_full_content_del_cb;
- Elm_Object_Item *genlist_item = elm_genlist_item_append(genlist, /* genlist object */
- itc, /* item class */
- data, /* item class user data */
- NULL, /* parent item */
- ELM_GENLIST_ITEM_NONE, /* item type */
- gl_selected_cb, /* select smart callback */
- NULL); /* smart callback user data */
+ Elm_Object_Item *genlist_item = elm_genlist_item_append(genlist, /* genlist object */
+ itc, /* item class */
+ data, /* item class user data */
+ NULL, /* parent item */
+ ELM_GENLIST_ITEM_NONE, /* item type */
+ gl_selected_cb, /* select smart callback */
+ NULL); /* smart callback user data */
elm_genlist_item_select_mode_set(genlist_item, ELM_OBJECT_SELECT_MODE_NONE);
elm_genlist_item_class_free(itc);
}
void do_not_disturb_append_item_in_list(Evas_Object* genlist)
{
append_gl_start_option(genlist, "multiline", "do-not-disturb");
+ append_gl_start_option(genlist, "multiline", "set-schedule-multiline");
append_gl_full_item(genlist, do_not_disturb_allowed_apps_cont_cb, get_excepted_apps_list());
}
static void _done_button_cb(void *data, Evas_Object *obj, void *event_info)
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
ug_data* u_data = data;
Eina_List *list = NULL;
void exception_application_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
ug_data* u_data = data;
ret_if(!u_data);
static Eina_Bool _notifiacation_setting_main_pop_cb(void *data, Elm_Object_Item * it)
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
ug_data *ugd = (ug_data *) data;
retv_if(!ugd, EINA_FALSE);
static void _create_do_not_disturb_view(void *data)
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
ug_data *ugd = (ug_data *) data;
ret_if(!ugd);
static void _create_notif_view(void *data)
{
- NOTISET_DBG("create main view");
+ NOTISET_TRACE_BEGIN;
ug_data *ugd = (ug_data *) data;
ret_if(!ugd);
static Evas_Object *_create_fullview(Evas_Object *parent, ug_data *ugd, app_type type)
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
retv_if(!ugd, NULL);
switch(type)
static bool on_create(void *priv)
{
- NOTISET_DBG("START");
+ NOTISET_TRACE_BEGIN;
ug_data *ugd = priv;
elm_app_base_scale_set(2.6);
static void on_destroy(void *priv)
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
ug_data *ugd = priv;
remove_all_apps_list();
free(ugd);
static void on_app_control(app_control_h app_control, void *user_data)
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
ug_data *ugd = user_data;
char *op_str = NULL;
int main(int argc, char *argv[])
{
- NOTISET_DBG("app init !!!");
+ NOTISET_TRACE_BEGIN;
ui_app_lifecycle_callback_s event_callback;
memset(&event_callback, 0x00, sizeof(ui_app_lifecycle_callback_s));
void create_app_notification_list()
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
int i = 0;
int count = 0;
char *package_name = NULL;
void create_do_not_disturb_application_list()
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
int i = 0;
int count = 0;
char *package_name = NULL;
Eina_List *get_excepted_apps_list()
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
return setting_info->excepted_list;
}
Eina_List *get_all_apps_list()
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
return setting_info->all_apps_list;
}
void set_allow_all(bool state)
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
item_info_s *item = NULL;
Eina_List *list = get_all_apps_list();
Eina_List *get_not_excepted_apps_list()
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
return setting_info->not_excepted_list;
}
bool get_do_not_disturb()
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
int err = NOTIFICATION_ERROR_NONE;
notification_system_setting_h system_setting = NULL;
void set_do_not_disturb(bool state)
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
int err = NOTIFICATION_ERROR_NONE;
notification_system_setting_h system_setting = NULL;
bool set_allow_to_nofity(char *pkg_name, bool state)
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
int err = NOTIFICATION_ERROR_NONE;
notification_setting_h setting = NULL;
bool set_excepted_apps(char *pkg_name, bool state)
{
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
int err = NOTIFICATION_ERROR_NONE;
}
static void _remove_apps_list(Eina_List* input_list) {
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
item_info_s *item_info = NULL;
if(input_list) {
void remove_all_apps_list() {
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
if(setting_info) {
_remove_apps_list(setting_info->all_apps_list);
}
}
void remove_excepted_apps_list(){
- NOTISET_DBG("");
+ NOTISET_TRACE_BEGIN;
if(setting_info) {
_remove_apps_list(setting_info->excepted_list);
_remove_apps_list(setting_info->not_excepted_list);
--- /dev/null
+/*
+ * Copyright (c) 2009 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "set-scedule-info.h"
+#include <system_settings.h>
+
+extern ug_data g_ug_data;
+
+enum TimeFormat
+ {
+ time_format_unknown,
+ time_format_24H,
+ time_format_12H
+ };
+
+#define TIME_12_FORMAT "%I:%M %p"
+#define POPUP_TIME_12_FORMAT "%d/%b/%Y %I:%M %p"
+#define TIME_12_LAYOUT "time_layout"
+
+#define POPUP_TIME_24_FORMAT "%d/%b/%Y %H:%M"
+#define TIME_24_FORMAT "%H:%M"
+#define TIME_24_LAYOUT "time_layout_24hr"
+
+#define TIME_STRING_SIZE 200
+#define BUTTON_TEXT_SIZE 512
+#define WEEK_BUTTON_SIZE 80
+
+typedef struct changecolor
+{
+ const char *text;
+ bool change_color;
+ Evas_Object *label;
+} changecolor_s;
+
+typedef struct datetime
+{
+ Evas_Object *button;
+ Evas_Object *datetime;
+ Evas_Object *popup;
+ struct tm saved_time;
+ bool is_start_button;
+} datetime_s;
+
+static int get_time_format()
+{
+ bool timeFormat = false;
+ if(system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, &timeFormat) < 0)
+ return time_format_unknown;
+ return timeFormat ? time_format_24H : time_format_12H;
+}
+
+static Evas_Object *_create_set_schedule_disturb_gl(ug_data *ugd)
+{
+ NOTISET_TRACE_BEGIN;
+ Evas_Object *parent = ugd->naviframe;
+
+ Evas_Object *genlist = elm_genlist_add(parent);
+ elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
+ evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ return genlist;
+}
+
+bool get_schedule()
+{
+ NOTISET_TRACE_BEGIN;
+ // TODO: will be implemented after receiving of API
+ return false;
+}
+
+static Evas_Object *create_week_repeat_layout(Evas_Object* parent)
+{
+ Evas_Object *layout = elm_layout_add(parent);
+
+ char *res_path = app_get_resource_path();
+ if(res_path)
+ {
+ char edj_path[PATH_MAX] = { 0, };
+ snprintf(edj_path, PATH_MAX, "%s%s", res_path, "edje/repeat_weekly_item.edj");
+ elm_layout_file_set(layout, edj_path, "weekly_item");
+ free(res_path);
+ }
+
+ evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_show(layout);
+
+ return layout;
+}
+static void week_button_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ NOTISET_TRACE_BEGIN;
+ changecolor_s *cc = data;
+ char buf[BUTTON_TEXT_SIZE] = {0, };
+
+ if(cc->change_color)
+ {
+ snprintf(buf, sizeof(buf), "<font_size=80><color=#000000>%s</color></font_size>", cc->text);
+ elm_object_text_set(cc->label, buf);
+ } else {
+ snprintf(buf, sizeof(buf), "<font_size=80><color=#66ff66>%s</color></font_size>", cc->text);
+ elm_object_text_set(cc->label, buf);
+ }
+
+ cc->change_color = !cc->change_color;
+}
+
+static Evas_Object *create_week_button(Evas_Object *parent, const char *text)
+{
+ //add buttons
+ Evas_Object *button = elm_button_add(parent);
+ evas_object_size_hint_max_set(button, WEEK_BUTTON_SIZE, WEEK_BUTTON_SIZE);
+ evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_style_set(button, "transparent");
+
+ Evas_Object *label = elm_label_add(button);
+ evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ char buf[BUTTON_TEXT_SIZE] = {0, };
+ snprintf(buf, sizeof(buf), "<font_size=80><color=#000000>%s</color></font_size>", text);
+ elm_object_text_set(label, buf);
+ evas_object_show(label);
+
+ changecolor_s *cc = calloc(1, sizeof(changecolor_s));
+ cc->label = label;
+ cc->change_color = false;
+ cc->text = text;
+
+ evas_object_smart_callback_add(button, "clicked", week_button_clicked_cb, cc);
+ elm_object_content_set(button, label);
+ evas_object_show(button);
+ elm_box_pack_end(parent, button);
+ return button;
+}
+
+static Evas_Object *repeat_weekly_layout_cb(Evas_Object* parent, void *data)
+{
+ Evas_Object *layout = create_week_repeat_layout(parent);
+
+ // Set text into layout
+ Evas_Object *text = elm_label_add(layout);
+ evas_object_size_hint_weight_set(text, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(text, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_text_set(text, "<font_size=40>Repeat weekly</font_size>");
+ elm_object_part_content_set(layout, "elm.swallow.text", text);
+ evas_object_show(text);
+
+ Evas_Object *box = elm_box_add(layout);
+
+ evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_box_horizontal_set(box, EINA_TRUE);
+ elm_object_part_content_set(layout, "elm.box.content", box);
+
+ create_week_button(box, "M");
+ create_week_button(box, "T");
+ create_week_button(box, "W");
+ create_week_button(box, "T");
+ create_week_button(box, "F");
+ create_week_button(box, "S");
+ create_week_button(box, "S");
+
+ evas_object_show(box);
+ elm_box_recalculate(box);
+
+ return layout;
+}
+
+static void popup_cancel_btn_clicked_cb(void *data , Evas_Object *obj , void *event_info)
+{
+ evas_object_del(data);
+}
+
+static void popup_set_btn_clicked_cb(void *data , Evas_Object *obj , void *event_info)
+{
+ NOTISET_TRACE_BEGIN;
+ char buff[TIME_STRING_SIZE] = {0};
+ const char *format;
+ datetime_s *dt = data;
+ elm_datetime_value_get(dt->datetime, &dt->saved_time);
+ format = elm_datetime_format_get(dt->datetime);
+
+ if (!strcmp(format, POPUP_TIME_12_FORMAT)) {
+ strftime(buff, TIME_STRING_SIZE, TIME_12_FORMAT, &dt->saved_time);
+ elm_object_text_set(dt->button, buff);
+ } else {
+ strftime(buff, TIME_STRING_SIZE, TIME_24_FORMAT, &dt->saved_time);
+ elm_object_text_set(dt->button, buff);
+ }
+
+ evas_object_del(dt->popup);
+}
+
+static void create_datetime_popup(datetime_s *dt)
+{
+ Evas_Object *set_btn, *cancel_btn;
+
+ dt->popup = elm_popup_add(g_ug_data.naviframe);
+ eext_object_event_callback_add(dt->popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL);
+ evas_object_size_hint_weight_set(dt->popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_popup_align_set(dt->popup, ELM_NOTIFY_ALIGN_FILL, 0.5);
+
+ cancel_btn = elm_button_add(dt->popup);
+ elm_object_style_set(cancel_btn, "popup");
+ elm_object_text_set(cancel_btn, "Cancel");
+ elm_object_part_content_set(dt->popup, "button1", cancel_btn);
+ evas_object_smart_callback_add(cancel_btn, "clicked", popup_cancel_btn_clicked_cb, dt->popup);
+
+ set_btn = elm_button_add(dt->popup);
+ elm_object_style_set(set_btn, "popup");
+ elm_object_text_set(set_btn, "Set");
+ elm_object_part_content_set(dt->popup, "button2", set_btn);
+ evas_object_smart_callback_add(set_btn, "clicked", popup_set_btn_clicked_cb, dt);
+}
+
+static void launch_popup_cb(void *data , Evas_Object *obj , void *event_info)
+{
+ char *format;
+ datetime_s *dt = data;
+ create_datetime_popup(dt);
+ Evas_Object *box = elm_box_add(dt->popup);
+
+ dt->datetime = elm_datetime_add(g_ug_data.naviframe);
+
+ format = evas_object_data_get(obj, "format");
+ bool fmt12hours = !strcmp(format, TIME_12_FORMAT);
+ const char *fmt = fmt12hours ? TIME_12_LAYOUT : TIME_24_LAYOUT;
+ const char* timeMask = fmt12hours ? POPUP_TIME_12_FORMAT : POPUP_TIME_24_FORMAT;
+
+ elm_object_part_text_set(dt->popup, "title,text", "Time Picker");
+ elm_object_style_set(dt->datetime, fmt);
+ elm_datetime_format_set(dt->datetime, timeMask);
+
+ elm_datetime_value_set(dt->datetime, &dt->saved_time);
+ evas_object_size_hint_align_set(dt->datetime, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ evas_object_show(dt->datetime);
+ elm_box_pack_end(box, dt->datetime);
+ elm_object_content_set(dt->popup, box);
+
+ evas_object_show(dt->popup);
+}
+
+static Evas_Object *create_time_button(Evas_Object *parent, const char *text, const char *format, datetime_s *dt)
+{
+ Evas_Object *button = elm_button_add(parent);
+ elm_object_text_set(button, text);
+ evas_object_show(button);
+ evas_object_data_set(button, "format", format);
+ evas_object_smart_callback_add(button, "clicked", launch_popup_cb, dt);
+ elm_object_part_content_set(parent, "elm.swallow.content", button);
+ evas_object_show(parent);
+
+ return button;
+}
+
+static Evas_Object *create_start_end_time_layout(Evas_Object* parent)
+{
+ Evas_Object *layout = elm_layout_add(parent);
+
+ char *res_path = app_get_resource_path();
+ if(res_path)
+ {
+ char edj_path[PATH_MAX] = { 0, };
+ snprintf(edj_path, PATH_MAX, "%s%s", res_path, "edje/time_button_layout.edj");
+ elm_layout_file_set(layout, edj_path, "button_layout");
+ free(res_path);
+ }
+
+ evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_show(layout);
+ return layout;
+}
+
+Evas_Object *start_end_time_item(Evas_Object* parent)
+{
+ Evas_Object *layout = create_start_end_time_layout(parent);
+
+ char buff[TIME_STRING_SIZE] = {0};
+ time_t local_time = time(0);
+ struct tm *time_info = localtime(&local_time);
+
+ datetime_s *dt = calloc(1, sizeof(datetime_s));
+ dt->saved_time = *time_info;
+
+ if(get_time_format() == time_format_12H) {
+ strftime(buff, TIME_STRING_SIZE, TIME_12_FORMAT, &dt->saved_time);
+ dt->button = create_time_button(layout, buff, TIME_12_FORMAT, dt);
+ } else if(get_time_format() == time_format_24H) {
+ strftime(buff, TIME_STRING_SIZE, TIME_24_FORMAT, &dt->saved_time);
+ dt->button = create_time_button(layout, buff, TIME_24_FORMAT, dt);
+ }
+
+ return layout;
+}
+
+void gl_set_schedule_selected(ug_data *data)
+{
+ NOTISET_TRACE_BEGIN;
+ ug_data *ugd = data;
+ ret_if(!ugd);
+
+ /* back Button */
+ Evas_Object *back_btn = elm_button_add(ugd->naviframe);
+ elm_object_style_set(back_btn, "naviframe/back_btn/default");
+ evas_object_smart_callback_add(back_btn, "clicked", back_button_cb, ugd->naviframe);
+
+ /* Push to naviframe */
+ ugd->list_sub = _create_set_schedule_disturb_gl(ugd);
+ append_gl_start_option(ugd->list_sub, "type1", "set-schedule");
+ append_gl_full_item(ugd->list_sub, repeat_weekly_layout_cb, NULL);
+ append_gl_start_option(ugd->list_sub, "type1", "start-time");
+ append_gl_start_option(ugd->list_sub, "type1", "end-time");
+ ugd->navi_item = elm_naviframe_item_push(ugd->naviframe, APP_STRING("IDS_ST_MBODY_SET_SCHEDULE_M_TIME"), back_btn, NULL, ugd->list_sub, NULL);
+}
+