Rev 112 | Rev 115 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 112 | Rev 114 | ||
---|---|---|---|
Line 67... | Line 67... | ||
67 | db 0 |
67 | db 0 |
68 | dd servetable-0x10000 |
68 | dd servetable-0x10000 |
69 | draw_line dd __sys_draw_line |
69 | draw_line dd __sys_draw_line |
70 | disable_mouse dd __sys_disable_mouse |
70 | disable_mouse dd __sys_disable_mouse |
71 | draw_pointer dd __sys_draw_pointer |
71 | draw_pointer dd __sys_draw_pointer |
- | 72 | ;//mike.dld, 2006-08-02 [ |
|
72 | drawbar dd __sys_drawbar |
73 | ;drawbar dd __sys_drawbar |
- | 74 | drawbar dd __sys_drawbar.forced |
|
- | 75 | ;//mike.dld, 2006-08-02 ] |
|
73 | putpixel dd __sys_putpixel |
76 | putpixel dd __sys_putpixel |
74 | ; } mike.dld |
77 | ; } mike.dld |
Line 75... | Line 78... | ||
75 | 78 | ||
76 | version db 'Kolibri OS version 0.5.8.1 ',13,10,13,10,0 |
79 | version db 'Kolibri OS version 0.5.8.1 ',13,10,13,10,0 |
Line 2854... | Line 2857... | ||
2854 | inc [mouse_pause] |
2857 | inc [mouse_pause] |
2855 | call [disable_mouse] |
2858 | call [disable_mouse] |
2856 | call sys_set_window |
2859 | call sys_set_window |
2857 | call [disable_mouse] |
2860 | call [disable_mouse] |
2858 | call drawwindow_I |
2861 | call drawwindow_I |
2859 | dec [mouse_pause] |
2862 | ;dec [mouse_pause] |
2860 | call [draw_pointer] |
2863 | ;call [draw_pointer] |
2861 | ret |
2864 | ;ret |
- | 2865 | jmp draw_window_caption.2 |
|
2862 | nosyswI: |
2866 | nosyswI: |
Line 2863... | Line 2867... | ||
2863 | 2867 | ||
2864 | cmp edi,1 ; type II - only reserve area, no draw |
2868 | cmp edi,1 ; type II - only reserve area, no draw |
2865 | jne nosyswII |
2869 | jne nosyswII |
Line 2878... | Line 2882... | ||
2878 | inc [mouse_pause] |
2882 | inc [mouse_pause] |
2879 | call [disable_mouse] |
2883 | call [disable_mouse] |
2880 | call sys_set_window |
2884 | call sys_set_window |
2881 | call [disable_mouse] |
2885 | call [disable_mouse] |
2882 | call drawwindow_III |
2886 | call drawwindow_III |
2883 | dec [mouse_pause] |
2887 | ;dec [mouse_pause] |
2884 | call [draw_pointer] |
2888 | ;call [draw_pointer] |
2885 | ret |
2889 | ;ret |
- | 2890 | jmp draw_window_caption.2 |
|
2886 | nosyswIII: |
2891 | nosyswIII: |
Line 2887... | Line 2892... | ||
2887 | 2892 | ||
2888 | cmp edi,3 ; type IV - skinned window |
2893 | cmp edi,3 ; type IV - skinned window |
Line 2900... | Line 2905... | ||
2900 | inc [mouse_pause] |
2905 | inc [mouse_pause] |
2901 | call [disable_mouse] |
2906 | call [disable_mouse] |
2902 | call sys_set_window |
2907 | call sys_set_window |
2903 | call [disable_mouse] |
2908 | call [disable_mouse] |
2904 | call drawwindow_IV |
2909 | call drawwindow_IV |
- | 2910 | ;dec [mouse_pause] |
|
- | 2911 | ;call [draw_pointer] |
|
- | 2912 | ;ret |
|
- | 2913 | jmp draw_window_caption.2 |
|
- | 2914 | nosyswIV: |
|
- | 2915 | ||
- | 2916 | ret |
|
- | 2917 | ||
- | 2918 | ||
- | 2919 | draw_window_caption: |
|
- | 2920 | inc [mouse_pause] |
|
- | 2921 | call [disable_mouse] |
|
- | 2922 | ||
- | 2923 | xor eax,eax |
|
- | 2924 | mov edx,[0x3004] |
|
- | 2925 | movzx edx,word[0xC400+edx*2] |
|
- | 2926 | cmp edx,[0x3000] |
|
- | 2927 | jne @f |
|
- | 2928 | inc eax |
|
- | 2929 | @@: mov edx,[0x3000] |
|
- | 2930 | shl edx,5 |
|
- | 2931 | add edx,window_data |
|
- | 2932 | movzx ebx,[edx+WDATA.fl_wstyle] |
|
- | 2933 | and bl,0x0F |
|
- | 2934 | cmp bl,3 |
|
- | 2935 | jne .not_style_3 |
|
- | 2936 | ||
- | 2937 | push edx |
|
- | 2938 | call drawwindow_IV_caption |
|
- | 2939 | add esp,4 |
|
- | 2940 | jmp .2 |
|
- | 2941 | ||
- | 2942 | .not_style_3: |
|
- | 2943 | cmp bl,2 |
|
- | 2944 | jne .not_style_2 |
|
- | 2945 | ||
- | 2946 | call drawwindow_III_caption |
|
- | 2947 | jmp .2 |
|
- | 2948 | ||
- | 2949 | .not_style_2: |
|
- | 2950 | cmp bl,0 |
|
- | 2951 | jne .2 |
|
- | 2952 | ||
- | 2953 | call drawwindow_I_caption |
|
- | 2954 | ||
- | 2955 | ;-------------------------------------------------------------- |
|
- | 2956 | .2: ;jmp @f |
|
- | 2957 | mov edi,[0x3000] |
|
- | 2958 | shl edi,5 |
|
- | 2959 | test [edi+window_data+WDATA.fl_wstyle],WSTYLE_HASCAPTION |
|
- | 2960 | jz @f |
|
- | 2961 | mov ecx,[edi*8+0x80000+APPDATA.wnd_caption] |
|
- | 2962 | or ecx,ecx |
|
- | 2963 | jz @f |
|
- | 2964 | add ecx,[edi+twdw+0x10] |
|
- | 2965 | ||
- | 2966 | movzx eax,[edi+window_data+WDATA.fl_wstyle] |
|
- | 2967 | and al,0x0F |
|
- | 2968 | cmp al,3 |
|
- | 2969 | jne .not_skinned |
|
- | 2970 | ||
- | 2971 | mov ebp,[edi+window_data+WDATA.box.left-2] |
|
- | 2972 | mov bp,word[edi+window_data+WDATA.box.top] |
|
- | 2973 | movzx eax,word[edi+window_data+WDATA.box.width] |
|
- | 2974 | sub ax,[_skinmargins.left] |
|
- | 2975 | sub ax,[_skinmargins.right] |
|
- | 2976 | cwde |
|
- | 2977 | cdq |
|
- | 2978 | mov ebx,6 |
|
- | 2979 | idiv ebx |
|
- | 2980 | or eax,eax |
|
- | 2981 | js @f |
|
- | 2982 | mov edx,eax |
|
- | 2983 | mov eax,dword[_skinmargins.left-2] |
|
- | 2984 | mov ax,word[_skinh] |
|
- | 2985 | sub ax,[_skinmargins.bottom] |
|
- | 2986 | sub ax,[_skinmargins.top] |
|
- | 2987 | sar ax,1 |
|
- | 2988 | adc ax,0 |
|
- | 2989 | add ax,[_skinmargins.top] |
|
- | 2990 | add ax,-3 |
|
- | 2991 | add eax,ebp |
|
- | 2992 | mov ebx,[common_colours+16];0x00FFFFFF |
|
- | 2993 | xor edi,edi |
|
- | 2994 | call dtext |
|
- | 2995 | jmp @f |
|
- | 2996 | ||
- | 2997 | .not_skinned: |
|
- | 2998 | cmp al,1 |
|
- | 2999 | je @f |
|
- | 3000 | ||
- | 3001 | mov ebp,[edi+window_data+WDATA.box.left-2] |
|
- | 3002 | mov bp,word[edi+window_data+WDATA.box.top] |
|
- | 3003 | movzx eax,word[edi+window_data+WDATA.box.width] |
|
- | 3004 | sub eax,16 |
|
- | 3005 | cwde |
|
- | 3006 | cdq |
|
- | 3007 | mov ebx,6 |
|
- | 3008 | idiv ebx |
|
- | 3009 | or eax,eax |
|
- | 3010 | js @f |
|
- | 3011 | mov edx,eax |
|
- | 3012 | mov eax,0x00080007 |
|
- | 3013 | add eax,ebp |
|
- | 3014 | mov ebx,[common_colours+16];0x00FFFFFF |
|
- | 3015 | xor edi,edi |
|
- | 3016 | call dtext |
|
- | 3017 | jmp @f |
|
- | 3018 | ||
- | 3019 | @@: |
|
- | 3020 | ;-------------------------------------------------------------- |
|
2905 | dec [mouse_pause] |
3021 | dec [mouse_pause] |
2906 | call [draw_pointer] |
3022 | call [draw_pointer] |
2907 | ret |
3023 | ret |
2908 | nosyswIV: |
- | |
Line -... | Line 3024... | ||
- | 3024 | ||
- | 3025 | iglobal |
|
- | 3026 | align 4 |
|
- | 3027 | window_topleft dd \ |
|
- | 3028 | 1, 21,\ |
|
- | 3029 | 0, 0,\ |
|
- | 3030 | 5, 20,\ |
|
- | 3031 | 5, ? |
|
- | 3032 | endg |
|
- | 3033 | ||
- | 3034 | set_window_clientbox: |
|
- | 3035 | push eax ecx edi |
|
- | 3036 | ||
- | 3037 | mov eax,[_skinh] |
|
- | 3038 | mov [window_topleft+4*7],eax |
|
- | 3039 | ||
- | 3040 | mov ecx,edi |
|
- | 3041 | sub edi,window_data |
|
- | 3042 | shl edi,3 |
|
- | 3043 | test [ecx+WDATA.fl_wstyle],WSTYLE_CLIENTRELATIVE |
|
- | 3044 | jz @f |
|
- | 3045 | ||
- | 3046 | movzx eax,[ecx+WDATA.fl_wstyle] |
|
- | 3047 | and eax,0x0F |
|
- | 3048 | mov eax,[eax*8+window_topleft+0] |
|
- | 3049 | mov [edi+0x80000+APPDATA.wnd_clientbox.left],eax |
|
- | 3050 | shl eax,1 |
|
- | 3051 | neg eax |
|
- | 3052 | add eax,[ecx+WDATA.box.width] |
|
- | 3053 | mov [edi+0x80000+APPDATA.wnd_clientbox.width],eax |
|
- | 3054 | ||
- | 3055 | movzx eax,[ecx+WDATA.fl_wstyle] |
|
- | 3056 | and eax,0x0F |
|
- | 3057 | push [eax*8+window_topleft+0] |
|
- | 3058 | mov eax,[eax*8+window_topleft+4] |
|
- | 3059 | mov [edi+0x80000+APPDATA.wnd_clientbox.top],eax |
|
- | 3060 | neg eax |
|
- | 3061 | sub eax,[esp] |
|
- | 3062 | add eax,[ecx+WDATA.box.height] |
|
- | 3063 | mov [edi+0x80000+APPDATA.wnd_clientbox.height],eax |
|
- | 3064 | add esp,4 |
|
- | 3065 | ||
2909 | 3066 | pop edi ecx eax |
|
- | 3067 | ret |
|
- | 3068 | @@: |
|
- | 3069 | xor eax,eax |
|
- | 3070 | mov [edi+0x80000+APPDATA.wnd_clientbox.left],eax |
|
- | 3071 | mov [edi+0x80000+APPDATA.wnd_clientbox.top],eax |
|
- | 3072 | mov eax,[ecx+WDATA.box.width] |
|
- | 3073 | mov [edi+0x80000+APPDATA.wnd_clientbox.width],eax |
|
- | 3074 | mov eax,[ecx+WDATA.box.height] |
|
Line -... | Line 3075... | ||
- | 3075 | mov [edi+0x80000+APPDATA.wnd_clientbox.height],eax |
|
- | 3076 | ||
Line 2910... | Line 3077... | ||
2910 | ret |
3077 | pop edi ecx eax |
Line 2911... | Line 3078... | ||
2911 | 3078 | ret |
|
2912 | 3079 | ||
2913 | sys_set_window: |
3080 | sys_set_window: |
Line 2914... | Line 3081... | ||
2914 | 3081 | ||
2915 | mov edi,[0x3000] |
3082 | mov edi,[0x3000] |
2916 | shl edi,5 |
3083 | shl edi,5 |
2917 | add edi,window_data |
3084 | add edi,window_data |
- | 3085 | ||
- | 3086 | ; colors |
|
Line 2918... | Line 3087... | ||
2918 | 3087 | mov [edi+WDATA.cl_workarea],ecx |
|
2919 | ; colors |
3088 | mov [edi+WDATA.cl_titlebar],edx |
2920 | mov [edi+16],ecx |
3089 | mov [edi+WDATA.cl_frames],esi |
Line 2921... | Line 3090... | ||
2921 | mov [edi+20],edx |
3090 | |
2922 | mov [edi+24],esi |
3091 | call set_window_clientbox |
2923 | 3092 | ||
2924 | ; check flag (?) |
3093 | ; check flag (?) |
2925 | cmp [edi+30],byte 1 |
3094 | cmp [edi+WDATA.fl_wdrawn],1 |
Line 2926... | Line 3095... | ||
2926 | jz newd |
3095 | jz newd |
2927 | 3096 | ||
2928 | push eax |
3097 | push eax |
2929 | mov eax,[timer_ticks] ;[0xfdf0] |
3098 | mov eax,[timer_ticks] ;[0xfdf0] |
2930 | add eax,100 |
3099 | add eax,100 |
2931 | mov [new_window_starting],eax |
3100 | mov [new_window_starting],eax |
Line 2932... | Line 3101... | ||
2932 | pop eax |
3101 | pop eax |
Line 2933... | Line 3102... | ||
2933 | 3102 | ||
2934 | mov [edi+8],ax |
3103 | mov word[edi+WDATA.box.width],ax |
- | 3104 | mov word[edi+WDATA.box.height],bx |
|
- | 3105 | sar eax,16 |
|
- | 3106 | sar ebx,16 |
|
2935 | mov [edi+12],bx |
3107 | mov word[edi+WDATA.box.left],ax |
2936 | shr eax,16 |
- | |
2937 | shr ebx,16 |
3108 | mov word[edi+WDATA.box.top],bx |
2938 | mov [edi+00],ax |
3109 | |
- | 3110 | ||
- | 3111 | call check_window_position |
|
- | 3112 | ||
- | 3113 | ||
- | 3114 | push ecx esi edi ; save for window fullscreen/resize |
|
- | 3115 | ;mov esi,edi |
|
- | 3116 | ||
- | 3117 | mov cl,[edi+WDATA.fl_wstyle] |
|
2939 | mov [edi+04],bx |
3118 | |
2940 | 3119 | sub edi,window_data |
|
2941 | 3120 | shl edi,3 |
|
2942 | call check_window_position |
3121 | add edi,0x80000+0x90 |
Line 2972... | Line 3151... | ||
2972 | mov [edi+31],byte 0 ; no redraw |
3151 | mov [edi+31],byte 0 ; no redraw |
2973 | mov edx,edi |
3152 | mov edx,edi |
Line 2974... | Line 3153... | ||
2974 | 3153 | ||
Line -... | Line 3154... | ||
- | 3154 | ret |
|
- | 3155 | ||
- | 3156 | syscall_windowsettings: |
|
- | 3157 | ||
- | 3158 | .set_window_caption: |
|
- | 3159 | dec eax ; subfunction #1 - set window caption |
|
- | 3160 | jnz .get_window_caption |
|
- | 3161 | ||
- | 3162 | ; NOTE: only window owner thread can set its caption, |
|
- | 3163 | ; so there's no parameter for PID/TID |
|
- | 3164 | ||
- | 3165 | mov edi,[0x3000] |
|
- | 3166 | shl edi,5 |
|
- | 3167 | ||
- | 3168 | ; have to check if caption is within application memory limit |
|
- | 3169 | ; check is trivial, and if application resizes its memory, |
|
- | 3170 | ; caption still can become over bounds |
|
- | 3171 | mov ecx,[edi*8+0x80000+APPDATA.mem_size] |
|
- | 3172 | add ecx,255 ; max caption length |
|
- | 3173 | cmp ebx,ecx |
|
- | 3174 | ja .exit_fail |
|
- | 3175 | ||
- | 3176 | mov [edi*8+0x80000+APPDATA.wnd_caption],ebx |
|
- | 3177 | or [edi+window_data+WDATA.fl_wstyle],WSTYLE_HASCAPTION |
|
- | 3178 | ||
- | 3179 | call draw_window_caption |
|
- | 3180 | ||
- | 3181 | xor eax,eax ; eax = 0 (success) |
|
- | 3182 | ret |
|
- | 3183 | ||
- | 3184 | .get_window_caption: |
|
- | 3185 | dec eax ; subfunction #2 - get window caption |
|
- | 3186 | jnz .exit_fail |
|
- | 3187 | ||
- | 3188 | ; not implemented yet |
|
- | 3189 | ||
- | 3190 | .exit_fail: |
|
- | 3191 | xor eax,eax |
|
- | 3192 | inc eax ; eax = 1 (fail) |
|
Line 2975... | Line 3193... | ||
2975 | ret |
3193 | ret |
Line 2976... | Line 3194... | ||
2976 | 3194 | ||
2977 | 3195 | ||
Line 3964... | Line 4182... | ||
3964 | test ecx,0xFFFF0000 |
4182 | test ecx,0xFFFF0000 |
3965 | jnz @f |
4183 | jnz @f |
3966 | .exit: |
4184 | .exit: |
3967 | ret |
4185 | ret |
3968 | @@: |
4186 | @@: |
- | 4187 | mov edi,[0x3000] |
|
- | 4188 | shl edi,8 |
|
- | 4189 | add dx,word[edi+0x80000+APPDATA.wnd_clientbox.top] |
|
- | 4190 | rol edx,16 |
|
- | 4191 | add dx,word[edi+0x80000+APPDATA.wnd_clientbox.left] |
|
- | 4192 | rol edx,16 |
|
- | 4193 | .forced: |
|
3969 | mov eax, vga_putimage |
4194 | mov eax, vga_putimage |
3970 | cmp [0xfe0c], word 0x12 |
4195 | cmp [0xfe0c], word 0x12 |
3971 | jz .doit |
4196 | jz .doit |
3972 | mov eax, vesa12_putimage |
4197 | mov eax, vesa12_putimage |
3973 | cmp [0xfe0c], word 0100000000000000b |
4198 | cmp [0xfe0c], word 0100000000000000b |
Line 3987... | Line 4212... | ||
3987 | ; ecx x end |
4212 | ; ecx x end |
3988 | ; edx y end |
4213 | ; edx y end |
3989 | ; edi color |
4214 | ; edi color |
Line 3990... | Line 4215... | ||
3990 | 4215 | ||
- | 4216 | __sys_drawbar: |
|
- | 4217 | mov esi,[0x3000] |
|
- | 4218 | shl esi,8 |
|
- | 4219 | add eax,[esi+0x80000+APPDATA.wnd_clientbox.left] |
|
- | 4220 | add ecx,[esi+0x80000+APPDATA.wnd_clientbox.left] |
|
- | 4221 | add ebx,[esi+0x80000+APPDATA.wnd_clientbox.top] |
|
- | 4222 | add edx,[esi+0x80000+APPDATA.wnd_clientbox.top] |
|
3991 | __sys_drawbar: |
4223 | .forced: |
3992 | inc [mouse_pause] |
4224 | inc [mouse_pause] |
3993 | cmp [0xfe0c],word 0x12 |
4225 | cmp [0xfe0c],word 0x12 |
3994 | jne sdbv20 |
4226 | jne sdbv20 |
3995 | call vga_drawbar |
4227 | call vga_drawbar |
Line 4665... | Line 4897... | ||
4665 | 4897 | ||
4666 | 4898 | ||
4667 | mov edx,[0x3010] |
4899 | mov edx,[0x3010] |
- | 4900 | add eax,[edx-twdw] |
|
- | 4901 | add ebx,[edx-twdw+4] |
|
- | 4902 | mov edi,[0x3000] |
|
- | 4903 | shl edi,8 |
|
4668 | add eax,[edx-twdw] |
4904 | add eax,[edi+0x80000+APPDATA.wnd_clientbox.left] |
4669 | add ebx,[edx-twdw+4] |
4905 | add ebx,[edi+0x80000+APPDATA.wnd_clientbox.top] |
4670 | xor edi,edi ; no force |
4906 | xor edi,edi ; no force |
4671 | ;mov edi,1 |
4907 | ; mov edi,1 |
Line 4676... | Line 4912... | ||
4676 | 4912 | ||
Line 4677... | Line 4913... | ||
4677 | syscall_writetext: ; WriteText |
4913 | syscall_writetext: ; WriteText |
4678 | 4914 | ||
- | 4915 | mov edi,[0x3010] |
|
- | 4916 | mov ebp,[edi-twdw] |
|
- | 4917 | mov esi,[0x3000] |
|
4679 | mov edi,[0x3010] |
4918 | shl esi,8 |
4680 | mov ebp,[edi-twdw] |
4919 | add ebp,[esi+0x80000+APPDATA.wnd_clientbox.left] |
- | 4920 | shl ebp,16 |
|
4681 | shl ebp,16 |
4921 | add ebp,[edi-twdw+4] |
4682 | add ebp,[edi-twdw+4] |
4922 | add bp,word[esi+0x80000+APPDATA.wnd_clientbox.top] |
4683 | add edi,0x10 |
4923 | add edi,0x10 |
4684 | add ecx,[edi] |
4924 | add ecx,[edi] |
4685 | add eax,ebp |
4925 | add eax,ebp |
Line 4712... | Line 4952... | ||
4712 | je drectr |
4952 | je drectr |
4713 | movzx ecx,ax |
4953 | movzx ecx,ax |
4714 | shr eax,16 |
4954 | shr eax,16 |
4715 | movzx edx,bx |
4955 | movzx edx,bx |
4716 | shr ebx,16 |
4956 | shr ebx,16 |
- | 4957 | mov esi,[0x3000] |
|
- | 4958 | shl esi,8 |
|
- | 4959 | add eax,[esi+0x80000+APPDATA.wnd_clientbox.left] |
|
- | 4960 | add ebx,[esi+0x80000+APPDATA.wnd_clientbox.top] |
|
4717 | add ecx,eax |
4961 | add ecx,eax |
4718 | add edx,ebx |
4962 | add edx,ebx |
4719 | jmp [drawbar] |
4963 | jmp [drawbar] |
4720 | drectr: |
4964 | drectr: |
4721 | ret |
4965 | ret |
Line 4836... | Line 5080... | ||
4836 | syscall_drawline: ; DrawLine |
5080 | syscall_drawline: ; DrawLine |
Line 4837... | Line 5081... | ||
4837 | 5081 | ||
4838 | mov edi,[0x3010] |
5082 | mov edi,[0x3010] |
4839 | movzx edx,word[edi-twdw] |
5083 | movzx edx,word[edi-twdw] |
- | 5084 | mov ebp,edx |
|
- | 5085 | mov esi,[0x3000] |
|
- | 5086 | shl esi,8 |
|
- | 5087 | add ebp,[esi+0x80000+APPDATA.wnd_clientbox.left] |
|
4840 | mov ebp,edx |
5088 | add dx,word[esi+0x80000+APPDATA.wnd_clientbox.left] |
4841 | shl edx,16 |
5089 | shl edx,16 |
4842 | add ebp,edx |
5090 | add ebp,edx |
4843 | movzx edx,word[edi-twdw+4] |
5091 | movzx edx,word[edi-twdw+4] |
4844 | add eax,ebp |
5092 | add eax,ebp |
- | 5093 | mov ebp,edx |
|
- | 5094 | add ebp,[esi+0x80000+APPDATA.wnd_clientbox.top] |
|
4845 | mov ebp,edx |
5095 | add dx,word[esi+0x80000+APPDATA.wnd_clientbox.top] |
4846 | shl edx,16 |
5096 | shl edx,16 |
4847 | xor edi,edi |
5097 | xor edi,edi |
4848 | add edx,ebp |
5098 | add edx,ebp |
4849 | add ebx,edx |
5099 | add ebx,edx |