ui/common/utils.c

changeset 930
4ce8df2311f0
parent 927
b8c0f718b141
child 985
93f07ccfd997
equal deleted inserted replaced
929:43cb1ea4c582 930:4ce8df2311f0
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #include "utils.h" 29 #include "utils.h"
30 #include "properties.h"
30 31
31 #include <cx/string.h> 32 #include <cx/string.h>
32 33
33 UiPathElm* ui_default_pathelm_func(const char* full_path, size_t len, size_t* ret_nelm, void* data) { 34 UiPathElm* ui_default_pathelm_func(const char* full_path, size_t len, size_t* ret_nelm, void* data) {
34 cxstring *pathelms; 35 cxstring *pathelms;
67 } 68 }
68 *ret_nelm = n; 69 *ret_nelm = n;
69 70
70 return elms; 71 return elms;
71 } 72 }
73
74 void ui_get_window_default_width(int *width, int *height) {
75 const char *width_str = ui_get_property("ui.window.width");
76 const char *height_str = ui_get_property("ui.window.height");
77 if(width_str && height_str) {
78 int w = atoi(width_str);
79 int h = atoi(height_str);
80 if(w > 0 && h > 0) {
81 *width = w;
82 *height = h;
83 }
84 }
85 }

mercurial