After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 671101 - Improvements to ghex
Improvements to ghex
Status: RESOLVED FIXED
Product: ghex
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GHex maintainers
GHex maintainers
Depends on:
Blocks:
 
 
Reported: 2012-03-01 05:21 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2012-03-01 23:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use resources framework (3.07 KB, patch)
2012-03-01 05:21 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
Add a .gitignore file (1.23 KB, patch)
2012-03-01 05:21 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
Provide a better experience for the "Goto Byte..." dialog (1.63 KB, patch)
2012-03-01 05:21 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
Use the generic marshaller (5.35 KB, patch)
2012-03-01 05:21 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
converter: Squash some compiler warnings (1.15 KB, patch)
2012-03-01 05:21 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
Use resources framework (3.39 KB, patch)
2012-03-01 22:46 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
Use resources framework (3.94 KB, patch)
2012-03-01 23:20 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2012-03-01 05:21:37 UTC
Bunch of various patches that I had when I had the goal of making ghex
more fancy... Never got to finish that off...
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-03-01 05:21:39 UTC
Created attachment 208741 [details] [review]
Use resources framework
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-03-01 05:21:41 UTC
Created attachment 208742 [details] [review]
Add a .gitignore file
Comment 3 Jasper St. Pierre (not reading bugmail) 2012-03-01 05:21:44 UTC
Created attachment 208743 [details] [review]
Provide a better experience for the "Goto Byte..." dialog

Set the entry to be focused by default, and make it so that activating
the entry activates the default button.
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-03-01 05:21:46 UTC
Created attachment 208744 [details] [review]
Use the generic marshaller

The specific marshallers, along with glib-genmarshal, are deprecated.
Comment 5 Jasper St. Pierre (not reading bugmail) 2012-03-01 05:21:48 UTC
Created attachment 208745 [details] [review]
converter: Squash some compiler warnings

These functions expect signed chars, not unsigned chars.
Comment 6 Kalev Lember 2012-03-01 19:50:08 UTC
Hi Jasper,

Thanks for the patches!

Every bit of help is much appreciated. I've been hacking on ghex a bit over the past few months and doing releases. It's been unmaintained for way too long and could use a lot of love ...
Comment 7 Kalev Lember 2012-03-01 19:57:16 UTC
Review of attachment 208741 [details] [review]:

::: src/Makefile.am
@@ +15,3 @@
+
+ghex-resources.h: ghex.gresource.xml
+	glib-compile-resources --target=$@ --generate-header --c-name ghex ghex.gresource.xml

This breaks with srcdir != builddir builds. I think it needs at least --sourcedir=$(srcdir) passed to glib-compile-resources, possibly more.

@@ -63,1 @@
 	ghex-marshal.list

The new ghex.gresource.xml file should be disted, so that ghex-resources.c and ghex-resources.h can be built from tarballs.

::: src/ghex.gresource.xml
@@ +2,3 @@
+<gresources>
+  <gresource prefix="/org/gnome/ghex">
+    <file>ghex-ui.xml</file>

There's an option to strip whitespace from xml files (preprocess="xml-stripblanks"), is it something we should be using here?
Comment 8 Kalev Lember 2012-03-01 19:59:14 UTC
Review of attachment 208742 [details] [review]:

I've been meaning to add git.mk to ghex, but haven't gotten around to it yet. In the mean time, having a manually generated .gitignore is a good idea, I think.
Comment 9 Kalev Lember 2012-03-01 19:59:35 UTC
Review of attachment 208743 [details] [review]:

Looks good.
Comment 10 Kalev Lember 2012-03-01 20:01:05 UTC
Review of attachment 208744 [details] [review]:

Looks good, just a minor nit.

::: src/hex-document.c
@@ +359,3 @@
 					  NULL,
 					  NULL,
+		              NULL,

Something wrong with whitespace here.
Comment 11 Kalev Lember 2012-03-01 20:01:24 UTC
Review of attachment 208745 [details] [review]:

Looks good.
Comment 12 Jasper St. Pierre (not reading bugmail) 2012-03-01 22:46:20 UTC
Created attachment 208828 [details] [review]
Use resources framework

This better?
Comment 13 Kalev Lember 2012-03-01 23:15:37 UTC
Review of attachment 208828 [details] [review]:

Almost there!

Did you try to build in a srcdir != builddir configuration? I just gave it a try and it's looking for ghex.gresource.xml in the build dir:

  glib-compile-resources --target=ghex-resources.c --generate-source --c-name ghex --sourcedir=../../src ghex.gresource.xml
  Failed to open file 'ghex.gresource.xml': No such file or directory

With srcdir != builddir I mean a separate build directory, something like this:
$ git clean -dfx
$ mkdir build
$ cd build
$ ../autogen.sh
$ make -j4


Also, with this patch there's a new warning about ghex_datadir:

../../src/ghex-window.c: At top level:
../../src/ghex-window.c:516:1: warning: ‘ghex_datadir’ defined but not used [-Wunused-function]

ghex_datadir() was only used to figure out the directory to load the UI file from, so I guess this patch should also remove the now unneeded ghex_datadir definition.

::: src/Makefile.am
@@ +12,3 @@
 
+ghex-resources.c: ghex.gresource.xml ghex-ui.xml
+	glib-compile-resources --target=$@ --generate-source --c-name ghex --sourcedir=$(srcdir) ghex.gresource.xml

If you use $< instead of ghex.gresource.xml, make will prefix the file name with path to the file, which is exactly what we need to pass to glib-compile-resources.

@@ +15,3 @@
+
+ghex-resources.h: ghex.gresource.xml
+	glib-compile-resources --target=$@ --generate-header --c-name ghex --sourcedir=$(srcdir) ghex.gresource.xml

Same as above.
Comment 14 Jasper St. Pierre (not reading bugmail) 2012-03-01 23:20:33 UTC
Created attachment 208831 [details] [review]
Use resources framework

Aha, thanks for that. Just tested again, and this should work.
Comment 15 Kalev Lember 2012-03-01 23:39:22 UTC
Review of attachment 208831 [details] [review]:

Yep, out of source builds are working nicely now, thanks!

One more thing I noticed -- the patch removes ghex-ui.xml from EXTRA_DIST, but it should stay there. The file is needed for generating ghex-resources.*, and if we don't dist it, tarball builds won't work.

Good work, just fix ghex-ui.xml disting and push to master, please.
Comment 16 Jasper St. Pierre (not reading bugmail) 2012-03-01 23:51:57 UTC
Attachment 208742 [details] pushed as cfa790f - Add a .gitignore file
Attachment 208743 [details] pushed as 40ce7d7 - Provide a better experience for the "Goto Byte..." dialog
Attachment 208744 [details] pushed as 02d36f5 - Use the generic marshaller
Attachment 208745 [details] pushed as 27411c8 - converter: Squash some compiler warnings
Attachment 208831 [details] pushed as 3999be8 - Use resources framework



And done, thanks!