If you want to hack xdockserver, the graphic below is the tree of procedures
that are called.

   main
    |
    |-- opt_parse                              Parse arguments, read config
    |    |                                     file and theme file.
    |    |-- parse_themes                      
    |    '-- parse_config_file
    |
    |-- x11_initialize                         Initialize X11.
    |    |
    |    |-- x11_panel_height                  Check for height of the top panel.
    |    | 
    |    '-- font_led_init                     Initialize fonts.
    |         |
    |         '-- font_init
    |
    |-- net_startup                            Initialize network.
    |
 ,->|..........................................The main loop starts here.
 .  |
 .  |
 .  |-- net_check_for_clients                  Check for new clients.
 .  |    |
 .  |    '-- client_add                        If a new client has connected,
 .  |         |                                initialize the client in the
 .  |         '-- x11_setup_client             memory and create a window for
 .  |              |                           it.
 .  |              |-- x11_initialize_colors
 .  |              '-- x11_initialize_fonts
 .  |
 .  |
 .  |-- net_receive_data                       Receive data from each client.
 .  |    |
 .  |    |-- net_receive_client_data
 .  |    |    |
 .  |    |    '-- client_destroy               If the client has disconnected,
 .  |    |         |                           close the connection and 
 .  |    |         |-- net_disconnect_client   destroy the window.
 .  |    |         '-- x11_destroy_client
 .  |    |
 .  |    '-- parse_data                        If data has been received,
 .  |         |                                parse the data and call the 
 .  |         '-- parse_command                appropriate functions.
 .  |              |
 .  |              |-- x11_panel               These functions are in x11_cmd.c.
 .  |              |-- x11_pixel
 .  |              |-- x11_line
 .  |              |-- x11_rectangle
 .  |              |-- x11_box
 .  |              |-- x11_update
 .  |              |-- x11_movebox
 .  |              |-- x11_add_image
 .  |              |-- x11_draw_image
 .  |              '-- x11_print
 .  |
 .  |
 .  |-- x11_do_events                          Receive input from X11 and send
 .  |    |                                     the appropriate information to
 .  |    '-- x11_do_events_client              the clients.
 .  |         |
 .  |         |-- x11_pointer_event
 .  |         |    |
 .  |         |    '-- net_send_client_data
 .  |         |
 .  |         '-- x11_move_window              If a window has moved, calculate
 .  |                                          its correct position.
 .  |
 .  |
 '-<|..........................................The main loop ends here.
    |
    |
    |-- net_quit                               Do some cleanup before exiting.
    |
    |-- x11_quit
    |
    '-- (exit)
