main-gtk2.c

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GSN
    Rookie
    • Apr 2007
    • 21

    main-gtk2.c

    I can't manage to compile Angband (actually ToME) with the gtk-2 interface enabled. Here's the compiler output:

    main-gtk2.c:174: error: expected specifier-qualifier-list before ‘PangoContext’
    main-gtk2.c: In function ‘resize_tiles_fast’:
    main-gtk2.c:1468: warning: value computed is not used
    main-gtk2.c: In function ‘load_xpm’:
    main-gtk2.c:1833: warning: value computed is not used
    main-gtk2.c:1836: warning: value computed is not used
    main-gtk2.c:1850: warning: value computed is not used
    main-gtk2.c:1853: warning: value computed is not used
    main-gtk2.c: In function ‘Term_nuke_gtk’:
    main-gtk2.c:2484: error: ‘pango_info’ has no member named ‘analysis’
    main-gtk2.c:2485: error: ‘pango_info’ has no member named ‘analysis’
    main-gtk2.c: In function ‘Term_text_gtk’:
    main-gtk2.c:2633: error: ‘PangoGlyphString’ undeclared (first use in this function)
    main-gtk2.c:2633: error: (Each undeclared identifier is reported only once
    main-gtk2.c:2633: error: for each function it appears in.)
    main-gtk2.c:2633: error: ‘glyph_string’ undeclared (first use in this function)
    main-gtk2.c:2633: warning: implicit declaration of function ‘pango_glyph_string_new’
    main-gtk2.c:2636: warning: implicit declaration of function ‘pango_shape’
    main-gtk2.c:2636: error: ‘pango_info’ has no member named ‘analysis’
    main-gtk2.c:2639: warning: implicit declaration of function ‘gdk_draw_glyphs’
    main-gtk2.c:2642: error: ‘pango_info’ has no member named ‘font’
    main-gtk2.c:2644: error: ‘pango_info’ has no member named ‘ascent’
    main-gtk2.c:2648: warning: implicit declaration of function ‘pango_glyph_string_free’
    main-gtk2.c: In function ‘init_font_metrics’:
    main-gtk2.c:3540: error: ‘pango_info’ has no member named ‘metrics’
    main-gtk2.c:3540: warning: implicit declaration of function ‘pango_font_get_metrics’
    main-gtk2.c:3541: error: ‘pango_info’ has no member named ‘font’
    main-gtk2.c:3541: error: ‘pango_info’ has no member named ‘language’
    main-gtk2.c:3553: warning: implicit declaration of function ‘pango_font_metrics_get_ascent’
    main-gtk2.c:3553: error: ‘pango_info’ has no member named ‘metrics’
    main-gtk2.c:3554: warning: implicit declaration of function ‘pango_font_metrics_get_descent’
    main-gtk2.c:3554: error: ‘pango_info’ has no member named ‘metrics’
    main-gtk2.c:3555: warning: implicit declaration of function ‘pango_font_metrics_get_approximate_digit_widthâ €™
    main-gtk2.c:3555: error: ‘pango_info’ has no member named ‘metrics’
    main-gtk2.c:3557: error: ‘pango_info’ has no member named ‘ascent’
    main-gtk2.c:3557: warning: implicit declaration of function ‘PANGO_PIXELS’
    main-gtk2.c:3558: error: ‘pango_info’ has no member named ‘descent’
    main-gtk2.c:3559: error: ‘pango_info’ has no member named ‘ascent’
    main-gtk2.c:3559: error: ‘pango_info’ has no member named ‘descent’
    main-gtk2.c: In function ‘load_font’:
    main-gtk2.c:3587: error: ‘pango_info’ has no member named ‘font_desc’
    main-gtk2.c:3587: warning: implicit declaration of function ‘pango_font_description_from_string’
    main-gtk2.c:3590: warning: implicit declaration of function ‘gtk_widget_modify_font’
    main-gtk2.c:3590: error: ‘pango_info’ has no member named ‘font_desc’
    main-gtk2.c:3593: error: ‘pango_info’ has no member named ‘context’
    main-gtk2.c:3593: warning: implicit declaration of function ‘gtk_widget_get_pango_context’
    main-gtk2.c:3596: error: ‘pango_info’ has no member named ‘language’
    main-gtk2.c:3596: warning: implicit declaration of function ‘pango_context_get_language’
    main-gtk2.c:3596: error: ‘pango_info’ has no member named ‘context’
    main-gtk2.c:3599: error: ‘pango_info’ has no member named ‘font’
    main-gtk2.c:3599: warning: implicit declaration of function ‘pango_context_load_font’
    main-gtk2.c:3600: error: ‘pango_info’ has no member named ‘context’
    main-gtk2.c:3601: error: ‘pango_info’ has no member named ‘font_desc’
    main-gtk2.c:3606: error: ‘PangoAnalysis’ undeclared (first use in this function)
    main-gtk2.c:3606: error: ‘analysis’ undeclared (first use in this function)
    main-gtk2.c:3606: error: expected expression before ‘)’ token
    main-gtk2.c:3609: error: ‘PangoAttrList’ undeclared (first use in this function)
    main-gtk2.c:3609: error: ‘attrs’ undeclared (first use in this function)
    main-gtk2.c:3609: warning: implicit declaration of function ‘pango_attr_list_new’
    main-gtk2.c:3610: error: ‘PangoAttrIterator’ undeclared (first use in this function)
    main-gtk2.c:3610: error: ‘aiter’ undeclared (first use in this function)
    main-gtk2.c:3610: warning: implicit declaration of function ‘pango_attr_list_get_iterator’
    main-gtk2.c:3613: warning: implicit declaration of function ‘pango_itemize’
    main-gtk2.c:3613: error: ‘pango_info’ has no member named ‘context’
    main-gtk2.c:3613: warning: initialization makes pointer from integer without a cast
    main-gtk2.c:3616: error: ‘PangoItem’ undeclared (first use in this function)
    main-gtk2.c:3616: error: ‘item’ undeclared (first use in this function)
    main-gtk2.c:3616: error: expected expression before ‘)’ token
    main-gtk2.c:3621: error: ‘pango_info’ has no member named ‘font’
    main-gtk2.c:3627: error: ‘pango_info’ has no member named ‘analysis’
    main-gtk2.c:3630: warning: implicit declaration of function ‘pango_item_free’
    main-gtk2.c: In function ‘change_font_event_handler’:
    main-gtk2.c:3651: error: ‘GTK_RESPONSE_OK’ undeclared (first use in this function)
    main-gtk2.c:3651: warning: implicit declaration of function ‘gtk_dialog_run’
    main-gtk2.c: In function ‘setup_menu_paths’:
    main-gtk2.c:4692: error: invalid lvalue in assignment
    main-gtk2.c:4698: error: invalid lvalue in assignment
    make: *** [main-gtk2.o] Błąd 1

    Yes, I have posted that to the ToME forum too.
  • pav
    Administrator
    • Apr 2007
    • 793

    #2
    What version of T.o.M.E.? What version of pango?
    See the elves and everything! http://angband.oook.cz

    Comment

    • GSN
      Rookie
      • Apr 2007
      • 21

      #3
      ToME 2.3.4, actually the Unicode patch I was so keen on seeing in action was for 2.3.1, but patched without any problems.

      I have installed all the gtk dev packages plus libpango1.0-dev, maybe it's not the right one? Linux's Ubuntu, by the way.

      Comment

      • pav
        Administrator
        • Apr 2007
        • 793

        #4
        What command you used to start compilation? I downloaded 2.3.4 sources, and main-gtk2.c is not referenced in any makefile...
        See the elves and everything! http://angband.oook.cz

        Comment

        • GSN
          Rookie
          • Apr 2007
          • 21

          #5
          Makefile.std. Actually I edited it to add that file instead of main-gtk.c. Should I include main-gtk.c too?

          Edited Makefile flags:

          COPTS = -Wall -O1 -pipe -g
          INCLUDES = `gtk-config --cflags`
          DEFINES = -DUSE_TRANSPARENCY -DUSE_EGO_GRAPHICS -DSUPPORT_GAMMA -DUSE_GCU -DUSE_GTK2
          LIBS = `gtk-config --libs` -lncurses

          gtk-config produces correct output.

          Comment

          • pav
            Administrator
            • Apr 2007
            • 793

            #6
            I doubt it. gtk-config should give you Gtk+ 1.X flags. You need pkg-config --cflags --libs gtk+-2.0
            See the elves and everything! http://angband.oook.cz

            Comment

            • GSN
              Rookie
              • Apr 2007
              • 21

              #7
              So in short I was trying to compile a GTK 2.x application using GTK 1.x libs. Just brilliant. Anyway, with your suggestion I managed to compile, even though

              main-gtk2.c:4692: error: invalid lvalue in assignment
              main-gtk2.c:4698: error: invalid lvalue in assignment

              kept on appearing (just deleted a cast to cptr)

              But when I ran ToME under X, a strange thing happened - the game used -mxaw instead of -mgtk2, even though I did not compile it in! It also totally ignored -mgtk2 on command line. I fired up gdb to check what's wrong, and lo and behold, -mgtk2 mysteriously worked.

              Obviously the patch is not finished - there is no way to use unicode values using the % command. And I wonder how does Windows implement it? FNT files are limited to 256 glyphs anyway.

              Comment

              • Neil Stevens
                Scout
                • May 2007
                • 26

                #8
                Originally posted by GSN
                I can't manage to compile Angband (actually ToME) with the gtk-2 interface enabled. Here's the compiler output:
                I'm pretty sure that interface isn't maintained. And applying some patch is probably going to give you no end of troubles. Have fun, heh.

                Comment

                Working...
                😀
                😂
                🥰
                😘
                🤢
                😎
                😞
                😡
                👍
                👎