BlackBerry. Common functions

Source: Internet
Author: User
Tags relative reserved

first, the initialization of the article:

1.1, int screen_create_context (screen_context_t *pctx, int flags);

#include <screen/screen.h>

Function: Create a new background

Pctx:context pointer;

Flags: Create types, including Screen_application_context, Screen_window_manager_context, Screen_input_provider_context, SCREEN_ Power_manager_context;

Return value: 0 (Window creation succeeded), 1 (window creation failed);

1.2, int bps_initialize (void)

#include <sys/platform.h>

#include "Bps/event.h"

Function: Initialize bps;

1.3, BBUTIL_INIT_EGL ()

#include < bbutil.h>function: initializing EGL

Return value: The return value exists and Exit_seccuss indicates failure.

1.4, Screen_destroy_context (SCREEN_CXT);

#include < bbutil.h>

Function: Close the background;

Return value: Temporarily do not know that there is no existence;

 

1.5, int navigator_request_events (int flags)

#include <stdbool.h>

#include <sys/platform.h>

#include "Bps/event.h"

Function: Declares that the application needs to get the "Navigator" event.

Flags: 0 (everything is handled), non-zero

Return value: Bps_success indicates success; bps_failure indicates failure.

 

1.6, int bps_get_event (bps_event_t **event, int timeout_ms)

#include <sys/platform.h>

#include "Bps/event.h"

Function: Get Event

Event:even used to store events

Timeout_ms: Gets the way the event can be zero, negative, positive. A negative number indicates that the Bps_get_event method waits until an event is acquired. If the second parameter is zero, the bps_get_event does not wait, an event is obtained, and no event continues to execute the code that follows. If the second parameter is a positive integer, the time to wait for the specified period is returned when the event is fetched, and the event is not fetched until the specified time has ended.

return value: Bps_success (Success), Bps_failure (Error), Bps_success (success but event is empty);

1.7, intlocale_request_events (int flags)

#include <sys/platform.h>

#include "Bps/event.h"

Function:starts to deliver locale status change events to your applicationusing BPS

Flag:thetypes of events to deliver. A value of zero indicates that all events arerequested. The meaning of Non-zero values are reserved for future use.

1.8, int bps_event_get_domain (bps_event_t *event)

#include <sys/platform.h>

#include <stdint.h>

Function: Domain for Event

Return value: Domain for Event

1.9, int navigator_rotation_lock (bool locked)

#include <stdbool.h>

#include <sys/platform.h>

#include "Bps/event.h"

Function: Lock the screen;

1.10, int screen_request_events (screen_context_t context)

#include <screen/screen.h>

#include <sys/platform.h>

#include "Bps/event.h"

Context:the Libscreen context to use for event retrieval.

Function: Affirms the use of screen events.

 

Second, create the Use dialog box:

2. 1, int dialog_request_events (int flags)

#include <sys/platform.h>
#include <stdbool.h>
#include "Bps/event.h"
Function:starts to deliver dialog events to your application using BPS

Flags:the types of events to deliver

2.2, int dialog_create_alert (dialog_instance_t *dialog)

#include <sys/platform.h>

#include <stdbool.h>

#include "Bps/event.h"

Function: Creates a dialog box.

Dialog: Pointer to the dialog box;

Return:bps_success (Success), bps_fafilure (failure);

2.3, int dialog_set_alert_message_text (dialog_instance_t dialog, Constchar *text)

#include <sys/platform.h>

#include <stdbool.h>

#include "Bps/event.h"

Function: Set dialog box .....

Dialog:the dialog to update.

Text:the message text to display

Return:bps_success upon SUCCESS, bps_failure with errno set otherwise

2.4, int dialog_set_size (dialog_instance_t dialog, dialog_size_t size)

#include <sys/platform.h>

#include <stdbool.h>

#include "Bps/event.h"

Function:set the size of a dialog.

Dialog: Dialog box name

Size: sizes. typedef enum {

Dialog_size_small = 0

Dialog_size_medium = 1

Dialog_size_large = 2

Dialog_size_tall = 3

Dialog_size_full = 4

} dialog_size_t;

