Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********************************************************************[libaroma]*
- * Copyright (C) 2011-2015 Ahmad Amarullah (http://amarullz.com/)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *______________________________________________________________________________
- *
- * Filename : aroma_api.h
- * Description : libaroma api header
- *
- * + This is part of libaroma, an embedded ui toolkit.
- * + 20/01/16 - Author(s): Ahmad Amarullah
- *
- */
- #ifndef __aroma_api_h__
- #define __aroma_api_h__
- /* extern for cpp */
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include <stdint.h>
- #include <stdio.h>
- #include <stdlib.h>
- /* primitive unsigneds */
- typedef uint8_t byte;
- typedef uint16_t word;
- typedef uint32_t dword;
- typedef uint32_t uchar;
- typedef byte * bytep;
- typedef word * wordp;
- typedef dword * dwordp;
- #ifndef ZLIB_H
- typedef void * voidp;
- #endif
- typedef uchar * ucharp;
- typedef word acolor;
- typedef wordp acolorp;
- /* libaroma pointers */
- typedef voidp acanvas;
- typedef voidp awindow;
- typedef voidp acontrol;
- typedef voidp alist;
- typedef voidp amessage;
- typedef voidp astream;
- typedef voidp atext;
- typedef voidp aarray;
- typedef voidp azip;
- /* canvas api */
- typedef struct{
- /* new */
- acanvas (*new)(int w,int h);
- acanvas (*new_alpha)(int w,int h);
- acanvas (*new_shmem)(int w,int h, byte alpha_canvas, const char * shmemname);
- acanvas (*new_area)(acanvas parent,int x,int y, int w, int h);
- /* free */
- acanvas (*free)(acanvas c);
- acanvas (*free_delete_shm)(acanvas c);
- /* duplicate */
- acanvas (*dup)(acanvas source);
- /* data processing */
- void (*clear)(acanvas c);
- void (*fill)(acanvas c, acolor color);
- void (*set)(acanvas c, acolor color, byte alpha);
- /* get */
- int (*width)(acanvas c);
- int (*height)(acanvas c);
- int (*size)(acanvas c);
- int (*line)(acanvas c);
- acolorp (*data)(acanvas c);
- bytep (*alpha)(acanvas c);
- byte (*is_shmem)(acanvas c);
- byte (*is_child)(acanvas c);
- } acanvas_api_t, *acanvas_api;
- /* draw api */
- typedef struct{
- awindow (*window)(int x,int y, int w, int h);
- } aui_api_t, *aui_api;
- /* context */
- typedef struct{
- acanvas_api canvas;
- adraw_api draw;
- aui_api ui;
- amessage_api message;
- astream_api stream;
- autil_api util;
- } acontext_t, * acontext;
- /* end of extern for cpp */
- #ifdef __cplusplus
- }
- #endif
- #endif /* __aroma_api_h__ */
Advertisement
Add Comment
Please, Sign In to add comment