Ftk application programming interface (API) manual-1

Source: Internet
Author: User
FRAMEWORK Functions


The framework function supports the ftk entity. It initializes the application, starts the main loop, and exits the main loop. It is indispensable for any ftk application, even if the application does not use any controls (of course this does not make sense), so we first introduce these functions.
1. initialize ftk

Prototype: Ret
Ftk_init (INT argc, char * argv []);
Note: It is used to initialize ftk, such as initialization related to the platform, loading configuration files, initializing display, Font, subject, and input method. If an application runs as a desktop plug-in, you do not need to call this function because the desktop has already called it.
Parameter: basically, the parameters of the main function can be passed directly here. Argc is the number of parameters, and argv is a specific parameter. Currently, the following parameters are supported:

-- Disable-statusbar: disables the status bar. If this parameter is used, the status bar is not created.

-- Enable-cursor: Enable the mouse pointer. In this example, ftk uses the image cursor.png in the topic as the mouse pointer.

-- Theme =
Specifies the topic name. The default value is default.

-- Data-Dir =
Specifies the directory of the data file.

-- Test-data-Dir = specifies the directory of the test data file, including the data required by demos.

-- Rotate =
Specify the degree of rotation of the screen, which can be 0, 90, or 180.

-- Log-level =
Specify the log level. Optional values include V, D, W, I, and E, which correspond to ftk_log_v, ftk_log_d, ftk_log_ I, ftk_log_w, and ftk_log_e.


Refer to the code of ftk_config_init, which is responsible for processing these parameters.

Returned value: ret_ OK is returned successfully.
2. Enter the Main Loop

Prototype: Ret
Ftk_run (void );
Note: Go to the ftk main loop, wait for the event to occur, and then process the events until ftk_quit is called. If an application runs as a desktop plug-in, you do not need to call this function because the desktop has already called it.
Parameter: None
Returned value: ret_ OK is returned successfully.
3. Exit the Main Loop

Prototype: void
Ftk_quit (void)
Note: exit the main loop of the ftk. If you want to exit the entire application, call this function. If the application runs as a desktop plug-in, calling this function will exit the desktop.
Parameter: none.
Return Value: none.

4. Clear the site after exiting
Prototype: void
Ftk_deinit (void );
Note: After the ftk exits from the main loop, the application will exit. In this case, you need to release all the resources occupied by the ftk. Generally, applications do not need to call this function because it is automatically called through atexit.
Parameter: none.
Return Value: none.
5. Examples used in this section:

Int
Main (INT argc, char * argv [])
{

Ftk_init (argc,
Argv );

Ftk_run ();

Return
0;

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.