Return:bps_success upon SUCCESS, bps_failure with errno set otherwise.

2.5, int dialog_set_cancel_required (dialog_instance_t Dialog, boolcancel_required)

#include <sys/platform.h>

#include <stdbool.h>

#include "Bps/event.h"

Function: Specifies whether the application needs to explicitly cancel the dialog box.

Dialog:the dialog to update.

Cancel_required:if True the application must cancel Thedialog explicitly, If false the application doesn ' t need to cancel The dialogexplicitly.

Return:bps_success upon SUCCESS, bps_failure with errno set otherwise.

2.6, int dialog_show (dialog_instance_t dialog)

#include <sys/platform.h>

#include <stdbool.h>

#include "Bps/event.h"

Function: Displays the dialog box.

Dialog: A dialog pointer that appears.

Return:bps_success upon SUCCESS, bps_failure with errno set otherwise

2.7, int Dialog_set_alert_message_text (dialog_instance_t dialog, const char *text)
#include <sys/platform.h>
#include <stdbool.h>
#include "Bps/event.h"
Function:set the message text of an alert dialog;
Dialog: Pointer to the dialog box.
Text:the message text to display.
Return:bps_success upon SUCCESS, bps_failure with errno set otherwise.

2.8, int dialog_update (dialog_instance_t dialog);

#include <sys/platform.h>

#include <stdbool.h>

#include "Bps/event.h"

Function:update a dialog, refreshes, manifests the characters.

Dialog:the dialog to update.

Return:bps_success upon SUCCESS, bps_failure with errno set otherwise.

2.9, int Dialog_destroy (dialog_instance_t dialog)

#include <sys/platform.h>

#include <stdbool.h>

#include "Bps/event.h"

Function:destroy a dialog.

Dialog: Pointer to the dialog box.

Return:bps_success upon SUCCESS, Bps_failurewith errno set otherwise.

Third, the window creation uses the article (): establishes a context first and then builds the window above this;

type of window: Screen_application_window: The coordinates at the time of creation are relative to the full screen;

Screen_child_window (child window): coordinates created when the parent window is used, the dialog box (dialog) is generally stored and needs to be added to the window group.

Screen_embedded_window:used to embed a WINDOW control within an object. Like the ChildWindow, the X and Y coordinates of the embedded window is all relative to thetop left corner of the Applica tion window. You must add a embedded window toan application ' s window group, otherwise the embedded window is invisible (I can't express it correctly in Chinese) .

3.1, int screen_create_context (screen_context_t *pctx, int flags);

#include <screen/screen.h>

Function: Create a new background

PCTX: Window pointer;

Flags: Create types, including Screen_application_context, Screen_window_manager_context, Screen_input_provider_context, SCREEN_ Power_manager_context;

Return value: 0 (Window creation succeeded), 1 (window creation failed);

3.2, int screen_create_window (screen_window_t * pwin, screen_context_t ctx);

#include <screen/screen.h>

Funtction: Creates a window in a context.

Pwin: Window pointer

CTX:CXT to the context of the Urban construction window.

return:0 (Success), 1 (failed).

3.3, pid_t getpid (void);

#include <process.h>

Function:get the process ID;

3.4, int screen_create_window_group (screen_win1dow_t win, const char *name)

#include <screen/screen.h>

Function:create A window group that other windows can join.

Win: A window that needs to be placed in the Windows group

Name: can be obtained by 3.3来;

(Set window properties):

3.5. #include <screen/screen.h>

int SCREEN_SET_WINDOW_PROPERTY_CV (screen_window_t win, int pname, int len, const char * param);

int Screen_set_window_property_iv (screen_window_t win, int pname, const int * param);

int Screen_set_window_property_llv (screen_window_t win, int pname, const long long * param);

int SCREEN_SET_WINDOW_PROPERTY_PV (screen_window_t win, int pname, void * * param);

Function: Sets the properties of the window.

3.6, int paymentservice_purchase_request

four, virtual keyboard and event access to use the article ():

4.1, int virtualkeyboard_request_events (int flags)

