Page 2 of 4
Re: Freeciv-tao-client
Posted: Mon Sep 05, 2016 4:50 pm
by Lachu
I have one question. Where was image displayed on start screen of gtk3 client? Which file should I include and which macrodefinition/string use?
Re: Freeciv-tao-client
Posted: Mon Sep 05, 2016 10:24 pm
by louis94
Lachu wrote:I have one question. Where was image displayed on start screen of gtk3 client? Which file should I include and which macrodefinition/string use?
I assume you're speaking about something like this:
Which image to use is actually defined by the tileset, you can get the file name from tileset_main_intro_filename (tilespec.h:395). The tileset needs to be initialized for this to work. The client startup procedure is as follows:
- (UI side) main() is called
- (UI) main() calls client_main (client_main.h:51)
- (common side) client_main() calls gui_init
- (co) client_main() loads some things
- (co) client_main() calls ui_main
- (co) client_main() finishes loading
- (UI) ui_main creates the GUI. The application exits when it returns
The tileset is only available in ui_main.
After initialization is done, it's up to the UI to call the common code when needed, including map rendering functions (the only exception to this is the metaserver, which lives in its own thread). The common code will call add_idle_callback (gui_main_g.h:41) when a function needs to be called "at some moment in the future". The real_timer_callback (client_main.h:111) needs to be called by the UI code at specified time intervals.
Louis
Re: Freeciv-tao-client
Posted: Tue Sep 06, 2016 4:00 pm
by Lachu
Yes, I spoke about image you attached. I copy files *.c and *.h from client/gui-stub into clien/gui-tao, change Makefile.am, ran ./autogen.sh --gui-client=tao and try to compile, but compiler complains about missing symbols.
Re: Freeciv-tao-client
Posted: Wed Sep 07, 2016 8:36 am
by cazfi
Submit you current work to a patch ticket (
https://gna.org/patch/?func=additem&group=freeciv ), patch as attachment, and I can have a look of what it needs.
Re: Freeciv-tao-client
Posted: Wed Sep 07, 2016 3:16 pm
by Lachu
It now compile. I copy source from stub, but didn't add some sources into list of sources to compile for tao client in client/Makefile.am. I have in mind gui_interface.c and gui_cb_setter.c
Re: Freeciv-tao-client
Posted: Wed Sep 07, 2016 6:26 pm
by Lachu
I cannot find a callback for start window/screen. Where it should be created?
Re: Freeciv-tao-client
Posted: Wed Sep 07, 2016 7:29 pm
by louis94
Lachu wrote:I cannot find a callback for start window/screen. Where it should be created?
Everything can be created in ui_main(). real_set_client_page() is called on page switching (see pages_g.h, notably enum client_pages at line 19).
Louis
Re: Freeciv-tao-client
Posted: Thu Sep 08, 2016 1:43 pm
by Lachu
So I would create windows in real_set_client_page. I have another questions. Why in options.h are options separately for each client? How to select one kind of options, like theme string?
Re: Freeciv-tao-client
Posted: Thu Sep 08, 2016 2:21 pm
by louis94
Lachu wrote:Why in options.h are options separately for each client?
Because not all clients support the same options.
Lachu wrote:How to select one kind of options, like theme string?
Code: Select all
char *value;
options_iterate(client_optset, poption) {
if (option_type(poption) == OT_STRING
&& strcmp(option_name(poption), "gui_tao_an_option")) {
value = option_str_get(poption);
/* Do something */
}
} options_iterate_end;
Re: Freeciv-tao-client
Posted: Thu Sep 08, 2016 3:22 pm
by Lachu
I updated data/gui-tao/Freeciv/gui-gtk-3.0/Makefile.am and ran ./autogen --enable-client=tao, but Makefile/Makefile.in wasn't update. I decided to remove dirty files and ran ./autogen --enable-client=tao, but missing files wasn't recreated.