OSDN Git Service

LinGui: changes to resource preprocessor
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 15 Jun 2010 16:21:22 +0000 (16:21 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 15 Jun 2010 16:21:22 +0000 (16:21 +0000)
During the build, I was compiling tools for preprocessing and packaging
the gui description xml, preset defaults, widget dependencies, and icons.
The resulting resource_data.h file gets compiled into the binary.  These
tools are now implemented in python.  This eliminates the need to compile
the tools which caused complications when cross compiling.

This work was actually done many months ago.  But all the distributions
I wanted to support didn't have the libplist python module.  Now they all
do.

git-svn-id: svn://localhost/HandBrake/trunk@3382 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/module.defs
gtk/module.rules
gtk/src/Makefile.am
gtk/src/icons.c
gtk/src/makedeps.py

index cd4992b..cc20a18 100644 (file)
@@ -25,51 +25,3 @@ ifeq (0,$(FEATURE.gtk.update.checks))
        GTK.CONFIGURE.extra += --disable-update-checks
 endif
 
-###############################################################################
-###############################################################################
-$(eval $(call import.MODULE.defs,HGTK,hgtk))
-$(eval $(call import.GCC,HGTK))
-
-HGTK.GCC.gcc = gcc
-HGTK.GCC.args.extra = $(shell pkg-config --cflags glib-2.0)
-HGTK.GCC.args.extra += $(shell pkg-config --cflags gdk-pixbuf-2.0)
-HGTK.GCC.args.extra += $(shell pkg-config --libs glib-2.0)
-HGTK.GCC.args.extra += $(shell pkg-config --libs gdk-pixbuf-2.0)
-
-HGTK.src/ = $(SRC/)gtk/src/
-HGTK.build/ = $(BUILD/)gtk/src/
-
-HGTKCOMMON.c = \
-       $(HGTK.src/)plist.c \
-       $(HGTK.src/)values.c
-
-HGTKCOMMON.c.o = $(patsubst $(SRC/)%.c,$(BUILD/)%-native.o,$(HGTKCOMMON.c))
-
-CREATE_RES.c = \
-       $(HGTK.src/)create_resources.c \
-       $(HGTK.src/)icon_tools.c
-
-CREATE_RES.c.o = $(patsubst $(SRC/)%.c,$(BUILD/)%-native.o,$(CREATE_RES.c))
-CREATE_RES.exe = $(HGTK.build/)create_resources
-
-WIDGETDEPS.c = \
-       $(HGTK.src/)widgetdeps.c
-
-WIDGETDEPS.c.o = $(patsubst $(SRC/)%.c,$(BUILD/)%-native.o,$(WIDGETDEPS.c))
-WIDGETDEPS.exe = $(HGTK.build/)widgetdeps
-
-QUOTESTRING.c = \
-       $(HGTK.src/)quotestring.c
-
-QUOTESTRING.c.o = $(patsubst $(SRC/)%.c,$(BUILD/)%-native.o,$(QUOTESTRING.c))
-QUOTESTRING.exe = $(HGTK.build/)quotestring
-
-HGTK.out += $(HGTKCOMMON.c.o)
-HGTK.out += $(CREATE_RES.exe)
-HGTK.out += $(CREATE_RES.c.o)
-HGTK.out += $(WIDGETDEPS.exe)
-HGTK.out += $(WIDGETDEPS.c.o)
-HGTK.out += $(QUOTESTRING.exe)
-HGTK.out += $(QUOTESTRING.c.o)
-
-BUILD.out += $(HGTK.out)
index 138fe64..a1c1eb7 100644 (file)
@@ -1,11 +1,11 @@
 $(eval $(call import.MODULE.rules,GTK))
 
-build: hgtk.build gtk.build
+build: gtk.build
 install: gtk.install
 install-strip: gtk.install-strip
 uninstall: gtk.uninstall
-clean: hgtk.clean gtk.clean
-xclean: hgtk.clean gtk.xclean
+clean: gtk.clean
+xclean: gtk.xclean
 
 gtk.configure: $(GTK.CONFIGURE.stamp)
 
@@ -43,39 +43,3 @@ gtk.xclean:
        $(RM.exe) -f $(GTK.out)
        $(RM.exe) -fr $(GTK.build/)
 
-###############################################################################
-###############################################################################
-$(eval $(call import.MODULE.rules,HGTK))
-
-hgtk.build: $(CREATE_RES.exe) $(WIDGETDEPS.exe) $(QUOTESTRING.exe)
-
-$(CREATE_RES.exe): | $(dir $(CREATE_RES.exe))
-$(CREATE_RES.exe): $(CREATE_RES.c.o) $(HGTKCOMMON.c.o)
-       $(call HGTK.GCC.EXE,$@,$^)
-
-$(HGTKCOMMON.c.o): | $(dir $(HGTKCOMMON.c.o))
-$(HGTKCOMMON.c.o): $(BUILD/)%-native.o: $(SRC/)%.c
-       $(call HGTK.GCC.C_O,$@,$<)
-
-$(CREATE_RES.c.o): | $(dir $(CREATE_RES.c.o))
-$(CREATE_RES.c.o): $(BUILD/)%-native.o: $(SRC/)%.c
-       $(call HGTK.GCC.C_O,$@,$<)
-
-$(WIDGETDEPS.exe): | $(dir $(WIDGETDEPS.exe))
-$(WIDGETDEPS.exe): $(WIDGETDEPS.c.o) $(HGTKCOMMON.c.o)
-       $(call HGTK.GCC.EXE,$@,$^)
-
-$(WIDGETDEPS.c.o): | $(dir $(WIDGETDEPS.c.o))
-$(WIDGETDEPS.c.o): $(BUILD/)%-native.o: $(SRC/)%.c
-       $(call HGTK.GCC.C_O,$@,$<)
-
-$(QUOTESTRING.c.o): | $(dir $(QUOTESTRING.c.o))
-$(QUOTESTRING.c.o): $(BUILD/)%-native.o: $(SRC/)%.c
-       $(call HGTK.GCC.C_O,$@,$<)
-
-$(QUOTESTRING.exe): | $(dir $(QUOTESTRING.exe))
-$(QUOTESTRING.exe): $(QUOTESTRING.c.o)
-       $(call HGTK.GCC.EXE,$@,$^)
-
-hgtk.clean:
-       $(RM.exe) -f $(HGTK.out)
index 52be4d1..38412ea 100644 (file)
@@ -117,15 +117,15 @@ ghb_DEPENDENCIES = $(HB_DIR)/libhb/libhb.a
 
 resources.o: resource_data.h
 
-resource_data.h: quotestring resources.plist
-       ./quotestring resources.plist resource_data.h
+resource_data.h: resources.plist
+       python $(srcdir)/quotestring.py resources.plist resource_data.h
 
-widget_reverse.deps: widgetdeps
-widget.deps: widgetdeps
-       ./widgetdeps
+widget_reverse.deps: makedeps.py
+widget.deps: makedeps.py
+       python $(srcdir)/makedeps.py
 
-resources.plist: create_resources resources.list $(icons_dep) internal_defaults.xml standard_presets.xml ghb.ui widget.deps widget_reverse.deps
-       ./create_resources -I$(srcdir) $(srcdir)/resources.list resources.plist
+resources.plist: create_resources.py resources.list $(icons_dep) internal_defaults.xml standard_presets.xml ghb.ui widget.deps widget_reverse.deps
+       python $(srcdir)/create_resources.py -I$(srcdir) $(srcdir)/resources.list resources.plist
 
 ghbcellrenderertext.$(OBJEXT): marshalers.h
 
index 948213d..ed55454 100644 (file)
@@ -3,7 +3,7 @@
 #include "values.h"
 #include "resources.h"
 
-#if 0
+#if 1
 void
 ghb_load_icons()
 {
index 9b5359e..f677241 100644 (file)
@@ -7,28 +7,34 @@ DepEntry = collections.namedtuple('DepEntry', 'widget dep enable die hide')
 dep_map = (
        DepEntry("title", "queue_add", "none", True, False),
        DepEntry("title", "queue_add_menu", "none", True, False),
-       DepEntry("title", "show_picture", "none", True, False),
-       DepEntry("title", "show_preview_menu", "none", True, False),
        DepEntry("title", "preview_frame", "none", True, False),
        DepEntry("title", "picture_label", "none", True, False),
        DepEntry("title", "picture_tab", "none", True, False),
        DepEntry("title", "chapters_label", "none", True, False),
        DepEntry("title", "chapters_tab", "none", True, False),
-       DepEntry("title", "title", "none", True, False),
-       DepEntry("title", "start_chapter", "none", True, False),
-       DepEntry("title", "end_chapter", "none", True, False),
+       DepEntry("title", "start_point", "none", True, False),
+       DepEntry("title", "end_point", "none", True, False),
+       DepEntry("title", "angle", "none", True, False),
+       DepEntry("title", "angle_label", "1", True, False),
+       DepEntry("use_dvdnav", "angle", "FALSE", True, True),
+       DepEntry("use_dvdnav", "angle_label", "FALSE", True, True),
+       DepEntry("angle_count", "angle", "1", True, True),
+       DepEntry("angle_count", "angle_label", "1", True, True),
        DepEntry("vquality_type_bitrate", "VideoAvgBitrate", "TRUE", False, False),
        DepEntry("vquality_type_target", "VideoTargetSize", "TRUE", False, False),
        DepEntry("vquality_type_constant", "VideoQualitySlider", "TRUE", False, False),
-       DepEntry("vquality_type_constant", "constant_rate_factor", "TRUE", False, False),
        DepEntry("vquality_type_constant", "VideoTwoPass", "TRUE", True, False),
        DepEntry("vquality_type_constant", "VideoTurboTwoPass", "TRUE", True, False),
        DepEntry("VideoTwoPass", "VideoTurboTwoPass", "TRUE", False, False),
-       DepEntry("FileFormat", "Mp4LargeFile", "mp4|m4v", False, True),
-       DepEntry("FileFormat", "Mp4HttpOptimize", "mp4|m4v", False, True),
-       DepEntry("FileFormat", "Mp4iPodCompatible", "mp4|m4v", False, True),
-       DepEntry("PictureDecomb", "PictureDeinterlace", "none", False, False),
-       DepEntry("PictureDecomb", "PictureDeinterlaceCustom", "none", False, True),
+       DepEntry("FileFormat", "Mp4LargeFile", "mp4", False, True),
+       DepEntry("FileFormat", "Mp4HttpOptimize", "mp4", False, True),
+       DepEntry("FileFormat", "Mp4iPodCompatible", "mp4", False, True),
+       DepEntry("PictureDecombDeinterlace", "PictureDeinterlace", "TRUE", True, True),
+       DepEntry("PictureDecombDeinterlace", "PictureDeinterlaceCustom", "TRUE", True, True),
+       DepEntry("PictureDecombDeinterlace", "PictureDeinterlaceLabel", "TRUE", True, True),
+       DepEntry("PictureDecombDeinterlace", "PictureDecomb", "FALSE", True, True),
+       DepEntry("PictureDecombDeinterlace", "PictureDecombCustom", "FALSE", True, True),
+       DepEntry("PictureDecombDeinterlace", "PictureDecombLabel", "FALSE", True, True),
        DepEntry("PictureDeinterlace", "PictureDeinterlaceCustom", "custom", False, True),
        DepEntry("PictureDenoise", "PictureDenoiseCustom", "custom", False, True),
        DepEntry("PictureDecomb", "PictureDecombCustom", "custom", False, True),
@@ -37,25 +43,17 @@ dep_map = (
        DepEntry("PictureAutoCrop", "PictureBottomCrop", "FALSE", False, False),
        DepEntry("PictureAutoCrop", "PictureLeftCrop", "FALSE", False, False),
        DepEntry("PictureAutoCrop", "PictureRightCrop", "FALSE", False, False),
-       DepEntry("autoscale", "scale_width", "FALSE", False, False),
-       DepEntry("autoscale", "scale_height", "FALSE", False, False),
-       DepEntry("anamorphic", "PictureKeepRatio", "FALSE", False, False),
-       ## "CHECK" is a dummy value that forces scale_height deps to
-       ## be re-evaluated whenever anamorphic changes
-       DepEntry("anamorphic", "scale_height", "CHECK", True, False),
-       DepEntry("PictureKeepRatio", "scale_height", "FALSE", False, False),
        DepEntry("VideoEncoder", "x264_tab", "x264", False, False),
        DepEntry("VideoEncoder", "x264_tab_label", "x264", False, False),
        DepEntry("VideoEncoder", "Mp4iPodCompatible", "x264", False, False),
-       DepEntry("AudioEncoder", "AudioBitrate", "ac3|dts", True, False),
-       DepEntry("AudioEncoder", "AudioSamplerate", "ac3|dts", True, False),
-       DepEntry("AudioEncoder", "AudioMixdown", "ac3|dts", True, False),
-       DepEntry("AudioEncoder", "AudioTrackDRCSlider", "ac3|dts", True, False),
-       DepEntry("x264_bframes", "x264_weighted_bframes", "0", True, False),
+       DepEntry("AudioEncoderActual", "AudioBitrate", "ac3|dts", True, False),
+       DepEntry("AudioEncoderActual", "AudioSamplerate", "ac3|dts", True, False),
+       DepEntry("AudioEncoderActual", "AudioMixdown", "ac3|dts", True, False),
+       DepEntry("AudioEncoderActual", "AudioTrackDRCSlider", "ac3|dts", True, False),
+       DepEntry("AudioEncoderActual", "drc_label", "ac3|dts", True, False),
        DepEntry("x264_bframes", "x264_bpyramid", "<2", True, False),
        DepEntry("x264_bframes", "x264_direct", "0", True, False),
        DepEntry("x264_bframes", "x264_b_adapt", "0", True, False),
-       DepEntry("x264_refs", "x264_mixed_refs", "<2", True, False),
        DepEntry("x264_cabac", "x264_trellis", "TRUE", False, False),
        DepEntry("x264_subme", "x264_psy_rd", "<6", True, False),
        DepEntry("x264_subme", "x264_psy_trell", "<6", True, False),