#include <stdbool.h>
#include <sys/platform.h>
#include "Bps/event.h"
#include <bps/virtualkeyboard.h>

Flags:thetypes of events to deliver. A value of zero indicates that all events arerequested. The meaning of Non-zero values are reserved for future use.

Function: Declare start VirtualKeyboard event.

Return:bps_success upon SUCCESS, bps_failure with errno set otherwise.

4.2. void Virtualkeyboard_show ()

#include <stdbool.h>
#include <bps/virtualkeyboard.h>
#include <sys/platform.h>
#include "Bps/event.h"

Function: Opens the virtual keyboard.

4.3. void Virtualkeyboard_hide ()

#include <stdbool.h>
#include <sys/platform.h>
#include "Bps/event.h"
Function: Hides the virtual keyboard.
4.4, int bps_get_event (bps_event_t **event, int timeout_ms)
#include <sys/platform.h>
#include "Bps/event.h"
Function: Receives the event.
Event: Events pointer.
Timeout_ms: The time to wait (can be-1, which means that the next event occurs).
Return:bps_success (Success, time timeout also returns this, but the event is a null pointer), Bps_failure (failed)
4.5, int bps_event_get_domain (bps_event_t *event)
#include <sys/platform.h>
#include <stdint.h>
Function:gets the domain of a BPS event. (can be said to get the bps stream).
Event:the event to get the domain of.
Return:the domain of the event.
4.6, int screen_get_domain ()
#include <screen/screen.h>
#include <sys/platform.h>
#include "Bps/event.h"
Function:gets the unique domain ID for the screen. (can be said to get the screen stream). (The program can use 4.5 and 4.6来 to determine whether it is a screen event)
Return:the domain ID for the screen.
4.7, int navigator_get_domain ()
#include <stdbool.h>
#include <sys/platform.h>
#include "Bps/event.h"
Function:gets the unique domain ID for the Navigator service.
Return:the domain ID for the Navigator service. (The program can use 4, 7 and 4.7来 to determine whether it is a navigator service event)
4.8, unsigned int bps_event_get_code (bps_event_t *event)
#include <sys/platform.h>
#include <stdint.h>
Event:the event to get the code of.
Function: Identifies the specific event.
Return:the Code of the event.
4.9, screen_event_t screen_event_get_event (bps_event_t *event)
#include <screen/screen.h>
#include <sys/platform.h>
#include "Bps/event.h"
Function:extracts the Libscreen screen_event_t is stored within a BPS event. (Identifies what screen events are stored in the event and is only available for screen events);
Return:the Libscreen screen_event_t.
4.10. #include <winmgr/iow.h>
int SCREEN_SET_EVENT_PROPERTY_CV (screen_event_t ev, int pname, int len, const char * param);
int Screen_set_event_property_iv (screen_event_t ev, int pname,const int * param);
int screen_set_event_property_llv (screen_event_t ev, int pname, const long long * param);
int SCREEN_SET_EVENT_PROPERTY_PV (screen_event_t ev, int pname, void * * param);
Parameters:
EV: Events (event acquired in 4.9);
Pname:the name of the property whose value must change. There are several:
Event Type:screen_event_closescreen_property_window
Event Type:screen_event_createscreen_property_window
Screen_property_group
Event Type:screen_event_displayscreen_property_display
Screen_property_attached
Screen_property_mirror_mode
Screen_property_mode
Screen_property_protection_enable
Event Type:screen_event_effect_completescreen_property_effect
Event type:screen_event_idlescreen_property_idle_state
Event Type:screen_event_inputscreen_property_device_index
Screen_property_input_value
Event Type:screen_event_jogscreen_property_device_index
Screen_property_jog_count
Event Type:screen_event_keyboardscreen_property_device_index
Screen_property_key_cap
Screen_property_key_flags
Screen_property_key_modifiers
Screen_property_key_scan
Screen_property_key_sym
Event Type:screen_event_mtouch_releasescreen_property_timestamp
Screen_property_position
screen_property_sequence_id
Screen_property_size
Screen_property_source_position
Screen_property_source_size

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.