HbbTv  17.9.0
Open source HBBTV engine
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
style.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2013 Ocean Blue Software Ltd
4  *
5  * This file is part of a DTVKit Software Component
6  * You are permitted to copy, modify or distribute this file subject to the terms
7  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
8  *
9  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
10  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * If you or your organisation is not a member of DTVKit then you have access
14  * to this source code outside of the terms of the licence agreement
15  * and you are expected to delete this and any associated files immediately.
16  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
17  *******************************************************************************/
26 // pre-processor mechanism so multiple inclusions don't cause compilation error
27 #ifndef _STYLE_H
28 #define _STYLE_H
29 
30 #include "plugin.h"
31 
32 //---Constant and macro definitions for public use-----------------------------
33 
34 
35 //---Enumerations for public use-----------------------------------------------
36 
37 typedef enum
38 {
39  INHERIT,
40  STATIC,
41  ABSOLUTE,
42  FIXED,
43  RELATIVE,
44 } E_POSITION;
45 
46 typedef struct s_offset
47 {
48  S16BIT left;
49  S16BIT top;
50 } S_OFFSET;
51 
52 typedef struct s_style_size
53 {
54  U16BIT width;
55  U16BIT height;
56 } S_STYLE_SIZE;
57 
58 
59 //---Global type defs for public use-------------------------------------------
60 
61 typedef struct s_style
62 {
63  S_OBJECT_DATA obj;
64  E_POSITION position;
65  S_HBBTV_RECT rect;
66 } S_STYLE;
67 
68 //---Global Function prototypes for public use---------------------------------
69 
70 S_STYLE* StyleCreate(NPP instance, char *style_str);
71 void StyleDestroy(S_STYLE *style);
72 
73 //NPObject* StyleForObject(NPP instance, NPNVariable variable);
76 S_STYLE_SIZE SizeForPlugin(NPP instance);
77 void ScreenRectForPlugin(NPP instance, S_HBBTV_RECT *rect);
78 
79 E_POSITION StylePosition(NPP instance, NPObject *style_obj);
80 S_OFFSET StyleOffset(NPP instance, NPObject *style_obj);
81 S_STYLE_SIZE StyleSize(NPP instance, NPObject *style_obj);
82 void StyleRect(NPP instance, NPObject *style_obj, S_HBBTV_RECT *rect);
83 void StyleSetRect(NPP instance, NPObject *style_obj, S_HBBTV_RECT *rect);
84 void StyleSetWidth(NPP instance, NPObject *style_obj, U16BIT width);
85 void StyleSetHeight(NPP instance, NPObject *style_obj, U16BIT height);
86 const char* StylePositionString(E_POSITION pos);
87 
88 #endif /*_STYLE_H*/
Definition: npapi.h:178
void StyleSetRect(NPP instance, NPObject *style_obj, S_HBBTV_RECT *rect)
Definition: style.c:1185
NPObject * StyleObjectForPlugin(NPP instance)
Definition: style.c:990
Definition: style.h:52
NPAPI Plugin.
Definition: hbbtv_types.h:173
void ScreenRectForPlugin(NPP instance, S_HBBTV_RECT *rect)
Definition: style.c:1094
Definition: style.h:61
void StyleRect(NPP instance, NPObject *style_obj, S_HBBTV_RECT *rect)
Definition: style.c:1142
Definition: style.h:46
void StyleSetWidth(NPP instance, NPObject *style_obj, U16BIT width)
Definition: style.c:1213
void StyleSetHeight(NPP instance, NPObject *style_obj, U16BIT height)
Definition: style.c:1234
S_OFFSET StyleOffset(NPP instance, NPObject *style_obj)
Definition: style.c:1255
void StyleDestroy(S_STYLE *style)
Definition: style.c:1131
const char * StylePositionString(E_POSITION pos)
Definition: style.c:1307
E_POSITION StylePosition(NPP instance, NPObject *style_obj)
Definition: style.c:1289
S_STYLE_SIZE StyleSize(NPP instance, NPObject *style_obj)
Definition: style.c:1270
Definition: npruntime.h:323
Definition: plugin.h:69
S_STYLE * StyleCreate(NPP instance, char *style_str)
Style Create - Create the Style and store in link list.
Definition: style.c:941
S_OFFSET ScreenOffsetForPlugin(NPP instance)
Definition: style.c:1031